feat: rag folder scan support

This commit is contained in:
Timothy J. Baek 2024-02-17 21:06:08 -08:00
parent 9f869f6573
commit e07001e5f6
9 changed files with 350 additions and 12 deletions

View file

@ -138,6 +138,32 @@ export const queryCollection = async (
return res;
};
export const scanDocs = async (token: string) => {
let error = null;
const res = await fetch(`${RAG_API_BASE_URL}/scan`, {
method: 'GET',
headers: {
Accept: 'application/json',
authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
return null;
});
if (error) {
throw error;
}
return res;
};
export const resetVectorDB = async (token: string) => {
let error = null;