feat: claude function call

This commit is contained in:
Hk-Gosuto
2024-08-11 14:40:57 +00:00
parent 8583b536cf
commit 0a643dc71d
3 changed files with 13 additions and 5 deletions

View File

@@ -227,7 +227,7 @@ export class ClientApi {
}
}
export function getHeaders(ignoreHeaders?: boolean, isFunctionCall?: boolean) {
export function getHeaders(ignoreHeaders?: boolean) {
const accessStore = useAccessStore.getState();
const chatStore = useChatStore.getState();
let headers: Record<string, string> = {};
@@ -285,7 +285,6 @@ export function getHeaders(ignoreHeaders?: boolean, isFunctionCall?: boolean) {
}
function getAuthHeader(): string {
if (isFunctionCall) return "Authorization";
return isAzure ? "api-key" : isAnthropic ? "x-api-key" : "Authorization";
}

View File

@@ -146,7 +146,7 @@ export class ClaudeApi implements LLMApi {
method: "POST",
body: JSON.stringify(requestPayload),
signal: controller.signal,
headers: getHeaders(false, true),
headers: getHeaders(),
};
// make a fetch request