clients
autogen.agentchat.realtime.experimental.clients.OpenAIRealtimeClient
OpenAIRealtimeClient
(Experimental) Client for OpenAI Realtime API.
(Experimental) Client for OpenAI Realtime API.
Name | Description |
---|---|
llm_config | Type: dict[str, typing.Any] |
logger | Type: logging.Logger | None Default: None |
Static Methods
get_factory
Create a Realtime API client.
Name | Description |
---|---|
llm_config | Type: dict[str, typing.Any] |
logger | Type: logging.Logger |
**kwargs | Type: Any |
Instance Attributes
connection
Get the OpenAI WebSocket connection.
logger
Get the logger for the OpenAI Realtime API.
Instance Methods
connect
Connect to the OpenAI Realtime API.
read_events
Read messages from the OpenAI Realtime API.
send_audio
Send audio to the OpenAI Realtime API.
Name | Description |
---|---|
audio | The audio to send. Type: str |
send_function_result
Send the result of a function call to the OpenAI Realtime API.
Name | Description |
---|---|
call_id | The ID of the function call. Type: str |
result | The result of the function call. Type: str |
send_text
Send a text message to the OpenAI Realtime API.
Name | Description |
---|---|
role | The role of the message. Type: Literal[‘user’, ‘assistant’, ‘system’] |
text | The text of the message. Type: str |
session_update
Send a session update to the OpenAI Realtime API.
Name | Description |
---|---|
session_options | The session options to update. Type: dict[str, typing.Any] |
truncate_audio
Truncate audio in the OpenAI Realtime API.
Name | Description |
---|---|
audio_end_ms | The end of the audio to truncate. Type: int |
content_index | The index of the content to truncate. Type: int |
item_id | The ID of the item to truncate. Type: str |