This commit is contained in:
Timothy Jaeryang Baek
2025-11-25 05:07:53 -05:00
parent 63ca0a3519
commit 6235243b62
2 changed files with 16 additions and 53 deletions
-36
View File
@@ -295,42 +295,6 @@ export interface SearchDocument {
filenames: string[];
}
export const processFile = async (
token: string,
file_id: string,
collection_name: string | null = null
) => {
let error = null;
const res = await fetch(`${RETRIEVAL_API_BASE_URL}/process/file`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
},
body: JSON.stringify({
file_id: file_id,
collection_name: collection_name ? collection_name : undefined
})
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const processYoutubeVideo = async (token: string, url: string) => {
let error = null;