mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-17 13:55:50 +00:00
feat: 添加gemini协议适配 (#125)
* feat: 添加gemini协议适配 * Remove unrelated local files from Gemini PR
This commit is contained in:
@@ -474,3 +474,10 @@ describe("formatZodError", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("gemini settings", () => {
|
||||
test("accepts gemini modelType", () => {
|
||||
const result = SettingsSchema().safeParse({ modelType: "gemini" });
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -373,11 +373,11 @@ export const SettingsSchema = lazySchema(() =>
|
||||
.optional()
|
||||
.describe('Tool usage permissions configuration'),
|
||||
modelType: z
|
||||
.enum(['anthropic', 'openai'])
|
||||
.enum(['anthropic', 'openai', 'gemini'])
|
||||
.optional()
|
||||
.describe(
|
||||
'API provider type. "anthropic" uses the Anthropic API (default), "openai" uses the OpenAI Chat Completions API (/v1/chat/completions). ' +
|
||||
'When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL in env.',
|
||||
'API provider type. "anthropic" uses the Anthropic API (default), "openai" uses the OpenAI Chat Completions API (/v1/chat/completions), and "gemini" uses the Gemini Generate Content API. ' +
|
||||
'When set to "openai", configure OPENAI_API_KEY, OPENAI_BASE_URL, and OPENAI_MODEL in env. When set to "gemini", configure GEMINI_API_KEY, optional GEMINI_BASE_URL, and either GEMINI_MODEL or ANTHROPIC_DEFAULT_*_MODEL family env vars.',
|
||||
),
|
||||
model: z
|
||||
.string()
|
||||
@@ -1153,3 +1153,4 @@ export type PluginConfig = {
|
||||
[serverName: string]: UserConfigValues
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user