fix(ai-review model validation): 驗證 model 並支援自動選模

This commit is contained in:
2026-08-07 08:48:50 +00:00
parent 5e9bd86bbc
commit dcd80750ba
7 changed files with 55 additions and 10 deletions
+2 -1
View File
@@ -209,8 +209,9 @@ async function runProxyAPI({ provider, baseURL, apiKeys, model }, prompt) {
*/
export async function chat(systemPrompt, userContent) {
const cfg = getLLMConfig();
const { provider, baseURL, model } = cfg;
const { provider, baseURL, model, modelError } = cfg;
if (!provider || !baseURL) throw new Error('未偵測到可用的 CLIProxyAPI 設定,請確認 CLI_PROXY_API');
if (modelError) throw new Error(modelError);
line(`[LLM] provider=${provider} baseURL=${baseURL} model=${model || 'auto'}`);