Closed namitharajb closed 1 week ago
@lkuligin I see that the refactoring was done by you. It would be great if you could take a look at this issue as this is blocking us from using latest langchain and langchain-google versions.
It looks like you're doing some additional transformations on your side.
This code works fine with the latest version of libraries:
from langchain_google_genai import ChatGoogleGenerativeAI
llm = ChatGoogleGenerativeAI(model="gemini-pro", google_api_key=api_key)
from langchain_core.prompts.prompt import PromptTemplate
from langchain.chains import LLMChain
tweet_prompt = PromptTemplate.from_template("You are a content creator. Write me a tweet about {topic}.")
chain = LLMChain(llm=llm, prompt=tweet_prompt, verbose=True)
response = chain.invoke('How does it feel to experience snow in summer?')
print(response)
so essentially there're no breaking changes to the standard interfaces, if you're using low-level private methods, maybe you need to adjust things on your side accordingly, but I'm not sure it can be treated as a "breaking change".
@lkuligin There hasn't been any code changes in our sdk where we use langchain-google, the above error is caused only when I upgrade the library to version 1.0.4 or higher. If I use 1.0.3 the "invoke" call works fine.
The argument "request" in the error is also something that is added within langchain_google_genai and not from our code.
E TypeError: generate_content() got an unexpected keyword argument 'request'
../../ENV/lib/python3.9/site-packages/langchain_google_genai/chat_models.py:171: TypeError
This request attribute is set within https://github.com/langchain-ai/langchain-google/blob/f11446a743f104703ddd9bac811a4527a85ae90a/libs/genai/langchain_google_genai/chat_models.py#L760
Which is the compatible version of google-generativeai library for the latest version 1.0.6 of langchain-google-genai? Because it seems to complain if I try to use latest version of google-generativeai (0.7.0).
Hi, We are using langchain-google-genai in our AI sdk and for langchain integration of gemini model, we use langchain-google-genai, which was working fine with version 1.0.3 and as soon as I update it to version 1.0.4 or higher I get below error from chat_models.py:187: in _chat_with_retry.
Previously we had following library version:
now when I update to :
This request parameter is added in https://github.com/langchain-ai/langchain-google/blob/f11446a743f104703ddd9bac811a4527a85ae90a/libs/genai/langchain_google_genai/chat_models.py#L760
The version 1.0.3 worked as expected but not in version 1.0.4 or higher and I see there was a refactoring done, could you please let me know if there is any change in the way we invoke the chain or initialize the model is exactly like before.
It looks like the refactoring https://github.com/langchain-ai/langchain-google/pull/209/files#diff-789e24521c3e983e4ad9f51a1c0db73ea6fe0e36a60609b2d20026b106c4b813 has caused breaking changes.