Creates a new RealtimeAgentAdapter instance
The session can be either connected or unconnected. If unconnected, call connect() with an API key before use.
Configuration for the realtime agent adapter
Process input and generate response (implements AgentAdapter interface)
This is called by Scenario framework for each agent turn. Handles both text and audio input, returns audio message with transcript.
Scenario agent input with message history
Agent response as audio message or text
Get the connect method from the session
Optionalparams: RealtimeSessionConnectOptionsCloses the session connection
Remove audio response listener
The callback function to remove
Subscribe to audio response events
Function called when an audio response completes
Adapter that connects Scenario testing framework to OpenAI Realtime API
This adapter wraps a connected RealtimeSession to provide the Scenario framework interface. The session must be created and connected externally, ensuring the same session creation pattern is used in both browser and tests.
Example