UPDATE url cache 1

This commit is contained in:
redesyef 2024-09-22 10:35:46 -05:00
parent 602569b4fa
commit 50c9e10b74

View file

@ -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}`,
{ );
chatsIdUrl.searchParams.append('cache', '1');
const res = await fetch(chatsIdUrl, {
method: 'GET', method: 'GET',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, },
}, });
);
if (res.status === 404) { if (res.status === 404) {
setNotFound(true); setNotFound(true);