Skip to content

Conversation

@AstraBert
Copy link
Member

Adding ToolCallBlock support in GoogleGenAI integration (e2e tested)

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 16, 2025
"id": part.function_call.id if part.function_call.id else "",
"name": part.function_call.name,
"args": part.function_call.args,
"thought_signature": part.thought_signature,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we might be losing thought signatures here? Although not totally sure either

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we might be, but ToolCallBlock does not have something that could properly handle the signature and I did not want to open it to additional_kwargs chaos... Although I can do that if we think it is necessary

@logan-markewich
Copy link
Collaborator

I'm still seeing some weird behaviour

  1. In the chat history, empty blocks are added
ChatMessage(role=<MessageRole.ASSISTANT: 'assistant'>, additional_kwargs={'thought_signatures': []}, blocks=[ToolCallBlock(block_type='tool_call', tool_call_id='', tool_name='get_the_greeting', tool_kwargs={}), TextBlock(block_type='text', text=''), ThinkingBlock(block_type='thinking', content='', num_tokens=None, additional_information={})])
  1. Setting a breakpoint in def _astream_chat() just before calling gemini, in an agent loop, I see multiple duplicated tool calls somehow, not sure why 🤔

Copy link
Collaborator

@logan-markewich logan-markewich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me now, thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 3, 2025
@logan-markewich logan-markewich merged commit 82f32ca into main Nov 3, 2025
11 checks passed
@logan-markewich logan-markewich deleted the clelia/google-genai-tool-block branch November 3, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants