Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
32978f9c
authored
Aug 11, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: Simplify response handling by returning raw response body directly
parent
ce74e94f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
7 deletions
+1
-7
relay/channel/gemini/relay-gemini-native.go
+1
-7
No files found.
relay/channel/gemini/relay-gemini-native.go
View file @
32978f9c
...
@@ -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
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment