-
Notifications
You must be signed in to change notification settings - Fork 902
feat(ai-proxy): add models & image generation support for gemini #2380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Xijun Dai <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2380 +/- ##
===========================================
+ Coverage 35.91% 46.06% +10.15%
===========================================
Files 69 81 +12
Lines 11576 13010 +1434
===========================================
+ Hits 4157 5993 +1836
+ Misses 7104 6671 -433
- Partials 315 346 +31 🚀 New features to boost your workflow:
|
|
|
||
| const ( | ||
| geminiApiKeyHeader = "x-goog-api-key" | ||
| geminiApiVersion = "v1beta" // 可选: v1 ,v1beta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个需要支持用户配置吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我是想支持下的, 没想好是不是要单开一个配置项,还是用一个通用的
gemini的部分能力不支持v1版本接口
Signed-off-by: Xijun Dai <[email protected]>
Signed-off-by: Xijun Dai <[email protected]>
| } | ||
| } | ||
| shouldAddDummyModelMessage := false | ||
| // shouldAddDummyModelMessage := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个变量要是不用了的话就删掉吧
| c.apiVersion = json.Get("claudeVersion").String() | ||
| if c.apiVersion == "" { | ||
| // 增加获取 version 字段,用于适配其他模型的配置,并保持与结构体中定义的 tag 一致 | ||
| c.apiVersion = json.Get("version").String() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这个配置项在 JSON 里还是叫 apiVersion 比较好?另外,对应的 README 需要更新一下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
结构体里面的 json tag 原先就是叫 version, 我只是做了兼容
如果要修改为 apiVersion 不确定会不会影响到已有用户的配置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我想了下,虽然 tag 中为 version, 文档中并没有说明可以通过 version 来指定版本。
所以这里应该是可以修改为 apiVersion
Signed-off-by: Xijun Dai <[email protected]>
CH3CHO
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…baba#2380) Signed-off-by: Xijun Dai <[email protected]> Co-authored-by: Kent Dong <[email protected]>
Ⅰ. Describe what this PR did
新增功能:
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
docker-compose.yml
envoy.yml
非流式对话
流式对话
使用 Gemini 模型生成图片
使用 Imagen 3 模型生成图片
列出模型清单
Ⅴ. Special notes for reviews