MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / __init__

Method __init__

openspace/communication/attachment_cache.py:16–26  ·  view source on GitHub ↗
(
        self,
        base_dir: Path,
        *,
        max_attachment_bytes: int = 25 * 1024 * 1024,
        max_session_attachment_bytes: int = 100 * 1024 * 1024,
    )

Source from the content-addressed store, hash-verified

14
15class AttachmentCache:
16 def __init__(
17 self,
18 base_dir: Path,
19 *,
20 max_attachment_bytes: int = 25 * 1024 * 1024,
21 max_session_attachment_bytes: int = 100 * 1024 * 1024,
22 ):
23 self.base_dir = base_dir
24 self.max_attachment_bytes = max_attachment_bytes
25 self.max_session_attachment_bytes = max_session_attachment_bytes
26 self.base_dir.mkdir(parents=True, exist_ok=True)
27
28 def session_dir(self, session_key: str) -> Path:
29 directory = self.base_dir / session_key / "attachments"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected