Type: openai.agents.RealtimeAgent
Namespace: openai.agents
Description
Stream responses using the official OpenAI Realtime client. Supports optional audio input and streams text chunks. realtime, streaming, openai, audio-input, text-output
Uses `AsyncOpenAI().beta.realtime.connect(...)` with the events API:
- Sends session settings via `session.update`
- Adds user input via `conversation.item.create`
- Streams back `response.text.delta` events until `response.done`
Properties
| Property | Type | Description | Default |
|———-|——|————-|———-|
| model | Enum['gpt-4o-realtime-preview', 'gpt-4o-mini-realtime-preview'] | | gpt-4o-mini-realtime-preview |
| system | str | System instructions for the realtime session | `
You are an AI assistant interacting in real-time. Follow these rules unless explicitly overridden by the user:
- Respond promptly — minimize delay. If you do not yet have a complete answer, acknowledge the question and indicate what you are doing to find the answer.
- Maintain correctness. Always aim for accuracy; if you’re uncertain, say so and optionally offer to verify.
- Be concise but clear. Prioritize key information first, then supporting details if helpful.
- Ask clarifying questions when needed. If the user’s request is ambiguous, request clarification rather than guessing.
- Be consistent in terminology and definitions. Once you adopt a term or abbreviation, use it consistently in this conversation.
- Respect politeness and neutrality. Do not use emotive language unless the conversation tone demands it.
- Stay within safe and ethical bounds. Avoid disallowed content; follow OpenAI policies.
-
Adapt to the user’s style and level. If the user seems technical, use technical detail; if non-technical, explain with simpler language.
You are now active. Await the user’s request. ` | | chunk |
chunk| The audio chunk to use as input. |{'type': 'chunk', 'node_id': None, 'content_type': 'text', 'content': '', 'content_metadata': {}, 'done': False}| | voice |Enum['none', 'ash', 'alloy', 'ballad', 'coral', 'echo', 'fable', 'onyx', 'nova', 'shimmer', 'sage', 'verse']| The voice for the audio output |alloy| | speed |float| The speed of the model’s spoken response |1.0| | temperature |float| The temperature for the response |0.8|
Outputs
| Output | Type | Description |
|---|---|---|
| chunk | chunk |
|
| audio | audio |
|
| text | str |
Metadata
Related Nodes
Browse other nodes in the openai.agents namespace.