feat: enable API proxy

This commit is contained in:
Li Xin
2025-04-17 16:39:27 +08:00
parent aaf843aafa
commit 86b05dac35
3 changed files with 75 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ export function chatStream(
return chatStreamMock(userMessage, params, options);
}
return fetchStream<ChatEvent>(
(env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000/api") + "/chat/stream",
(env.NEXT_PUBLIC_API_URL ?? "/api") + "/chat/stream",
{
body: JSON.stringify({
messages: [{ role: "user", content: userMessage }],