From 3a01f3ae0ae44b6d8ee061123d7dff652581e6eb Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sat, 17 Jan 2026 03:14:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20OpenAI=20=E5=92=8C?= =?UTF-8?q?=20Google=20=E7=BD=91=E5=85=B3=E6=94=AF=E6=8C=81=EF=BC=8C?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 OpenAI 网关支持并配置 GPT-5.2 及 GPT-5.2-Codex 模型,同时新增 Google 网关以支持 Gemini 3 Pro 高性能模型。 - 删除旧的代码片段提供者配置文件中定义的CLI代理API和Z.AI模型配置。 --- opencode.jsonc | 32 ++++++++++++++++++++--- snippet/provider.jsonc | 58 ------------------------------------------ 2 files changed, 29 insertions(+), 61 deletions(-) delete mode 100644 snippet/provider.jsonc diff --git a/opencode.jsonc b/opencode.jsonc index e1fac40..f207057 100644 --- a/opencode.jsonc +++ b/opencode.jsonc @@ -26,8 +26,8 @@ "websearch": "deny" // 禁用内置的 websearch 工具 }, "provider": { - "gateway": { - "name": "Gateway", + "anthropic-gateway": { + "name": "Anthropic Gateway", "npm": "@ai-sdk/anthropic", "options": { "baseURL": "http://10.0.1.1:8317/v1", @@ -45,7 +45,17 @@ }, "claude-haiku-4-5": { "name": "Claude Haiku 4.5" - }, + } + } + }, + "google-gateway": { + "name": "Google Gateway", + "npm": "@ai-sdk/google", + "options": { + "baseURL": "http://10.0.1.1:8317/v1", + "apiKey": "{env:CPA_API_KEY}" + }, + "models": { "gemini-3-pro-high": { "name": "Gemini 3 Pro (High)" }, @@ -63,6 +73,22 @@ } } }, + "openai-gateway": { + "name": "OpenAI Gateway", + "npm": "@ai-sdk/openai", + "options": { + "baseURL": "http://10.0.1.1:8317/v1", + "apiKey": "{env:CPA_API_KEY}" + }, + "models": { + "gpt-5.2": { + "name": "GPT-5.2" + }, + "gpt-5.2-codex": { + "name": "GPT-5.2-Codex" + } + } + }, "GLM Coding": { "name": "Z.AI", "npm": "@ai-sdk/openai-compatible", diff --git a/snippet/provider.jsonc b/snippet/provider.jsonc deleted file mode 100644 index 3b58be3..0000000 --- a/snippet/provider.jsonc +++ /dev/null @@ -1,58 +0,0 @@ -{ - "$schema": "https://opencode.ai/config.json", - "provider": { - "cli-proxy-api": { - "name": "CLI Proxy API", - "npm": "@ai-sdk/anthropic", - "options": { - // "baseURL": "https://cpa.services.sh.cn:8443/v1", - "baseURL": "http://10.0.1.1:8317/v1", - "apiKey": "{env:CPA_API_KEY}" - }, - "models": { - // Claude - "claude-opus-4-5-thinking": { - "name": "Claude Opus 4.5 (Thinking)" - }, - "claude-sonnet-4-5-thinking": { - "name": "Claude Sonnet 4.5 (Thinking)" - }, - "claude-sonnet-4-5": { - "name": "Claude Sonnet 4.5" - }, - "claude-haiku-4-5": { - "name": "Claude Haiku 4.5" - }, - - // Gemini - "gemini-3-pro-preview": { - "name": "Gemini 3 Pro" - }, - "gemini-3-flash-preview": { - "name": "Gemini 3 Flash" - }, - - // GPT - "gpt-5.2": { - "name": "GPT-5.2" - }, - "gpt-5.2-codex": { - "name": "GPT-5.2-Codex" - } - } - }, - "GLM Coding": { - "name": "Z.AI", - "npm": "@ai-sdk/openai-compatible", - "options": { - "baseURL": "https://api.z.ai/api/coding/paas/v4", - "apiKey": "{env:ZAI_API_KEY}" - }, - "models": { - "glm-4.7": { - "name": "GLM-4.7" - } - } - } - } -}