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
21f48f2c
authored
Sep 27, 2025
by
Calcium-Ion
Committed by
GitHub
Sep 27, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1884 from seefs001/fix/gemini
fix: add missing fields to Gemini request
parents
f50eb9dd
53513cbe
Hide 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 @
21f48f2c
...
@@ -14,7 +14,30 @@ type GeminiChatRequest struct {
...
@@ -14,7 +14,30 @@ type GeminiChatRequest struct {
SafetySettings
[]
GeminiChatSafetySettings
`json:"safetySettings,omitempty"`
SafetySettings
[]
GeminiChatSafetySettings
`json:"safetySettings,omitempty"`
GenerationConfig
GeminiChatGenerationConfig
`json:"generationConfig,omitempty"`
GenerationConfig
GeminiChatGenerationConfig
`json:"generationConfig,omitempty"`
Tools
json
.
RawMessage
`json:"tools,omitempty"`
Tools
json
.
RawMessage
`json:"tools,omitempty"`
ToolConfig
*
ToolConfig
`json:"toolConfig,omitempty"`
SystemInstructions
*
GeminiChatContent
`json:"systemInstruction,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
{
func
(
r
*
GeminiChatRequest
)
GetTokenCountMeta
()
*
types
.
TokenCountMeta
{
...
@@ -239,12 +262,20 @@ type GeminiChatGenerationConfig struct {
...
@@ -239,12 +262,20 @@ type GeminiChatGenerationConfig struct {
StopSequences
[]
string
`json:"stopSequences,omitempty"`
StopSequences
[]
string
`json:"stopSequences,omitempty"`
ResponseMimeType
string
`json:"responseMimeType,omitempty"`
ResponseMimeType
string
`json:"responseMimeType,omitempty"`
ResponseSchema
any
`json:"responseSchema,omitempty"`
ResponseSchema
any
`json:"responseSchema,omitempty"`
ResponseJsonSchema
json
.
RawMessage
`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"`
Seed
int64
`json:"seed,omitempty"`
ResponseModalities
[]
string
`json:"responseModalities,omitempty"`
ResponseModalities
[]
string
`json:"responseModalities,omitempty"`
ThinkingConfig
*
GeminiThinkingConfig
`json:"thinkingConfig,omitempty"`
ThinkingConfig
*
GeminiThinkingConfig
`json:"thinkingConfig,omitempty"`
SpeechConfig
json
.
RawMessage
`json:"speechConfig,omitempty"`
// RawMessage to allow flexible speech config
SpeechConfig
json
.
RawMessage
`json:"speechConfig,omitempty"`
// RawMessage to allow flexible speech config
}
}
type
MediaResolution
string
type
GeminiChatCandidate
struct
{
type
GeminiChatCandidate
struct
{
Content
GeminiChatContent
`json:"content"`
Content
GeminiChatContent
`json:"content"`
FinishReason
*
string
`json:"finishReason"`
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