✨ feat: Simplify response handling by returning raw response body directly
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user