Gemini on google-genai: Incorrect handling when responses contain both text and function call parts

Open
#5,007 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
ai

Research direction

Start by comparing the google-genai handling with the related spring-ai issue 4596 and locate where response parts are converted into an AssistantMessage. Reproduce a response containing both text and function-call parts, then verify that the completed message retains both kinds of content.

Written by the indexing model from the issue text.

Description

status: waiting-for-triage

Bug description

Same issue as https://github.com/spring-projects/spring-ai/issues/4596 but with google-genai 'model'.

Multiple parts can be returned, including some with text and some with function calls.

The code currently drops all function calls if a part without function calls exists.

Expected behavior

Both function calls and text should be accumulated into the AssistantMessage

Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 10h
Merged PRs (30d)
5

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.

More from spring-projects/spring-ai

All issues in spring-projects/spring-ai

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.