Skip to content

Commit 99e6694

Browse files
committed
feat: add gemini 1.5 flash support
1 parent d2c6c4c commit 99e6694

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ Gemini-OpenAI-Proxy offers a straightforward way to integrate OpenAI functionali
9999

100100
Model Mapping:
101101

102-
- gpt-3.5-turbo -> gemini-1.0-pro-latest
103-
- gpt-4 -> gemini-1.0-ultra-latest
104-
- gpt-4-turbo-preview -> gemini-1.5-pro-latest
105-
- gpt-4-vision-preview -> gemini-1.0-pro-vision-latest
102+
| GPT 模型 | Gemini 模型 |
103+
|---|---|
104+
| gpt-3.5-turbo | gemini-1.0-pro-latest |
105+
| gpt-4 | gemini-1.5-flash-latest |
106+
| gpt-4-turbo-preview | gemini-1.5-pro-latest |
107+
| gpt-4-vision-preview | gemini-1.0-pro-vision-latest |
106108

107109
If you wish to map `gpt-4-vision-preview` to `gemini-1.5-pro-latest`, you can configure the environment variable `GPT_4_VISION_PREVIEW = gemini-1.5-pro-latest`. This is because `gemini-1.5-pro-latest` now also supports multi-modal data.
108110

pkg/adapter/chat.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
const (
2020
Gemini1Pro = "gemini-1.0-pro-latest"
2121
Gemini1Dot5Pro = "gemini-1.5-pro-latest"
22+
Gemini1Dot5Flash = "gemini-1.5-flash-latest"
2223
Gemini1ProVision = "gemini-1.0-pro-vision-latest"
2324
Gemini1Ultra = "gemini-1.0-ultra-latest"
2425

pkg/adapter/struct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (req *ChatCompletionRequest) ToGenaiModel() string {
5454
case req.Model == openai.GPT4TurboPreview || req.Model == openai.GPT4Turbo1106 || req.Model == openai.GPT4Turbo0125:
5555
return Gemini1Dot5Pro
5656
case strings.HasPrefix(req.Model, openai.GPT4):
57-
return Gemini1Ultra
57+
return Gemini1Dot5Flash
5858
default:
5959
return Gemini1Pro
6060
}

0 commit comments

Comments
 (0)