feat: 重构知识库系统,移除Hermes集成,增强RAG和同步功能

主要变更:
- 移除Hermes智能体及相关回调服务
- 新增知识库RAG、同步、调度、规范化和索引任务服务
- 重构orchestrator服务,增强运行时聊天功能
- 更新前端聊天、政策制度、设置等页面样式和逻辑
- 更新expense_claims和document_intelligence服务
- 删除llm_wiki相关服务和测试文件
- 更新docker-compose配置和启动脚本
This commit is contained in:
caoxiaozhu
2026-05-17 08:38:41 +00:00
parent 212c935308
commit 68f663f2f4
308 changed files with 83729 additions and 13588 deletions

View File

@@ -226,9 +226,11 @@ export async function apiRequest(path, options = {}) {
contentType = 'application/json',
responseType = 'json',
headers: customHeaders,
...fetchOptions
} = options
timeoutMs = 0,
timeoutMessage = '',
...fetchOptions
} = options
const headers = sanitizeHeaders({
...readCurrentUserHeaders(),
...(customHeaders || {})
@@ -237,23 +239,44 @@ export async function apiRequest(path, options = {}) {
if (contentType !== null && typeof headers['Content-Type'] === 'undefined') {
headers['Content-Type'] = contentType
}
let response
let response
let timeoutId = 0
let requestOptions = {
...fetchOptions,
headers
}
if (!fetchOptions.signal && Number(timeoutMs) > 0 && typeof AbortController !== 'undefined') {
const controller = new AbortController()
timeoutId = globalThis.setTimeout(() => controller.abort(), Number(timeoutMs))
requestOptions = {
...requestOptions,
signal: controller.signal
}
}
try {
response = await fetch(buildUrl(path), {
...fetchOptions,
headers
})
response = await fetch(buildUrl(path), requestOptions)
} catch (error) {
if (timeoutId) {
globalThis.clearTimeout(timeoutId)
}
if (error?.name === 'AbortError') {
throw new Error(String(timeoutMessage || '').trim() || '接口请求超时,请稍后重试。')
}
if (String(error?.message || '').includes('ByteString')) {
throw new Error('当前登录用户信息包含浏览器不支持的请求头字符,请重新登录后重试。')
}
throw new Error('无法连接 FastAPI 后端服务,请确认后端已启动且浏览器可访问后端端口。')
}
if (responseType === 'blob') {
if (timeoutId) {
globalThis.clearTimeout(timeoutId)
}
if (responseType === 'blob') {
if (!response.ok) {
let payload = null