Skip to main content

RemoteMediaResolver

Defined in the protocols module.
AI Agent Resolves a sandbox-local media path to a gateway-local deliverable path. When an agent runs in a remote/serverless sandbox (Modal, E2B, Daytona, Fly.io, SSH host, remote Docker, …) and emits a MEDIA:<path> directive, the referenced file lives on the sandbox filesystem, not the gateway host. The outbound media path only delivers local files, so such a directive would otherwise be silently dropped. A resolver bridges that gap: the active sandbox backend (which already exposes a download_file/read_file primitive) satisfies this protocol so the wrapper’s outbound media path can pull the artifact down into a local delivery cache and then deliver it, without the wrapper importing any concrete heavy sandbox SDK.

Methods

owns_path()

Return True if path refers to a file inside this sandbox.

fetch_to_local()

Fetch remote_path out of the sandbox to a local path.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 2730