Skip to content

feat: 添加 Gemini API 预设支持#16

Open
aiaiads wants to merge 1 commit intozpano:mainfrom
aiaiads:main
Open

feat: 添加 Gemini API 预设支持#16
aiaiads wants to merge 1 commit intozpano:mainfrom
aiaiads:main

Conversation

@aiaiads
Copy link

@aiaiads aiaiads commented Feb 7, 2026

为 Sapling 扩展添加 Google Gemini API 预设,让用户无需手动输入长 endpoint 地址,只需点击预设按钮并填入 API Key 即可使用 Gemini。

修改内容

文件 说明
src/core/config.ts API_PRESETS 中添加 Gemini 预设(endpoint + model)
src/entrypoints/options/index.html 在设置页面添加 API 预设快捷按钮(OpenAI / Gemini)
src/entrypoints/options/main.ts 添加预设按钮点击事件处理逻辑
GEMINI.md 更新文档,在 AI Provider 列表中添加 Gemini

新增的 Gemini 预设配置

gemini: {
  name: 'Gemini',
  endpoint: 'https://generativelanguage.googleapis.com/v1beta/openai/chat/completions',
  model: 'gemini-2.5-flash'
}

使用方式

  1. 打开扩展设置页面
  2. 点击 Gemini 预设按钮
  3. 填入 Gemini API Key(从 Google AI Studio 获取)
  4. 点击"测试连接"验证

测试说明

  • 运行 npm run dev 启动开发模式
  • 在设置页面验证预设按钮功能
  • 点击 Gemini 按钮后,endpoint 和 model 应自动填充

- 在 config.ts 中添加 Gemini 预设配置
  - endpoint: generativelanguage.googleapis.com/v1beta/openai/chat/completions
  - model: gemini-2.5-flash
- 在设置页面添加 API 预设快捷按钮(OpenAI / Gemini)
- 点击预设按钮自动填充 endpoint 和 model,用户只需填入 API Key
- 更新 GEMINI.md 文档,在 AI Provider 列表中添加 Gemini

修改文件:
- src/core/config.ts
- src/entrypoints/options/index.html
- src/entrypoints/options/main.ts
- GEMINI.md
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@aiaiads
Copy link
Author

aiaiads commented Feb 7, 2026

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant