Closed azliabdullah closed 1 month ago
Fyi, the change below yield the desired ouput with model gemini-1.5-flash
. (functions
is depcreated in openai)
Change
model = model.bind_tools(tools)
To
model = model.bind(
functions=tools,
)
I cannot confirm whether it is a bug or misconconception of usage yet (related code)
Update: https://www.googlecloudcommunity.com/gc/AI-ML/Creating-a-Generative-Model-with-multiple-tools-with-vertexai/m-p/750866 Assuming I understand correctly, u needs to use functions if u have multiple actions
Bind a gemini model with multiple tools but it can only detect 1 tool (the first 1).
Compared with ChatOpenAi, it can access all tools given to it.
Regardless of how you invoke it either directly using
model
,chain
orgraph
, or how you define the tools. I even tried using prebuilt tools. it only can detect 1 tool.I'm using python 3.12.1 langchain-google-genai 1.0.7
Here's the reproducible code
here ChatOpenAi response:
here is ChatGoogleGenerativeAI response
You can ask questions about 2nd and 3rd tool like "what is traffic condition in LA?", "what is tennis score for rafael?". Gemini will say "I don't have access to live event" etc etc, while ChatOpenAi called the tools properly as expected.