MCPcopy
hub / github.com/AstrBotDevs/AstrBot / update_knowledge_base

Function update_knowledge_base

astrbot/dashboard/api/knowledge_bases.py:137–147  ·  view source on GitHub ↗
(
    kb_id: str,
    payload: KnowledgeBaseRequest,
    _auth: AuthContext = Depends(require_kb_scope),
    service: KnowledgeBaseService = Depends(get_service),
)

Source from the content-addressed store, hash-verified

135
136@router.put("/knowledge-bases/{kb_id}")
137async def update_knowledge_base(
138 kb_id: str,
139 payload: KnowledgeBaseRequest,
140 _auth: AuthContext = Depends(require_kb_scope),
141 service: KnowledgeBaseService = Depends(get_service),
142):
143 body = _model_dict(payload)
144 return await _run(
145 lambda: service.update_kb({"kb_id": kb_id, **body}),
146 prefix="更新知识库失败",
147 )
148
149
150@router.delete("/knowledge-bases/{kb_id}")

Callers

nothing calls this directly

Calls 3

_model_dictFunction · 0.70
_runFunction · 0.70
update_kbMethod · 0.45

Tested by

no test coverage detected