diff --git a/web/src/core/api/chat.ts b/web/src/core/api/chat.ts index 4a79689..c39100b 100644 --- a/web/src/core/api/chat.ts +++ b/web/src/core/api/chat.ts @@ -22,7 +22,7 @@ export function chatStream( return chatStreamMock(userMessage, params, options); } return fetchStream( - (env.NEXT_PUBLIC_API_URL ?? "/api") + "/chat/stream", + (env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000/api") + "/chat/stream", { body: JSON.stringify({ messages: [{ role: "user", content: userMessage }], @@ -56,7 +56,7 @@ async function* chatStreamMock( const res = await fetch(mockFile, { signal: options.abortSignal, }); - await sleep(800); + await sleep(500); const text = await res.text(); const chunks = text.split("\n\n"); for (const chunk of chunks) { @@ -66,7 +66,7 @@ async function* chatStreamMock( if (event === "message_chunk") { await sleep(100); } else if (event === "tool_call_result") { - await sleep(4000); + await sleep(2000); } try { yield { diff --git a/web/src/core/api/podcast.ts b/web/src/core/api/podcast.ts index ee4d56d..c323576 100644 --- a/web/src/core/api/podcast.ts +++ b/web/src/core/api/podcast.ts @@ -1,14 +1,20 @@ // Copyright (c) 2025 Bytedance Ltd. and/or its affiliates // SPDX-License-Identifier: MIT +import { env } from "~/env"; + export async function generatePodcast(content: string) { - const response = await fetch("/api/podcast/generate", { - method: "post", - headers: { - "Content-Type": "application/json", + const response = await fetch( + (env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000/api") + + "/podcast/generate", + { + method: "post", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ content }), }, - body: JSON.stringify({ content }), - }); + ); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); }