Skip to content

HttpTransport

🛈 DocStrings

Configuration for the Streamable HTTP & WebSocket server transport (experimental).

Serves ACP on one endpoint per the transport RFD: Streamable HTTP (POST/GET/DELETE) and WebSocket upgrade. Each client connection gets its own agent instance. Requires the bridge extra (starlette, uvicorn).

Attributes:

Name Type Description
host str

Host to bind to.

port int

Port to listen on.

path str

Endpoint path.

authenticate Authenticate | None

Identifies callers (None rejects with 401); connections belong to their creator. None accepts every caller, for local use only.

allow_origins list[str]

CORS origins for browser clients.

max_buffered_bytes int

Output a connection may hold for its client before the agent's writes wait.

max_output_stall float

Seconds a client may take no output while over that limit before its connection is closed.

Source code in src/aclientp/transports.py
@dataclass
class HttpTransport:
    """Configuration for the Streamable HTTP & WebSocket server transport (experimental).

    Serves ACP on one endpoint per the transport RFD: Streamable HTTP (POST/GET/DELETE)
    and WebSocket upgrade. Each client connection gets its own agent instance. Requires
    the ``bridge`` extra (starlette, uvicorn).

    Attributes:
        host: Host to bind to.
        port: Port to listen on.
        path: Endpoint path.
        authenticate: Identifies callers (None rejects with 401); connections belong to
            their creator. None accepts every caller, for local use only.
        allow_origins: CORS origins for browser clients.
        max_buffered_bytes: Output a connection may hold for its client before the agent's
            writes wait.
        max_output_stall: Seconds a client may take no output while over that limit
            before its connection is closed.
    """

    host: str = "localhost"
    port: int = 8765
    path: str = "/acp"
    authenticate: Authenticate | None = None
    allow_origins: list[str] = field(default_factory=list)
    max_buffered_bytes: int = 64 * 1024 * 1024
    max_output_stall: float = 60.0

:fa-brands-github: Show source on GitHub