mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-05-04 01:54:37 +00:00
fix: remove unnecessary unescapeMapOrSlice call in Gemini relay
The JSON serialization/deserialization already handles escape characters correctly, so the unescapeMapOrSlice function is redundant.
This commit is contained in:
@@ -988,11 +988,9 @@ func unescapeMapOrSlice(data interface{}) interface{} {
|
|||||||
func getResponseToolCall(item *dto.GeminiPart) *dto.ToolCallResponse {
|
func getResponseToolCall(item *dto.GeminiPart) *dto.ToolCallResponse {
|
||||||
var argsBytes []byte
|
var argsBytes []byte
|
||||||
var err error
|
var err error
|
||||||
if result, ok := item.FunctionCall.Arguments.(map[string]interface{}); ok {
|
// 移除 unescapeMapOrSlice 调用,直接使用 json.Marshal
|
||||||
argsBytes, err = json.Marshal(unescapeMapOrSlice(result))
|
// JSON 序列化/反序列化已经正确处理了转义字符
|
||||||
} else {
|
argsBytes, err = json.Marshal(item.FunctionCall.Arguments)
|
||||||
argsBytes, err = json.Marshal(item.FunctionCall.Arguments)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user