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
89e5edd4
authored
Dec 26, 2025
by
Calcium-Ion
Committed by
GitHub
Dec 26, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2450 from seefs001/fix/gemini-system-prompt
fix: 支持传入system_instruction和systemInstruction两种风格系统提示词参数名
parents
343497ad
3eee8c7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
dto/gemini.go
+21
-0
No files found.
dto/gemini.go
View file @
89e5edd4
...
@@ -22,6 +22,27 @@ type GeminiChatRequest struct {
...
@@ -22,6 +22,27 @@ type GeminiChatRequest struct {
CachedContent
string
`json:"cachedContent,omitempty"`
CachedContent
string
`json:"cachedContent,omitempty"`
}
}
// UnmarshalJSON allows GeminiChatRequest to accept both snake_case and camelCase fields.
func
(
r
*
GeminiChatRequest
)
UnmarshalJSON
(
data
[]
byte
)
error
{
type
Alias
GeminiChatRequest
var
aux
struct
{
Alias
SystemInstructionSnake
*
GeminiChatContent
`json:"system_instruction,omitempty"`
}
if
err
:=
common
.
Unmarshal
(
data
,
&
aux
);
err
!=
nil
{
return
err
}
*
r
=
GeminiChatRequest
(
aux
.
Alias
)
if
aux
.
SystemInstructionSnake
!=
nil
{
r
.
SystemInstructions
=
aux
.
SystemInstructionSnake
}
return
nil
}
type
ToolConfig
struct
{
type
ToolConfig
struct
{
FunctionCallingConfig
*
FunctionCallingConfig
`json:"functionCallingConfig,omitempty"`
FunctionCallingConfig
*
FunctionCallingConfig
`json:"functionCallingConfig,omitempty"`
RetrievalConfig
*
RetrievalConfig
`json:"retrievalConfig,omitempty"`
RetrievalConfig
*
RetrievalConfig
`json:"retrievalConfig,omitempty"`
...
...
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