spring-projects / spring-projects/spring-ai
Vertex AI Gemini: The ChatClient/LLM does not make use of the provided tool/s
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 6
Description
Bug description
The ChatClient/LLM does not make use of the provided tool/s when using Gemini
Environment
- Spring AI 1.0.0-M8
- Spring Boot 3.4.5
- Gemini 2.0 Flash
Steps to reproduce
- Define a tool with name and description (@Tool)
- Use VertexAiGeminiChatModel for ChatClient
- Call prompt with tools() and toolContext()
- User prompt with Image
Expected behavior
When running the same ChatClient via OpenAI it makes use of the tool as expected. Gemini seems to ignore the provided tool. I'm not sure if something is wrong on my side. ("vertex.ai.gemini.chat.options.tool-names" config is provided).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with VertexAiGeminiChatModel, ChatClient tools() and toolContext(), an @Tool definition, and an image prompt, then compare the behavior with OpenAI. Done means the configured tool is invoked by Gemini for the reported prompt rather than being ignored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, java, spring-boot
- Domain
- ai, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100