Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to override :base_url #29

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Be able to override :base_url #29

merged 2 commits into from
Aug 27, 2024

Conversation

preciz
Copy link
Contributor

@preciz preciz commented Aug 21, 2024

These days one codebase usually uses more than one OpenAI compatible API provider at the same time.

This PR provides the ability to override the base URL.

Example usage:

msgs = [%{role: :user, content: "Hello!"}]

ExOpenAI.Chat.create_chat_completion(msgs, "hf:mistralai/Mistral-7B-Instruct-v0.3",
  base_url: "https://cheapai.local",
  openai_api_key: "1234"
)

@preciz
Copy link
Contributor Author

preciz commented Aug 21, 2024

Solves #24

@dvcrn
Copy link
Owner

dvcrn commented Aug 27, 2024

Thanks for the PR! Looking good!

I'll try to get this released within the next few days ❤️

@dvcrn dvcrn merged commit e4de946 into dvcrn:main Aug 27, 2024
1 check passed
@dvcrn
Copy link
Owner

dvcrn commented Sep 1, 2024

Released in 1.7 - https://github.com/dvcrn/ex_openai/releases/tag/1.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants