Examples by task¶
Each guide starts from an application outcome and introduces the required A11 interfaces. Choose a streaming API, model service, agent, browser, or operations example below.
Build streaming APIs and pipelines¶
- Return values as they are produced. Write, read, finalize, and fail an asynchronous stream.
- Serve an action over WebSocket. Connect a client and server, send a call, and shut both sides down cleanly.
- Host the same operation locally or remotely. Move inference or data processing to another peer without changing its schema or port I/O.
- Compose available actions at runtime. Check and run a concurrent composition without deploying another handler.
- Stream progress and a finished image separately. Keep lightweight status records independent from a binary model result.
- Represent an HTTP exchange as streams. Process status, headers, body, trailers, and pushed responses as they arrive.
Add models and tools¶
- Stream a model response. Send a portable conversation to Claude, Gemini, or Ollama through one action interface.
- Let a model call an application action. Turn an action schema into a tool and run requested calls through its registry.
- Use tools published by an MCP server. Convert MCP declarations into actions that models, flows, and remote peers can call.
- Build a parallel research agent in Python. Plan, investigate several briefs concurrently, and stream the final report.
- Let a model compose its tools. Keep intermediate tool results out of model context by running their composition as one action.
- Build a harness or evaluation path. Assemble only the session, storage, policy, and result streams an application needs.
Build browser experiences¶
- Call an A11 service from a browser. Use the same action contract in a Python backend and a TypeScript page.
- Continue a chat after a reload. Store structured interactions and reopen a conversation by ID.
- Let a model use tools in the page. Serve actions over the page's existing connection so the model can operate on browser state.
- Run a model in the browser. Stream WebGPU inference through the same ports as a hosted model.
Distribute and operate¶
- Export runtime telemetry with OpenTelemetry. Configure OTLP or Langfuse and inspect action, session, and stream spans.
- Exchange durable streams through Redis. Let two programs communicate without a direct connection.
- Choose and verify the native allocator. Enable the packaged allocator for native executables or embedding processes.
- Integrate Flow diagnostics into an editor or CI. Read stable diagnostic, formatting, completion, and navigation responses.
Runnable companion programs are available in the repository's
examples/ directory.