主要变更: - 移除Hermes智能体及相关回调服务 - 新增知识库RAG、同步、调度、规范化和索引任务服务 - 重构orchestrator服务,增强运行时聊天功能 - 更新前端聊天、政策制度、设置等页面样式和逻辑 - 更新expense_claims和document_intelligence服务 - 删除llm_wiki相关服务和测试文件 - 更新docker-compose配置和启动脚本
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
import { apiRequest } from './api.js'
|
|
|
|
export function fetchKnowledgeLibrary() {
|
|
return apiRequest('/knowledge/library')
|
|
}
|
|
|
|
export function fetchKnowledgeDocument(documentId) {
|
|
return apiRequest(`/knowledge/documents/${documentId}`)
|
|
}
|
|
|
|
export function fetchKnowledgeOnlyOfficeConfig(documentId) {
|
|
return apiRequest(`/knowledge/documents/${documentId}/onlyoffice-config`)
|
|
}
|
|
|
|
export function uploadKnowledgeDocument({ folder, file }) {
|
|
return apiRequest(
|
|
`/knowledge/documents?folder=${encodeURIComponent(folder)}&filename=${encodeURIComponent(file.name)}`,
|
|
{
|
|
method: 'POST',
|
|
body: file,
|
|
contentType: file.type || 'application/octet-stream'
|
|
}
|
|
)
|
|
}
|
|
|
|
export function deleteKnowledgeDocument(documentId) {
|
|
return apiRequest(`/knowledge/documents/${documentId}`, {
|
|
method: 'DELETE'
|
|
})
|
|
}
|
|
|
|
export function syncKnowledgeLibrary({ folder, documentIds = [], force = false }) {
|
|
return apiRequest('/knowledge/sync', {
|
|
method: 'POST',
|
|
body: JSON.stringify({
|
|
folder,
|
|
document_ids: Array.isArray(documentIds) ? documentIds : [],
|
|
force
|
|
})
|
|
})
|
|
}
|
|
|
|
export function fetchKnowledgeDocumentBlob(documentId, disposition = 'inline') {
|
|
return apiRequest(`/knowledge/documents/${documentId}/content?disposition=${disposition}`, {
|
|
responseType: 'blob',
|
|
contentType: null
|
|
})
|
|
}
|