Skip to content

Conversation

DrauzJu
Copy link
Contributor

@DrauzJu DrauzJu commented Sep 29, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues
License MIT

The Gemini API may return multiple content parts even if a tool call is desired. For example, one content part can be an explanation why the tool was called. This PR adds support for this by first checking if any content part is a functionCall. If so, all other content parts are discarded and the function/tool call is processed.

@carsonbot carsonbot added Status: Needs Review Bug Something isn't working Platform Issues & PRs about the AI Platform component labels Sep 29, 2025
@OskarStark
Copy link
Contributor

I think the same needs to be done for the vertexai bridge, right?

@OskarStark OskarStark changed the title [Platform] Gemini: do tool call if any contentPart is a functionCall [Platform][Gemini] do tool call if any contentPart is a functionCall Sep 30, 2025
@DrauzJu
Copy link
Contributor Author

DrauzJu commented Sep 30, 2025

I think the same needs to be done for the vertexai bridge, right?

@OskarStark Probably yes, but I never used it so far. I can try it though.

@OskarStark
Copy link
Contributor

The code should look quite similar, can you try adding your fix there too? Thanks

@DrauzJu DrauzJu requested a review from OskarStark September 30, 2025 22:35
@DrauzJu DrauzJu force-pushed the gemini-result-converter branch from 1b58da5 to e124679 Compare September 30, 2025 22:37
@OskarStark OskarStark changed the title [Platform][Gemini] do tool call if any contentPart is a functionCall [Platform][Gemini] Do tool call if any contentPart is a functionCall Oct 2, 2025
@OskarStark OskarStark force-pushed the gemini-result-converter branch from e124679 to c3c36ab Compare October 2, 2025 11:44
@OskarStark
Copy link
Contributor

Thanks for fixing this bug Julian.

@OskarStark OskarStark merged commit 64eef5e into symfony:main Oct 2, 2025
14 checks passed
@DrauzJu DrauzJu deleted the gemini-result-converter branch October 2, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants