feat: 添加gemini协议适配 (#125)

* feat: 添加gemini协议适配

* Remove unrelated local files from Gemini PR
This commit is contained in:
SaltedFish555
2026-04-06 09:55:20 +08:00
committed by GitHub
parent 27825293bb
commit 0da5ec09e8
24 changed files with 2257 additions and 38 deletions

View File

@@ -2249,10 +2249,13 @@ export function normalizeMessagesForAPI(
}
}
// When tool search is NOT enabled, explicitly construct tool_use
// block with only standard API fields to avoid sending fields like
// 'caller' that may be stored in sessions from tool search runs
// When tool search is NOT enabled, strip tool-search-only fields
// like 'caller', but preserve other provider metadata attached to
// the block (for example Gemini thought signatures on tool_use).
const { caller: _caller, ...toolUseRest } = block as ToolUseBlock &
Record<string, unknown> & { caller?: unknown }
return {
...toolUseRest,
type: 'tool_use' as const,
id: toolUseBlk.id,
name: canonicalName,