From 293b151dd30a1e0b75c7d907a50d8d012f8270b6 Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Mon, 13 Oct 2025 02:38:48 +0800 Subject: [PATCH 1/4] feat(chat): upgrade Claude Sonnet to 4.5 --- app/api/chat/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 9bce391..c0ed74d 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -101,7 +101,7 @@ export async function POST(req: Request) { ); } - const model = anthropic("claude-sonnet-4-20250514"); + const model = anthropic("claude-sonnet-4-5"); const posthogClient = await createPostHogClient(); try { From 008e0c7453c8d113c4ab1f9472587c7505f54e54 Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Mon, 13 Oct 2025 02:39:11 +0800 Subject: [PATCH 2/4] feat(chat): cache getQuestionSchema --- app/api/chat/route.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index c0ed74d..3685673 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -220,6 +220,11 @@ export async function POST(req: Request) { : null, }; }, + providerOptions: { + anthropic: { + cacheControl: { type: 'ephemeral' }, + }, + }, }), webSearch: anthropic.tools.webSearch_20250305({ maxUses: 5, From f8a3bba0f3a4359c4148a92dd2c7980390dae656 Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Mon, 13 Oct 2025 02:39:23 +0800 Subject: [PATCH 3/4] style: reformat codebase --- app/api/chat/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 3685673..2f87d42 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -222,7 +222,7 @@ export async function POST(req: Request) { }, providerOptions: { anthropic: { - cacheControl: { type: 'ephemeral' }, + cacheControl: { type: "ephemeral" }, }, }, }), From 75464460f177121e39e4f56599592d08ce09111c Mon Sep 17 00:00:00 2001 From: Yi-Jyun Pan Date: Mon, 13 Oct 2025 02:40:35 +0800 Subject: [PATCH 4/4] refactor(chat): remove web search that is never used --- app/api/chat/route.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/api/chat/route.ts b/app/api/chat/route.ts index 2f87d42..9eccdbd 100644 --- a/app/api/chat/route.ts +++ b/app/api/chat/route.ts @@ -226,9 +226,6 @@ export async function POST(req: Request) { }, }, }), - webSearch: anthropic.tools.webSearch_20250305({ - maxUses: 5, - }), }, });