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
342bf59c
authored
Aug 07, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整Disable Ping标志的设置位置
parent
15c11bfe
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
relay/channel/gemini/adaptor.go
+3
-1
No files found.
relay/channel/gemini/adaptor.go
View file @
342bf59c
...
@@ -120,6 +120,9 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
...
@@ -120,6 +120,9 @@ func (a *Adaptor) GetRequestURL(info *relaycommon.RelayInfo) (string, error) {
action
:=
"generateContent"
action
:=
"generateContent"
if
info
.
IsStream
{
if
info
.
IsStream
{
action
=
"streamGenerateContent?alt=sse"
action
=
"streamGenerateContent?alt=sse"
if
info
.
RelayMode
==
constant
.
RelayModeGemini
{
info
.
DisablePing
=
true
}
}
}
return
fmt
.
Sprintf
(
"%s/%s/models/%s:%s"
,
info
.
BaseUrl
,
version
,
info
.
UpstreamModelName
,
action
),
nil
return
fmt
.
Sprintf
(
"%s/%s/models/%s:%s"
,
info
.
BaseUrl
,
version
,
info
.
UpstreamModelName
,
action
),
nil
}
}
...
@@ -193,7 +196,6 @@ func (a *Adaptor) DoRequest(c *gin.Context, info *relaycommon.RelayInfo, request
...
@@ -193,7 +196,6 @@ func (a *Adaptor) DoRequest(c *gin.Context, info *relaycommon.RelayInfo, request
func
(
a
*
Adaptor
)
DoResponse
(
c
*
gin
.
Context
,
resp
*
http
.
Response
,
info
*
relaycommon
.
RelayInfo
)
(
usage
any
,
err
*
types
.
NewAPIError
)
{
func
(
a
*
Adaptor
)
DoResponse
(
c
*
gin
.
Context
,
resp
*
http
.
Response
,
info
*
relaycommon
.
RelayInfo
)
(
usage
any
,
err
*
types
.
NewAPIError
)
{
if
info
.
RelayMode
==
constant
.
RelayModeGemini
{
if
info
.
RelayMode
==
constant
.
RelayModeGemini
{
if
info
.
IsStream
{
if
info
.
IsStream
{
info
.
DisablePing
=
true
return
GeminiTextGenerationStreamHandler
(
c
,
info
,
resp
)
return
GeminiTextGenerationStreamHandler
(
c
,
info
,
resp
)
}
else
{
}
else
{
return
GeminiTextGenerationHandler
(
c
,
info
,
resp
)
return
GeminiTextGenerationHandler
(
c
,
info
,
resp
)
...
...
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