Skip to content

Commit

Permalink
fix(claude): unset origin and referer
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Nov 19, 2024
1 parent 454e3dd commit cd05a7e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 11 additions & 6 deletions desktop/src/components/Params.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 2 additions & 0 deletions desktop/src/lib/llm/claude.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit cd05a7e

Please sign in to comment.