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
langchain_google_genai.chat_models.ChatGoogleGenerativeAIError: Invalid argument provided to Gemini: 400 * GenerateContentRequest.contents[2].parts[0].function_response.name: Name cannot be empty.
Description
Tool calling with Gemini requires the tool name to be returned in the tool response, but ToolMessage.name is not being set when created by a legacy agent.
Instead, ToolMessage.additional_kwargs is set to: {"name": "my_tool"}, but this isn't used when building the message Parts to send to Gemini.
So this function needs to be updated to use name = ToolMessage.additional_kwargs["name"]
The text was updated successfully, but these errors were encountered:
Example Code
Error Message and Stack Trace (if applicable)
langchain_google_genai.chat_models.ChatGoogleGenerativeAIError: Invalid argument provided to Gemini: 400 * GenerateContentRequest.contents[2].parts[0].function_response.name: Name cannot be empty.
Description
Tool calling with Gemini requires the tool name to be returned in the tool response, but
ToolMessage.name
is not being set when created by a legacy agent.Instead,
ToolMessage.additional_kwargs
is set to:{"name": "my_tool"}
, but this isn't used when building the message Parts to send to Gemini.So this function needs to be updated to use
name = ToolMessage.additional_kwargs["name"]
The text was updated successfully, but these errors were encountered: