run:
Why Function Objects
Passing the function object keeps the host and sandbox API aligned:- Your editor sees kwargs and return types from the local signature.
- The worker validates against the sandbox-installed signature before execution.
- Refactors stay visible to Python tooling instead of hiding in RPC strings.
- Agents, tools, and scorers all use the same call path.
Payload Shape
This call:/health.
Call Shapes
The function signature determines how the client behaves.| Function shape | Client usage | Transport |
|---|---|---|
async def f(...) -> T | await client.remote(f, ...) | Socket.IO unary |
async def f(...) -> AsyncIterator[T] | async for item in client.remote(f, ...) | Socket.IO stream |
async def f(..., inbox: Channel[I]) -> AsyncIterator[T] | send inputs through Channel, receive with async for | Socket.IO bidi |
Unary Example
app.py
Streaming Example
app.py
Bidirectional Example
app.py
Correlation
Attach acall_id when rollout traces need a stable key:
call_id in the request payload. Agentix keeps
errors in-band: unary requests return an RPC response with either a value
or an error, and stream or bidi calls emit an error event.