feat: Agent 工作区初始提交(源码+文档+Skills)
包含 CodeAgent 前后端源码、SKILLS、MCP、demo 代码与工作区文档。 排除依赖缓存、运行数据、备份与二进制附件,规则见 .gitignore。 Co-Authored-By: Claude Code <[email protected]>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
知识库自动更新 API
|
||||
==================
|
||||
|
||||
【功能说明】手动触发知识库自动更新、查看更新状态。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.schemas.project import ApiResponse
|
||||
from app.services.knowledge_autoupdate import check_and_update
|
||||
|
||||
logger = logging.getLogger("agent.knowledge_autoupdate.api")
|
||||
|
||||
router = APIRouter(prefix="/api/knowledge", tags=["知识库管理"])
|
||||
|
||||
|
||||
@router.post("/auto-update", response_model=ApiResponse[dict], summary="自动更新知识库")
|
||||
def auto_update() -> ApiResponse[dict]:
|
||||
"""检查素材目录变更并自动更新知识库(增量/全量)。"""
|
||||
result = check_and_update()
|
||||
code = 0 if "失败" not in result.get("message", "") else 1
|
||||
return ApiResponse(code=code, message=result.get("message", "完成"), data=result)
|
||||
Reference in New Issue
Block a user