From 9a5a3d4ce4e6b1c7210fc1b9d9e78231d4e2b3a8 Mon Sep 17 00:00:00 2001 From: DDMeaqua Date: Sat, 14 Sep 2024 16:06:18 +0800 Subject: [PATCH 1/3] fix: #5429 Anthropic authentication_error CORS --- app/api/anthropic.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/anthropic.ts b/app/api/anthropic.ts index 3d49f4c88c4..88f217a90f3 100644 --- a/app/api/anthropic.ts +++ b/app/api/anthropic.ts @@ -98,6 +98,7 @@ async function request(req: NextRequest) { headers: { "Content-Type": "application/json", "Cache-Control": "no-store", + "anthropic-dangerous-direct-browser-access": true, [authHeaderName]: authValue, "anthropic-version": req.headers.get("anthropic-version") || From 8ac9141a29b049a851c51ea3c65f08d18cfd8ce6 Mon Sep 17 00:00:00 2001 From: Meaqua Date: Sun, 15 Sep 2024 14:21:27 +0800 Subject: [PATCH 2/3] fix: ts error --- app/api/anthropic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/anthropic.ts b/app/api/anthropic.ts index 88f217a90f3..d7b070247b7 100644 --- a/app/api/anthropic.ts +++ b/app/api/anthropic.ts @@ -98,7 +98,7 @@ async function request(req: NextRequest) { headers: { "Content-Type": "application/json", "Cache-Control": "no-store", - "anthropic-dangerous-direct-browser-access": true, + "anthropic-dangerous-direct-browser-access": "true", [authHeaderName]: authValue, "anthropic-version": req.headers.get("anthropic-version") || From e986088becfeee53a21d136e8ac6ab484909f2fc Mon Sep 17 00:00:00 2001 From: DDDDD12138 Date: Sun, 15 Sep 2024 21:59:21 +0800 Subject: [PATCH 3/3] chore: correct typo --- app/components/chat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 17f8d3a3496..3cc02d48672 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -520,8 +520,8 @@ export function ChatActions(props: { // if current model is not available // switch to first available model - const isUnavaliableModel = !models.some((m) => m.name === currentModel); - if (isUnavaliableModel && models.length > 0) { + const isUnavailableModel = !models.some((m) => m.name === currentModel); + if (isUnavailableModel && models.length > 0) { // show next model to default model if exist let nextModel = models.find((model) => model.isDefault) || models[0]; chatStore.updateCurrentSession((session) => {