mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 04:33:42 +08:00
feat: claude function call
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user