-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Automatically switch provider based on envirnment variables, Ollama support: closes #13 #50
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
Conversation
|
Thank you! I'm a bit worried that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice and clean, very extensible too if anyone wanted to add new providers down the line.
|
hihi @Le09 do you think it is required to add in the top section of the call_llm.py I tried your branch and it seems this is needed for load the .env file when the script executed |
|
@redliu312 Oh, I see. workon Tutorial-Codebase-Knowledge-venv # activate your virtual environment with the correct set of python dependencies
source .env # load the API keys
python file.pyIf done this way, the variables are available in everything that you do in this terminal. So |
|
@zachary62 I pulled this into my clone of the repo, and set ❯ ./python utils/call_llm.py
Making call...
Response: Hello! I'm doing great—I'm an AI, so I'm always powered up and ready to chat. How about you? What can I help with today?Would be great to see this merged. |
|
Could the conflicts be resolved? I will merge it then. Thank you! |
Hmm, I just did |
|
Beat me to it :-) |
Yeah, full credit to you... my git fu didn't allow me to preserve you in the commit history. Apologies for that. |
|
@taqtiqa-mark The standard flow is that you simply add the repo on which the fork is as a new remote and fetch it so that you can cherry-pick the commit (in which case the original author stays, and you appear as the committer). Maybe a bit simpler, you can checkout the Github PR (you can do so with the gh CLI tool). Anyway, cheers! |
Fairly straightforward. In the spirit of the repo, I've kept things simple rather than also automatically add everything (like optional Anthropic libraries or others).
I think asking beginners to modify directly
call_llmposes a risk of them putting their private keys on Github, so it's better to have them learn how to use environment variables to avoid taking chances.