Skip to content

Commit

Permalink
Merge pull request #14 from jakobhoeg/fix-pull-models
Browse files Browse the repository at this point in the history
fix: set cache-control to "no-cache" to fix dropdown menu issue
  • Loading branch information
jakobhoeg authored Feb 28, 2024
2 parents f31ba89 + ef99d83 commit 274d184
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/api/tags/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
11 changes: 8 additions & 3 deletions src/components/chat/chat-topbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 274d184

Please sign in to comment.