From ab7ee17145105b7b9501abcc36cbe42aba998331 Mon Sep 17 00:00:00 2001 From: Akhileshrangani4 Date: Mon, 14 Oct 2024 17:11:54 -0400 Subject: [PATCH] fix: update fetch url with env and model to sonnet --- backend/ai/src/index.ts | 2 +- frontend/components/editor/AIChat.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/ai/src/index.ts b/backend/ai/src/index.ts index e773814..af564f0 100644 --- a/backend/ai/src/index.ts +++ b/backend/ai/src/index.ts @@ -47,7 +47,7 @@ Provide a clear and concise explanation along with any code snippets. Keep your const anthropic = new Anthropic({ apiKey: env.ANTHROPIC_API_KEY }); const stream = await anthropic.messages.create({ - model: "claude-3-opus-20240229", + model: "claude-3-5-sonnet-20240620", max_tokens: 1024, messages: [{ role: "user", content: prompt }], stream: true, diff --git a/frontend/components/editor/AIChat.tsx b/frontend/components/editor/AIChat.tsx index a3073ec..d37cc53 100644 --- a/frontend/components/editor/AIChat.tsx +++ b/frontend/components/editor/AIChat.tsx @@ -60,7 +60,7 @@ export default function AIChat() { instructions: input, ...(context && { context }) }); - const response = await fetch(`http://127.0.0.1:8787/api?${queryParams}`, { + const response = await fetch(`${process.env.NEXT_PUBLIC_AI_WORKER_URL}/api?${queryParams}`, { method: 'GET', signal: abortControllerRef.current.signal, });