浏览代码

✨ feat: Simplify response handling by returning raw response body directly

CaIon 6 月之前
父节点
当前提交
e74c6f5de7
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 1 7
      relay/channel/gemini/relay-gemini-native.go

+ 1 - 7
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
 	return &usage, nil
 }
 }