feat: 重构知识库系统,移除Hermes集成,增强RAG和同步功能
主要变更: - 移除Hermes智能体及相关回调服务 - 新增知识库RAG、同步、调度、规范化和索引任务服务 - 重构orchestrator服务,增强运行时聊天功能 - 更新前端聊天、政策制度、设置等页面样式和逻辑 - 更新expense_claims和document_intelligence服务 - 删除llm_wiki相关服务和测试文件 - 更新docker-compose配置和启动脚本
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from app.api.deps import get_db
|
||||
from app.api.v1.endpoints.settings import require_hermes_agent_token
|
||||
from app.schemas.common import ErrorResponse
|
||||
from app.schemas.hermes import HermesCallbackRead, HermesCallbackWrite
|
||||
from app.services.hermes_callbacks import HermesCallbackService
|
||||
|
||||
router = APIRouter(prefix="/hermes")
|
||||
DbSession = Annotated[Session, Depends(get_db)]
|
||||
|
||||
|
||||
@router.post(
|
||||
"/callback",
|
||||
response_model=HermesCallbackRead,
|
||||
dependencies=[Depends(require_hermes_agent_token)],
|
||||
summary="接收 Hermes 通用回调",
|
||||
description="所有 Hermes 任务统一通过该入口回传进度或完成结果,服务端依据 type 分发到对应业务处理器。",
|
||||
responses={
|
||||
status.HTTP_400_BAD_REQUEST: {
|
||||
"model": ErrorResponse,
|
||||
"description": "Hermes 回调载荷不合法或任务类型暂不支持。",
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {
|
||||
"model": ErrorResponse,
|
||||
"description": "回调引用的 AgentRun 不存在。",
|
||||
},
|
||||
},
|
||||
)
|
||||
def handle_hermes_callback(
|
||||
payload: HermesCallbackWrite,
|
||||
db: DbSession,
|
||||
) -> HermesCallbackRead:
|
||||
try:
|
||||
return HermesCallbackService(db).handle_callback(payload)
|
||||
except LookupError as exc:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(exc)) from exc
|
||||
except ValueError as exc:
|
||||
raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail=str(exc)) from exc
|
||||
File diff suppressed because it is too large
Load Diff
@@ -98,7 +98,7 @@ def test_model_connectivity(
|
||||
response_model=RuntimeModelConfigRead,
|
||||
dependencies=[Depends(require_hermes_agent_token)],
|
||||
summary="读取 Hermes 运行时模型配置",
|
||||
description="供 Hermes 进程读取主模型、备用模型、VLM 或 Embedding 模型的运行时配置。",
|
||||
description="供 Hermes 进程读取主模型、备用模型、Embedding 或 Reranker 模型的运行时配置。",
|
||||
responses={
|
||||
status.HTTP_401_UNAUTHORIZED: {
|
||||
"model": ErrorResponse,
|
||||
|
||||
Reference in New Issue
Block a user