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

Function _run_file

astrbot/dashboard/api/files.py:43–50  ·  view source on GitHub ↗
(operation, *, error_message: str = "File access error")

Source from the content-addressed store, hash-verified

41
42
43async def _run_file(operation, *, error_message: str = "File access error"):
44 try:
45 result = await run_maybe_async(operation)
46 return result
47 except ChatServiceError as exc:
48 return error(str(exc))
49 except (FileNotFoundError, OSError):
50 return error(error_message)
51
52
53async def _upload_file(file: UploadFile, service: ChatService):

Callers 3

_upload_fileFunction · 0.85
get_file_by_nameFunction · 0.85
get_fileFunction · 0.85

Calls 2

run_maybe_asyncFunction · 0.90
errorFunction · 0.90

Tested by

no test coverage detected