-
Notifications
You must be signed in to change notification settings - Fork 456
Allow to modify multiple request options in Python SDK (similar to JavaScript SDK) #367
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
Comments
What’s the update on this. I can’t run a tagging Llm chain cos of this issue. I can create the chain but can’t invoke it, get the error below: C:\Users\BEN-UNKNOWN.virtualenvs\jobfindr\brazvenv\Scripts\python.exe C:\Users\BEN-UNKNOWN\PycharmProjects\Pet\brazillianscraper\scratch.py
To install langchain-community run Process finished with exit code 1 |
Description of the feature request:
I would like the Python SDK to allow the same equivalent functionality as the JavaScript SDK regarding the possibility of modifying the request options
JavaScript SDK (can add many custom request options)
PythonSDK (cannot add many custom request options)
What problem are you trying to solve with this feature?
Some people have talked about how being able to add metadata to requests in these libraries is helpful for proxies, and even tried to implement the solution themselves as you can find below:
I'm simply frustrated by the fact that it's possible to modify the request options in the JavaScript SDK, but not in the Python SDK.
If I can do it in the JavaScript SDK, why can't I do it in the Python SDK? 🤔
For the record, the Open AI Python SDK allows to do it by adding the parameter
default_headers
in the client configuration andextra_headers
in the AI generation call:Any other information you'd like to share?
The documentation also seems to have implemented something similar to
customHeaders
in the request options (https://cloud.google.com/vertex-ai/generative-ai/docs/reference/nodejs/latest/vertexai/requestoptions), but when I installed the Python SDK, it didn't seem to acceptcustomHeaders
as explained above. At any rate, the current Python SDK is far behind the JavaScript SDK in this regard (JS SDK accepts other parameters likebaseUrl
—useful for proxies).Additional context
Add any other context or screenshots about the feature request here.
Other relevant links in this conversation may be:
The text was updated successfully, but these errors were encountered: