| 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}`); | |
| } | |