MCPcopy
hub / github.com/dataelement/Clawith / _read_document_from_storage

Function _read_document_from_storage

backend/app/services/agent_tools.py:5148–5158  ·  view source on GitHub ↗
(
    agent_id: uuid.UUID,
    rel_path: str,
    max_chars: int = 8000,
    tenant_id: str | None = None,
)

Source from the content-addressed store, hash-verified

5146
5147
5148async def _read_document_from_storage(
5149 agent_id: uuid.UUID,
5150 rel_path: str,
5151 max_chars: int = 8000,
5152 tenant_id: str | None = None,
5153) -> str:
5154 temp_workspace = await _prepare_temp_workspace(agent_id, tenant_id=tenant_id, paths=[rel_path])
5155 try:
5156 return await _read_document(temp_workspace.root, rel_path, max_chars=max_chars, tenant_id=None)
5157 finally:
5158 temp_workspace.cleanup()
5159
5160
5161# ─── Format Conversion Tools ────────────────────────────────────

Callers 1

execute_toolFunction · 0.85

Calls 3

_prepare_temp_workspaceFunction · 0.85
_read_documentFunction · 0.85
cleanupMethod · 0.80

Tested by

no test coverage detected