Skip to content

Commit 453e744

Browse files
committed
Fixed: #642
fix: remove unsupported fields `type` and `cache_control` across translators
1 parent 6534396 commit 453e744

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

internal/translator/antigravity/claude/antigravity_claude_request.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ func ConvertClaudeRequestToAntigravity(modelName string, inputRawJSON []byte, _
211211
tool, _ = sjson.SetRaw(tool, "parametersJsonSchema", inputSchema)
212212
tool, _ = sjson.Delete(tool, "strict")
213213
tool, _ = sjson.Delete(tool, "input_examples")
214+
tool, _ = sjson.Delete(tool, "type")
215+
tool, _ = sjson.Delete(tool, "cache_control")
214216
toolsJSON, _ = sjson.SetRaw(toolsJSON, "0.functionDeclarations.-1", tool)
215217
toolDeclCount++
216218
}

internal/translator/gemini-cli/claude/gemini-cli_claude_request.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ func ConvertClaudeRequestToCLI(modelName string, inputRawJSON []byte, _ bool) []
134134
tool, _ = sjson.SetRaw(tool, "parametersJsonSchema", inputSchema)
135135
tool, _ = sjson.Delete(tool, "strict")
136136
tool, _ = sjson.Delete(tool, "input_examples")
137+
tool, _ = sjson.Delete(tool, "type")
138+
tool, _ = sjson.Delete(tool, "cache_control")
137139
var toolDeclaration any
138140
if err := json.Unmarshal([]byte(tool), &toolDeclaration); err == nil {
139141
tools[0].FunctionDeclarations = append(tools[0].FunctionDeclarations, toolDeclaration)

internal/translator/gemini/claude/gemini_claude_request.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ func ConvertClaudeRequestToGemini(modelName string, inputRawJSON []byte, _ bool)
127127
tool, _ = sjson.SetRaw(tool, "parametersJsonSchema", inputSchema)
128128
tool, _ = sjson.Delete(tool, "strict")
129129
tool, _ = sjson.Delete(tool, "input_examples")
130+
tool, _ = sjson.Delete(tool, "type")
131+
tool, _ = sjson.Delete(tool, "cache_control")
130132
var toolDeclaration any
131133
if err := json.Unmarshal([]byte(tool), &toolDeclaration); err == nil {
132134
tools[0].FunctionDeclarations = append(tools[0].FunctionDeclarations, toolDeclaration)

0 commit comments

Comments
 (0)