-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enable base_url to read from env variables #65
Conversation
@kylehh This change is expected for all nvidia constructors(embedding, ranking etc.) right? |
welcome @kylehh! in addition to Rashmi's comments, let's skip the nvidia_base_url argument option, if people are passing the base url as an argument they can use the existing |
Thanks for reviewing @raspawar yes, I can add similar logic in embedding and reranking. api_key can already read in from env variable ( implemented in _common.py). Will add test case as well |
|
I added base_url logic to embedding and rerank. I see @mattf had a PR for base_url validation. Can we merge both PR and then I will see if I need extra tests for base_url |
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.
please add unit tests for NVIDIA_BASE_URL env var, you can do the same as what is in test_api_key.py
Add root_validator in class ChatNVIDIA to enable base_url read from the env variable
The logic order the validation
1, check
nvidia_base_url
argument in ChatNVIDIA class2, check
base_url
argument in ChatNVIDIA class3, check
NVIDIA_BASE_URL
environment variable4, use the default value defined in
_default_base_url