diff --git a/desktop/src/components/Params.tsx b/desktop/src/components/Params.tsx index e002469c..1cffdd54 100644 --- a/desktop/src/components/Params.tsx +++ b/desktop/src/components/Params.tsx @@ -116,12 +116,17 @@ export default function ModelOptions({ options, setOptions }: ParamsProps) { } async function checkLlm() { - const promise = llm!.ask('Hello, how are you?') - hotToast.promise(promise, { - error: t('common.check-error') as string, - success: t('common.check-success') as string, - loading: t('common.check-loading') as string, - }) + try { + const promise = llm!.ask('Hello, how are you?') + hotToast.promise(promise, { + error: t('common.check-error') as string, + success: t('common.check-success') as string, + loading: t('common.check-loading') as string, + }) + await promise + } catch (e) { + console.error(e) + } } return ( diff --git a/desktop/src/lib/llm/claude.ts b/desktop/src/lib/llm/claude.ts index 8c5b3b45..b8508166 100644 --- a/desktop/src/lib/llm/claude.ts +++ b/desktop/src/lib/llm/claude.ts @@ -27,6 +27,8 @@ export class Claude implements Llm { messages: [{ role: 'user', content: prompt }], }) const headers = { + Origin: '', + Referer: '', 'X-API-Key': this.config.claudeApiKey, 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json',