spring-projects / spring-projects/spring-ai

Vertex AI Gemini: The ChatClient/LLM does not make use of the provided tool/s

Open
#3,044 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.