From 20c043f584c6309175785ba58764207ad3aa9db0 Mon Sep 17 00:00:00 2001 From: Seefs Date: Wed, 19 Mar 2025 22:48:49 +0800 Subject: [PATCH] fix: claude function calling type --- relay/channel/claude/relay-claude.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/relay/channel/claude/relay-claude.go b/relay/channel/claude/relay-claude.go index 41b16c66..5aaed5f8 100644 --- a/relay/channel/claude/relay-claude.go +++ b/relay/channel/claude/relay-claude.go @@ -70,7 +70,9 @@ func RequestOpenAI2ClaudeMessage(textRequest dto.GeneralOpenAIRequest) (*dto.Cla Description: tool.Function.Description, } claudeTool.InputSchema = make(map[string]interface{}) - claudeTool.InputSchema["type"] = params["type"].(string) + if params["type"] != nil { + claudeTool.InputSchema["type"] = params["type"].(string) + } claudeTool.InputSchema["properties"] = params["properties"] claudeTool.InputSchema["required"] = params["required"] for s, a := range params {