-
Notifications
You must be signed in to change notification settings - Fork 133
Bearer key #382
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
base: main
Are you sure you want to change the base?
Bearer key #382
Conversation
|
I am looking forward to the squash... ¯_(ツ)_/¯ |
|
|
||
| self._client = openai.AsyncOpenAI(api_key=api_key, base_url=base_url) | ||
| defHeaders = {} | ||
| if config.get("bearer_token"): |
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.
Seems to me this logic is duplicated 3 times. Is it possible to put it in a function?
And if we want to maintain the original logic, we can choose not to pass dftHeaders if it's empty.
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.
Kinda solved it; but ruff does not like it.. 👎
|
Just run |
a1467ac to
3cb23e9
Compare
Purpose of the change
In order to use LiteLLMs profiling magic, the API calls need to made with a bearer token. This PR added it to the configuration file.
Description
if set it will add an extra HTTP header with the token in it.
Fixes/Closes
Fixes #(issue number)
Type of change
[Please delete options that are not relevant.]
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
[Please delete options that are not relevant.]
Test Results: [Attach logs, screenshots, or relevant output]
Checklist
[Please delete options that are not relevant.]
Maintainer Checklist
Screenshots/Gifs
[If applicable, add screenshots or GIFs that show the changes in action. This is especially helpful for API responses. Otherwise, delete this section or type "N/A".]
Further comments
[Add any other relevant information here, such as potential side effects, future considerations, or any specific questions for the reviewer. Otherwise, type "None".]