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
800c3f2b
authored
Nov 23, 2025
by
Calcium-Ion
Committed by
GitHub
Nov 23, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2274 from seefs001/feature/thinking_level
feat: gemini thinking_level && snake params
parents
89709dfa
5901f8cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletions
+32
-1
dto/gemini.go
+32
-1
No files found.
dto/gemini.go
View file @
800c3f2b
...
...
@@ -142,7 +142,38 @@ type GeminiThinkingConfig struct {
IncludeThoughts
bool
`json:"includeThoughts,omitempty"`
ThinkingBudget
*
int
`json:"thinkingBudget,omitempty"`
// TODO Conflict with thinkingbudget.
// ThinkingLevel json.RawMessage `json:"thinkingLevel,omitempty"`
ThinkingLevel
json
.
RawMessage
`json:"thinkingLevel,omitempty"`
}
// UnmarshalJSON allows GeminiThinkingConfig to accept both snake_case and camelCase fields.
func
(
c
*
GeminiThinkingConfig
)
UnmarshalJSON
(
data
[]
byte
)
error
{
type
Alias
GeminiThinkingConfig
var
aux
struct
{
Alias
IncludeThoughtsSnake
*
bool
`json:"include_thoughts,omitempty"`
ThinkingBudgetSnake
*
int
`json:"thinking_budget,omitempty"`
ThinkingLevelSnake
json
.
RawMessage
`json:"thinking_level,omitempty"`
}
if
err
:=
common
.
Unmarshal
(
data
,
&
aux
);
err
!=
nil
{
return
err
}
*
c
=
GeminiThinkingConfig
(
aux
.
Alias
)
if
aux
.
IncludeThoughtsSnake
!=
nil
{
c
.
IncludeThoughts
=
*
aux
.
IncludeThoughtsSnake
}
if
aux
.
ThinkingBudgetSnake
!=
nil
{
c
.
ThinkingBudget
=
aux
.
ThinkingBudgetSnake
}
if
len
(
aux
.
ThinkingLevelSnake
)
>
0
{
c
.
ThinkingLevel
=
aux
.
ThinkingLevelSnake
}
return
nil
}
func
(
c
*
GeminiThinkingConfig
)
SetThinkingBudget
(
budget
int
)
{
...
...
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