Open josealvarez97 opened 5 months ago
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 C:\Users\BEN-UNKNOWN.virtualenvs\jobfindr\brazvenv\Lib\site-packages\langchain\llms__init__.py:548: LangChainDeprecationWarning: Importing LLMs from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:
from langchain_community.llms import OpenAI
.
To install langchain-community run pip install -U langchain-community
.
warnings.warn(
C:\Users\BEN-UNKNOWN.virtualenvs\jobfindr\brazvenv\Lib\site-packages\langchain__init.py:29: UserWarning: Importing LLMChain from langchain root module is no longer supported. Please use langchain.chains.LLMChain instead.
warnings.warn(
C:\Users\BEN-UNKNOWN.virtualenvs\jobfindr\brazvenv\Lib\site-packages\langchain_core_api\deprecation.py:139: LangChainDeprecationWarning: The method Chain.run
was deprecated in langchain 0.1.0 and will be removed in 0.3.0. Use invoke instead.
warn_deprecated(
Traceback (most recent call last):
File "C:\Users\BEN-UNKNOWN\PycharmProjects\Pet\brazillianscraper\scratch.py", line 64, in
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: