Skip to main content
The pipeline isn’t limited to voice. You can feed it text and have it reply with text or speech, and you can exchange real-time messages with client apps over the room’s pub/sub channel. Together these power chat widgets, omnichannel agents, and command channels (a “capture frame” button, a menu choice) alongside the voice conversation.

Send text in

Push text into the pipeline with process_text(): the LLM treats it as if the user said it. Pair it with a text-capable pipeline (llm only, or llm + tts).
For a pure text chatbot (text in, text out), use an llm-only pipeline and read replies from the llm event:

Room pub/sub messaging

Pub/sub lets the agent and your clients exchange messages on named topics in the room: push data to clients, receive commands, or run a side text channel next to the voice call.

Publish a message

Publish through the session. This works well inside a function_tool, so the LLM itself can send messages:

Subscribe to a topic

Register a callback for a topic, typically from on_enter, once the session is live:
A common pattern wires a client message to agent behavior: for example, the client publishes "capture_frames" and the agent responds by capturing vision frames, or forwards inbound chat text to process_text().

Common topics

What’s Next

Transformation

Rewrite the text stream before it’s spoken

Vision

Trigger frame captures from a client message.

References

Examples

Pub/Sub Messaging

Exchange text messages over pub/sub.