diff --git a/src/app/api/tags/route.ts b/src/app/api/tags/route.ts index f5a214f..cc60cf8 100644 --- a/src/app/api/tags/route.ts +++ b/src/app/api/tags/route.ts @@ -2,5 +2,5 @@ export async function GET(req: Request) { const res = await fetch( process.env.OLLAMA_URL + "/api/tags" ); - return new Response(await res.text()); + return new Response(res.body, res); } diff --git a/src/components/chat/chat-topbar.tsx b/src/components/chat/chat-topbar.tsx index ebcabbc..1cbfb11 100644 --- a/src/components/chat/chat-topbar.tsx +++ b/src/components/chat/chat-topbar.tsx @@ -46,9 +46,14 @@ export default function ChatTopbar({ const fetchData = async () => { try { - const res = await fetch( - "/api/tags" - ); + const res = await fetch("/api/tags", { + method: "GET", + headers: { + "Content-Type": "application/json", + "cache-control": "no-cache", + }, + }); + const data = await res.json(); // Extract the "name" field from each model object and store them in the state const modelNames = data.models.map((model: any) => model.name);