You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromgoogle.ai.generativelanguage_v1beta.typesimportToolasGenAIToolfromlangchain_core.messagesimportHumanMessagefromlangchain_google_genaiimportChatGoogleGenerativeAIchat_model=ChatGoogleGenerativeAI(model="gemini-2.5-flash", google_api_key="foo")
# Generates the error:# ValueError: Unknown field for Tool: url_contextresult=chat_model.invoke(
[
HumanMessage(
content="Can you access this url? https://python.langchain.com/docs/integrations/chat/google_generative_ai/#built-in-tools"
)
],
tools=[GenAITool(url_context={})],
)
print(result)
Description
I'm trying to use Gemini's url_context with LangChain. I've read the LangChain documentation, but I was unable to use the url_context because of the error described above in the code snippet.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
Commit to Help
Example Code
Description
I'm trying to use Gemini's url_context with LangChain. I've read the LangChain documentation, but I was unable to use the url_context because of the error described above in the code snippet.
System Info
Beta Was this translation helpful? Give feedback.
All reactions