Download frontend/src/api/knowledge.js from shak3008/DocWeave: direct link, hf CLI and curl.
- Browser
- Download file 641 Bytes
-
https://huggingface.co/spaces/shak3008/DocWeave/resolve/main/frontend/src/api/knowledge.js
- Command line
-
hf download hf://spaces/shak3008/DocWeave/frontend/src/api/knowledge.js
-
curl -L -o knowledge.js https://huggingface.co/spaces/shak3008/DocWeave/resolve/main/frontend/src/api/knowledge.js
641 Bytes
| import { apiRequest } from "./client"; | |
| export async function listKnowledge(workspaceId, { status, type } = {}) { | |
| let url = `/knowledge?workspace_id=${encodeURIComponent(workspaceId)}`; | |
| if (status) url += `&status=${encodeURIComponent(status)}`; | |
| if (type) url += `&type=${encodeURIComponent(type)}`; | |
| return apiRequest(url); | |
| } | |
| export async function searchKnowledge(workspaceId, query) { | |
| return apiRequest( | |
| `/knowledge/search?workspace_id=${encodeURIComponent(workspaceId)}&q=${encodeURIComponent(query)}` | |
| ); | |
| } | |
| export async function getKnowledgeItem(itemId) { | |
| return apiRequest(`/knowledge/${itemId}`); | |
| } | |