From a52a67176e8c37228fb81c952ab2df61a1f5fce5 Mon Sep 17 00:00:00 2001 From: RedwindA Date: Fri, 6 Jun 2025 01:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay/channel/gemini/dto.go | 5 ----- relay/channel/gemini/relay-gemini.go | 10 ---------- 2 files changed, 15 deletions(-) diff --git a/relay/channel/gemini/dto.go b/relay/channel/gemini/dto.go index 65d6fc65..b1dffe90 100644 --- a/relay/channel/gemini/dto.go +++ b/relay/channel/gemini/dto.go @@ -27,11 +27,6 @@ type FunctionCall struct { Arguments any `json:"args"` } -// type GeminiFunctionResponseContent struct { -// Name string `json:"name"` -// Content any `json:"content"` -// } - type FunctionResponse struct { Name string `json:"name"` Response map[string]interface{} `json:"response"` diff --git a/relay/channel/gemini/relay-gemini.go b/relay/channel/gemini/relay-gemini.go index e37e9762..0a4a900e 100644 --- a/relay/channel/gemini/relay-gemini.go +++ b/relay/channel/gemini/relay-gemini.go @@ -178,16 +178,6 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon Name: name, Response: contentMap, } - // If StrToMap returns nil because message.StringContent() is not a valid JSON object string, - // and Gemini strictly requires an object (e.g., {}), this might need adjustment. - // For example: - // if contentMap == nil && message.StringContent() != "" { - // // Option 1: Send an empty object if that's preferred over null - // // functionResp.Response = make(map[string]interface{}) - // // Option 2: Wrap the plain string if that's ever the case and needs to be an object - // // functionResp.Response = map[string]interface{}{"text_content": message.StringContent()} - // } - // For now, directly assigning contentMap is the most straightforward fix for the reported issue. *parts = append(*parts, GeminiPart{ FunctionResponse: functionResp,