feat: add Gemini preset template for LLM settings (#97)

* feat: add Gemini preset template for LLM settings

* docs: add comment explaining Gemini /openai suffix requirement

* feat: update Gemini preset to use latest 3-pro and 3-flash models

* docs: improve comment to reference backend client.py implementation
This commit is contained in:
Zihao Xu
2026-01-24 22:42:46 -08:00
committed by GitHub
parent e286d249c4
commit 0d8a001f8c
3 changed files with 17 additions and 2 deletions

View File

@@ -50,6 +50,16 @@ const presets = computed(() => [
model_name: 'anthropic/claude-3.5-sonnet', model_name: 'anthropic/claude-3.5-sonnet',
fast_model_name: 'google/gemini-3-flash' fast_model_name: 'google/gemini-3-flash'
}, },
{
name: t('llm.presets.gemini'),
// Note: The `/openai` suffix is required to use Google's OpenAI-compatible API.
// Our backend (src/utils/llm/client.py) uses OpenAI-compatible format with
// Bearer token auth and /chat/completions endpoint, so we need this suffix
// to make Google API accept OpenAI-style requests instead of native Gemini format.
base_url: 'https://generativelanguage.googleapis.com/v1beta/openai/',
model_name: 'gemini-3-pro-preview',
fast_model_name: 'gemini-3-flash-preview'
},
{ {
name: t('llm.presets.ollama'), name: t('llm.presets.ollama'),
base_url: 'http://localhost:11434/v1', base_url: 'http://localhost:11434/v1',
@@ -286,6 +296,7 @@ onMounted(() => {
<li><a href="https://platform.deepseek.com/" target="_blank">{{ t('llm.help_links.deepseek') }}</a></li> <li><a href="https://platform.deepseek.com/" target="_blank">{{ t('llm.help_links.deepseek') }}</a></li>
<li><a href="https://openrouter.ai/" target="_blank">{{ t('llm.help_links.openrouter') }}</a></li> <li><a href="https://openrouter.ai/" target="_blank">{{ t('llm.help_links.openrouter') }}</a></li>
<li><a href="https://cloud.siliconflow.cn/" target="_blank">{{ t('llm.help_links.siliconflow') }}</a></li> <li><a href="https://cloud.siliconflow.cn/" target="_blank">{{ t('llm.help_links.siliconflow') }}</a></li>
<li><a href="https://aistudio.google.com/" target="_blank">{{ t('llm.help_links.gemini') }}</a></li>
</ul> </ul>
</div> </div>

View File

@@ -109,13 +109,15 @@
"deepseek": "DeepSeek", "deepseek": "DeepSeek",
"siliconflow": "SiliconFlow", "siliconflow": "SiliconFlow",
"openrouter": "OpenRouter", "openrouter": "OpenRouter",
"gemini": "Gemini",
"ollama": "Ollama (Local)" "ollama": "Ollama (Local)"
}, },
"help_links": { "help_links": {
"qwen": "Aliyun Bailian (Qwen / Recommended)", "qwen": "Aliyun Bailian (Qwen / Recommended)",
"deepseek": "DeepSeek Platform (Fast & Cheap)", "deepseek": "DeepSeek Platform (Fast & Cheap)",
"openrouter": "OpenRouter (All-in-one, Recommended)", "openrouter": "OpenRouter (All-in-one, Recommended)",
"siliconflow": "SiliconFlow (Domestic Aggregation)" "siliconflow": "SiliconFlow (Domestic Aggregation)",
"gemini": "Google AI Studio (Gemini)"
} }
}, },
"game_start": { "game_start": {

View File

@@ -109,13 +109,15 @@
"deepseek": "DeepSeek", "deepseek": "DeepSeek",
"siliconflow": "硅基流动", "siliconflow": "硅基流动",
"openrouter": "OpenRouter", "openrouter": "OpenRouter",
"gemini": "Gemini",
"ollama": "Ollama (本地)" "ollama": "Ollama (本地)"
}, },
"help_links": { "help_links": {
"qwen": "阿里云百炼 (Qwen / 最推荐)", "qwen": "阿里云百炼 (Qwen / 最推荐)",
"deepseek": "DeepSeek 开放平台 (国内推荐,便宜)", "deepseek": "DeepSeek 开放平台 (国内推荐,便宜)",
"openrouter": "OpenRouter (全机型聚合,推荐)", "openrouter": "OpenRouter (全机型聚合,推荐)",
"siliconflow": "硅基流动 (国内聚合)" "siliconflow": "硅基流动 (国内聚合)",
"gemini": "Google AI Studio (Gemini)"
} }
}, },
"game_start": { "game_start": {