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
b3b6ec03
authored
Sep 27, 2025
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: add missing fields to Gemini request
parent
84d00fb7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
dto/gemini.go
+31
-0
No files found.
dto/gemini.go
View file @
b3b6ec03
...
...
@@ -14,7 +14,30 @@ type GeminiChatRequest struct {
SafetySettings
[]
GeminiChatSafetySettings
`json:"safetySettings,omitempty"`
GenerationConfig
GeminiChatGenerationConfig
`json:"generationConfig,omitempty"`
Tools
json
.
RawMessage
`json:"tools,omitempty"`
ToolConfig
*
ToolConfig
`json:"toolConfig,omitempty"`
SystemInstructions
*
GeminiChatContent
`json:"systemInstruction,omitempty"`
CachedContent
string
`json:"cachedContent,omitempty"`
}
type
ToolConfig
struct
{
FunctionCallingConfig
*
FunctionCallingConfig
`json:"functionCallingConfig,omitempty"`
RetrievalConfig
*
RetrievalConfig
`json:"retrievalConfig,omitempty"`
}
type
FunctionCallingConfig
struct
{
Mode
FunctionCallingConfigMode
`json:"mode,omitempty"`
AllowedFunctionNames
[]
string
`json:"allowedFunctionNames,omitempty"`
}
type
FunctionCallingConfigMode
string
type
RetrievalConfig
struct
{
LatLng
*
LatLng
`json:"latLng,omitempty"`
LanguageCode
string
`json:"languageCode,omitempty"`
}
type
LatLng
struct
{
Latitude
*
float64
`json:"latitude,omitempty"`
Longitude
*
float64
`json:"longitude,omitempty"`
}
func
(
r
*
GeminiChatRequest
)
GetTokenCountMeta
()
*
types
.
TokenCountMeta
{
...
...
@@ -239,12 +262,20 @@ type GeminiChatGenerationConfig struct {
StopSequences
[]
string
`json:"stopSequences,omitempty"`
ResponseMimeType
string
`json:"responseMimeType,omitempty"`
ResponseSchema
any
`json:"responseSchema,omitempty"`
ResponseJsonSchema
any
`json:"responseJsonSchema,omitempty"`
PresencePenalty
*
float32
`json:"presencePenalty,omitempty"`
FrequencyPenalty
*
float32
`json:"frequencyPenalty,omitempty"`
ResponseLogprobs
bool
`json:"responseLogprobs,omitempty"`
Logprobs
*
int32
`json:"logprobs,omitempty"`
MediaResolution
MediaResolution
`json:"mediaResolution,omitempty"`
Seed
int64
`json:"seed,omitempty"`
ResponseModalities
[]
string
`json:"responseModalities,omitempty"`
ThinkingConfig
*
GeminiThinkingConfig
`json:"thinkingConfig,omitempty"`
SpeechConfig
json
.
RawMessage
`json:"speechConfig,omitempty"`
// RawMessage to allow flexible speech config
}
type
MediaResolution
string
type
GeminiChatCandidate
struct
{
Content
GeminiChatContent
`json:"content"`
FinishReason
*
string
`json:"finishReason"`
...
...
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