()
| 893 | } |
| 894 | |
| 895 | async function getGeminiClient(): Promise<GeminiClient> { |
| 896 | const apiKey = getConfig(CONFIG_KEYS.GEMINI_API_KEY); |
| 897 | if (!apiKey) { |
| 898 | throw new Error("未设置 Gemini API 密钥。请使用 gemini apikey <密钥> 命令设置。"); |
| 899 | } |
| 900 | |
| 901 | const baseUrl = getConfig(CONFIG_KEYS.GEMINI_BASE_URL) || null; |
| 902 | return new GeminiClient(apiKey, baseUrl); |
| 903 | } |
| 904 | |
| 905 | async function callGeminiChat( |
| 906 | prompt: string, |
no test coverage detected