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
d1431b0c
authored
Jun 14, 2025
by
Calcium-Ion
Committed by
GitHub
Jun 14, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1226 from RedwindA/fix-gemini/empty-system
馃挰
fix(Gemini): clean up empty system instructions in request
parents
c6226f36
66ffccf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
relay/relay-gemini.go
+14
-0
No files found.
relay/relay-gemini.go
View file @
d1431b0c
...
@@ -136,6 +136,20 @@ func GeminiHelper(c *gin.Context) (openaiErr *dto.OpenAIErrorWithStatusCode) {
...
@@ -136,6 +136,20 @@ func GeminiHelper(c *gin.Context) (openaiErr *dto.OpenAIErrorWithStatusCode) {
adaptor
.
Init
(
relayInfo
)
adaptor
.
Init
(
relayInfo
)
// Clean up empty system instruction
if
req
.
SystemInstructions
!=
nil
{
hasContent
:=
false
for
_
,
part
:=
range
req
.
SystemInstructions
.
Parts
{
if
part
.
Text
!=
""
{
hasContent
=
true
break
}
}
if
!
hasContent
{
req
.
SystemInstructions
=
nil
}
}
requestBody
,
err
:=
json
.
Marshal
(
req
)
requestBody
,
err
:=
json
.
Marshal
(
req
)
if
err
!=
nil
{
if
err
!=
nil
{
return
service
.
OpenAIErrorWrapperLocal
(
err
,
"marshal_text_request_failed"
,
http
.
StatusInternalServerError
)
return
service
.
OpenAIErrorWrapperLocal
(
err
,
"marshal_text_request_failed"
,
http
.
StatusInternalServerError
)
...
...
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