This is using The Go Api from google.golang.org/genai
I am working on an agent using tooling: I create the Chat
session using Create
and in the Tools
field of GenerateContentConfig
I specify the tools available for the model to call.
gemini-2.0-flash
understands the available tooling:
go build ./... && ./agent
Created client connected to BackendGeminiAPI
2025/05/04 14:10:47 curated history is not supported yet
Created chat session (current history length 0) using 'gemini-2.0-flash'
logging conversation to 'session-20250504-1410-aaf0a532b2.md'
Chat with 'gemini-2.0-flash' (use 'ctrl-c' to quit)
You: Hello, I am Bob.
[text 37 bytes][model][0:1][0:1]Hello Bob. How can I help you today?
You: What tools are you able to use?
[text 82 bytes][model][0:1][0:1]I can use the `default_api` which has two functions: `edit_file` and `read_file`.
gemini-2.5-flash-preview-04-17
appears to ignore all but the first tool specified in GenerateContentConfig.Tools
:
go build ./... && ./agent
Created client connected to BackendGeminiAPI
2025/05/04 14:11:24 curated history is not supported yet
Created chat session (current history length 0) using 'gemini-2.5-flash-preview-04-17'
logging conversation to 'session-20250504-1411-9041931599.md'
Chat with 'gemini-2.5-flash-preview-04-17' (use 'ctrl-c' to quit)
You: Hello, I am Bob.
[text 37 bytes][model][0:1][0:1]Hello Bob. How can I help you today?
You: What tools are you able to use?
[text 113 bytes][model][0:1][0:1]I can use the `edit_file` tool to edit the contents of a file by replacing a specific string with another string.
I’ve tested this by varying the order and count of the GenerateContentConfig.Tools
: gemini-2.5-flash-preview-04-17
invariably only sees the first tool (index 0).
Is that a known regression? If yes, are there any suggested workaround? If no, what could I possibly be doing wrong?
Thanks!