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

Function _run

astrbot/dashboard/api/knowledge_bases.py:64–75  ·  view source on GitHub ↗
(operation, *, prefix: str)

Source from the content-addressed store, hash-verified

62
63
64async def _run(operation, *, prefix: str):
65 try:
66 result = await run_maybe_async(operation)
67 if isinstance(result, tuple):
68 data, message = result
69 return ok(data, message)
70 return ok(result)
71 except (KnowledgeBaseServiceError, ValueError) as exc:
72 return error(str(exc))
73 except Exception as exc:
74 logger.error("%s: %s", prefix, exc, exc_info=True)
75 return error(f"{prefix}: {exc!s}")
76
77
78async def _run_json(

Callers 15

_run_jsonFunction · 0.70
list_knowledge_basesFunction · 0.70
create_knowledge_baseFunction · 0.70
get_knowledge_base_taskFunction · 0.70
get_knowledge_baseFunction · 0.70
update_knowledge_baseFunction · 0.70
delete_knowledge_baseFunction · 0.70
get_knowledge_base_statsFunction · 0.70

Calls 4

run_maybe_asyncFunction · 0.90
okFunction · 0.90
errorFunction · 0.90
errorMethod · 0.45

Tested by

no test coverage detected