Skip to content

Add Part::ToolCall and Part::ToolResponse for server-side tool invocations - #72

Merged
flachesis merged 1 commit into
flachesis:mainfrom
1qh:server-side-tool-invocation-parts
Jun 28, 2026
Merged

Add Part::ToolCall and Part::ToolResponse for server-side tool invocations#72
flachesis merged 1 commit into
flachesis:mainfrom
1qh:server-side-tool-invocation-parts

Conversation

@1qh

@1qh 1qh commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Problem

generateContent/streamGenerateContent responses that use server-side tool invocation — built-in tools (google_search, url_context) combined with function tools via toolConfig.includeServerSideToolInvocations = true — return toolCall and toolResponse content parts. The Part enum has no variants for these, so any such response fails to deserialize.

Change

Adds Part::ToolCall and Part::ToolResponse so responses mixing built-in and function tools decode cleanly. No behavior change for existing parts.

Test

Verified against live streamGenerateContent responses that combine google_search with a function tool.

…de tool invocations

streamGenerateContent/generateContent responses that use serverside tool
invocation (e.g. google_search or url_context combined with function tools
via includeServerSideToolInvocations) carry `toolCall`/`toolResponse`
content parts. The Part enum lacks variants for these, so such responses
fail to deserialize. Adds the two variants so the union (built-in + function
tools in one request) decodes.
@flachesis
flachesis merged commit 6a9eb3e into flachesis:main Jun 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants