Spaces:
Sleeping
Sleeping
Download web/src/api/documents.js from Danishathugging/Agently: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/spaces/Danishathugging/Agently/resolve/main/web/src/api/documents.js
- Command line
-
hf download hf://spaces/Danishathugging/Agently/web/src/api/documents.js
-
curl -L -o documents.js https://huggingface.co/spaces/Danishathugging/Agently/resolve/main/web/src/api/documents.js
565 Bytes
| import { get, del, uploadFile } from './client.js' | |
| export async function loadDocumentsFromApi(convId) { | |
| try { | |
| return await get(`/api/documents?conversation_id=${convId}`) | |
| } catch { | |
| return [] | |
| } | |
| } | |
| export async function uploadDocumentToApi(file, convId) { | |
| try { | |
| return await uploadFile('/api/documents/upload', file, { conversation_id: convId }) | |
| } catch { | |
| return null | |
| } | |
| } | |
| export async function deleteDocumentFromApi(docId, convId) { | |
| try { | |
| await del(`/api/documents/${docId}?conversation_id=${convId}`) | |
| } catch { /* ignore */ } | |
| } | |