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

Function _json_or_empty

astrbot/dashboard/api/knowledge_bases.py:41–46  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

39
40
41async def _json_or_empty(request: Request) -> dict[str, Any]:
42 try:
43 data = await request.json()
44 except Exception:
45 return {}
46 return data if isinstance(data, dict) else {}
47
48
49def _to_int(value: Any, default: int) -> int:

Callers 1

_run_jsonFunction · 0.70

Calls 1

jsonMethod · 0.45

Tested by

no test coverage detected