UPDATE url cache 1
This commit is contained in:
parent
602569b4fa
commit
50c9e10b74
1 changed files with 14 additions and 15 deletions
|
|
@ -37,15 +37,13 @@ const useSocket = (
|
||||||
let embeddingModelProvider = localStorage.getItem(
|
let embeddingModelProvider = localStorage.getItem(
|
||||||
'embeddingModelProvider',
|
'embeddingModelProvider',
|
||||||
);
|
);
|
||||||
|
const modelUrl = new URL(`${process.env.NEXT_PUBLIC_API_URL}/models`);
|
||||||
const providers = await fetch(
|
//modelUrl.searchParams.append('cache', '1');
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/models`,
|
const providers = await fetch(modelUrl, {
|
||||||
{
|
headers: {
|
||||||
headers: {
|
'Content-Type': 'application/json',
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
).then(async (res) => await res.json());
|
}).then(async (res) => await res.json());
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!chatModel ||
|
!chatModel ||
|
||||||
|
|
@ -214,15 +212,16 @@ const loadMessages = async (
|
||||||
setFocusMode: (mode: string) => void,
|
setFocusMode: (mode: string) => void,
|
||||||
setNotFound: (notFound: boolean) => void,
|
setNotFound: (notFound: boolean) => void,
|
||||||
) => {
|
) => {
|
||||||
const res = await fetch(
|
const chatsIdUrl = new URL(
|
||||||
`${process.env.NEXT_PUBLIC_API_URL}/chats/${chatId}`,
|
`${process.env.NEXT_PUBLIC_API_URL}/chats/${chatId}`,
|
||||||
{
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
chatsIdUrl.searchParams.append('cache', '1');
|
||||||
|
const res = await fetch(chatsIdUrl, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if (res.status === 404) {
|
if (res.status === 404) {
|
||||||
setNotFound(true);
|
setNotFound(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue