Skip to content

fix(gemini): gemini tool_call part position#715

Merged
N3kox merged 1 commit intomainfrom
fix/gemini_tc_pos
Mar 6, 2026
Merged

fix(gemini): gemini tool_call part position#715
N3kox merged 1 commit intomainfrom
fix/gemini_tc_pos

Conversation

@N3kox
Copy link
Copy Markdown
Contributor

@N3kox N3kox commented Mar 6, 2026

What type of PR is this?

fix

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

fix(gemini): assistant message 通过 convSchemaMessage 还原为 candidate parts 时,tool call part 所在位置问题

(Optional) More detailed description for this PR(en: English/zh: Chinese).

  • en: This PR fixes the order of tool call parts in the convSchemaMessage function. Previously, tool call parts were added at the beginning of the content parts list, which could cause issues with Gemini API expectations. Now tool call parts are properly placed after media parts (when using AssistantGenMultiContent ) or after text parts (when using Content ). This ensures compatibility with Gemini's expected message format.

  • zh(optional): 此 PR 修复了 convSchemaMessage 函数中 tool call 部分的顺序问题。之前,tool call 部分被添加到 content parts 列表的开头,这可能导致与 Gemini API 期望不兼容的问题。现在,tool call 部分被正确地放置在 media 部分之后(当使用 AssistantGenMultiContent 时)或 text 部分之后(当使用 Content 时)。这确保了与 Gemini 期望的消息格式的兼容性。

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 6, 2026

Need to create a new tag

The following modules have changes and may need version updates:

  • components/model/gemini (Current: components/model/gemini/v0.1.28)

⚠️ Please create and push new version tags for these modules after merging this PR.

@N3kox N3kox merged commit 008f822 into main Mar 6, 2026
8 checks passed
@N3kox N3kox deleted the fix/gemini_tc_pos branch March 6, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants