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
9bc9d408
authored
Jun 18, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(gemini): update audio input pricing and adjust model handling logic
parent
49592897
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
relay/channel/gemini/relay-gemini.go
+1
-2
setting/operation_setting/tools.go
+6
-3
No files found.
relay/channel/gemini/relay-gemini.go
View file @
9bc9d408
...
...
@@ -103,7 +103,6 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
isNew25Pro
:=
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-pro"
)
&&
!
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-pro-preview-05-06"
)
&&
!
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-pro-preview-03-25"
)
is25FlashLite
:=
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash-lite"
)
if
strings
.
Contains
(
modelName
,
"-thinking-"
)
{
parts
:=
strings
.
SplitN
(
modelName
,
"-thinking-"
,
2
)
...
...
@@ -142,7 +141,7 @@ func CovertGemini2OpenAI(textRequest dto.GeneralOpenAIRequest, info *relaycommon
}
}
}
else
if
strings
.
HasSuffix
(
modelName
,
"-nothinking"
)
{
if
!
isNew25Pro
&&
!
is25FlashLite
{
if
!
isNew25Pro
{
geminiRequest
.
GenerationConfig
.
ThinkingConfig
=
&
GeminiThinkingConfig
{
ThinkingBudget
:
common
.
GetPointer
(
0
),
}
...
...
setting/operation_setting/tools.go
View file @
9bc9d408
...
...
@@ -17,6 +17,7 @@ const (
const
(
// Gemini Audio Input Price
Gemini25FlashPreviewInputAudioPrice
=
1.00
Gemini25FlashProductionInputAudioPrice
=
1.00
// for `gemini-2.5-flash`
Gemini25FlashNativeAudioInputAudioPrice
=
3.00
Gemini20FlashInputAudioPrice
=
0.70
)
...
...
@@ -64,10 +65,12 @@ func GetFileSearchPricePerThousand() float64 {
}
func
GetGeminiInputAudioPricePerMillionTokens
(
modelName
string
)
float64
{
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash-preview"
)
{
return
Gemini25FlashPreviewInputAudioPrice
}
else
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash-preview-native-audio"
)
{
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash-preview-native-audio"
)
{
return
Gemini25FlashNativeAudioInputAudioPrice
}
else
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash-preview"
)
{
return
Gemini25FlashPreviewInputAudioPrice
}
else
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.5-flash"
)
{
return
Gemini25FlashProductionInputAudioPrice
}
else
if
strings
.
HasPrefix
(
modelName
,
"gemini-2.0-flash"
)
{
return
Gemini20FlashInputAudioPrice
}
...
...
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