Commit 32978f9c by CaIon

feat: Simplify response handling by returning raw response body directly

parent ce74e94f
...@@ -53,13 +53,7 @@ func GeminiTextGenerationHandler(c *gin.Context, info *relaycommon.RelayInfo, re ...@@ -53,13 +53,7 @@ func GeminiTextGenerationHandler(c *gin.Context, info *relaycommon.RelayInfo, re
} }
} }
// 直接返回 Gemini 原生格式的 JSON 响应 common.IOCopyBytesGracefully(c, resp, responseBody)
jsonResponse, err := common.Marshal(geminiResponse)
if err != nil {
return nil, types.NewOpenAIError(err, types.ErrorCodeBadResponseBody, http.StatusInternalServerError)
}
common.IOCopyBytesGracefully(c, resp, jsonResponse)
return &usage, nil return &usage, nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment