RealtimeAPIClient
Methods
addEventListener
Adds a handler for the specified Inworld.RealtimeAPIEvents or Inworld.Events event.
Parameters
clearMediaBuffer
Clears the Inworld WebSocket media buffer.
Parameters
close
Closes the Inworld connection (over WebSocket) or connection attempt.
conversationItemCreate
Add a conversation item (message, function call result, etc.). https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
conversationItemDelete
Delete a conversation item by ID. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
conversationItemRetrieve
Retrieve a conversation item by ID. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
conversationItemTruncate
Truncate an assistant message’s audio. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
id
Returns the RealtimeAPIClient id.
inputAudioBufferAppend
Append audio bytes to the input buffer. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
inputAudioBufferClear
Discard all audio in the input buffer. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
inputAudioBufferCommit
Commit the buffered audio as a user message. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
outputAudioBufferClear
Clear the server’s output audio buffer, stopping playback. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
removeEventListener
Removes a handler for the specified Inworld.RealtimeAPIEvents or Inworld.Events event.
Parameters
responseCancel
Cancel an in-progress response. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
responseCreate
Trigger a model response. The server streams back response events. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
sendMediaTo
Starts sending media from the Inworld (via WebSocket) to the media unit.
Parameters
sessionUpdate
Update the session configuration. The server responds with a session.updated event. https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket
Parameters
stopMediaTo
Stops sending media from the Inworld (via WebSocket) to the media unit.
Parameters
webSocketId
Returns the Inworld WebSocket id.