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
1968cff5
authored
Aug 01, 2025
by
creamlike1024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove debug log
parent
689dbfe7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
10 deletions
+0
-10
relay/channel/openai/helper.go
+0
-10
No files found.
relay/channel/openai/helper.go
View file @
1968cff5
...
...
@@ -47,25 +47,16 @@ func handleClaudeFormat(c *gin.Context, data string, info *relaycommon.RelayInfo
}
func
handleGeminiFormat
(
c
*
gin
.
Context
,
data
string
,
info
*
relaycommon
.
RelayInfo
)
error
{
// 截取前50个字符用于调试
debugData
:=
data
if
len
(
data
)
>
50
{
debugData
=
data
[
:
50
]
+
"..."
}
common
.
LogInfo
(
c
,
"handleGeminiFormat called with data: "
+
debugData
)
var
streamResponse
dto
.
ChatCompletionsStreamResponse
if
err
:=
common
.
Unmarshal
(
common
.
StringToByteSlice
(
data
),
&
streamResponse
);
err
!=
nil
{
common
.
LogError
(
c
,
"failed to unmarshal stream response: "
+
err
.
Error
())
return
err
}
common
.
LogInfo
(
c
,
"successfully unmarshaled stream response"
)
geminiResponse
:=
service
.
StreamResponseOpenAI2Gemini
(
&
streamResponse
,
info
)
// 如果返回 nil,表示没有实际内容,跳过发送
if
geminiResponse
==
nil
{
common
.
LogInfo
(
c
,
"handleGeminiFormat: no content to send, skipping"
)
return
nil
}
...
...
@@ -75,7 +66,6 @@ func handleGeminiFormat(c *gin.Context, data string, info *relaycommon.RelayInfo
return
err
}
common
.
LogInfo
(
c
,
"sending gemini format response"
)
// send gemini format response
c
.
Render
(
-
1
,
common
.
CustomEvent
{
Data
:
"data: "
+
string
(
geminiResponseStr
)})
if
flusher
,
ok
:=
c
.
Writer
.
(
http
.
Flusher
);
ok
{
...
...
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