From e74c6f5de7d1b224d25683ce72e3560bcbb69aa3 Mon Sep 17 00:00:00 2001 From: CaIon Date: Mon, 11 Aug 2025 20:07:24 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20Simplify=20response=20handl?= =?UTF-8?q?ing=20by=20returning=20raw=20response=20body=20directly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- relay/channel/gemini/relay-gemini-native.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/relay/channel/gemini/relay-gemini-native.go b/relay/channel/gemini/relay-gemini-native.go index 247b41fd..7f2f51fb 100644 --- a/relay/channel/gemini/relay-gemini-native.go +++ b/relay/channel/gemini/relay-gemini-native.go @@ -53,13 +53,7 @@ func GeminiTextGenerationHandler(c *gin.Context, info *relaycommon.RelayInfo, re } } - // 直接返回 Gemini 原生格式的 JSON 响应 - jsonResponse, err := common.Marshal(geminiResponse) - if err != nil { - return nil, types.NewOpenAIError(err, types.ErrorCodeBadResponseBody, http.StatusInternalServerError) - } - - common.IOCopyBytesGracefully(c, resp, jsonResponse) + common.IOCopyBytesGracefully(c, resp, responseBody) return &usage, nil }