events

Event models and data structures for Inworld Realtime API communication.

Based on Inworld’s Realtime API documentation: https://docs.inworld.ai/api-reference/realtimeAPI/realtime/realtime-websocket

class pipecat.services.inworld.realtime.events.AudioFormat(*, type: str)[source]

Bases: BaseModel

Base class for audio format configuration.

type: str
class pipecat.services.inworld.realtime.events.PCMAudioFormat(*, type: Literal['audio/pcm'] = 'audio/pcm', rate: Literal[8000, 16000, 24000, 32000, 44100, 48000] = 24000)[source]

Bases: AudioFormat

PCM audio format configuration with configurable sample rate.

Parameters:
  • type – Audio format type, always “audio/pcm”.

  • rate – Sample rate in Hz. Defaults to 24000.

type: Literal['audio/pcm']
rate: Literal[8000, 16000, 24000, 32000, 44100, 48000]
class pipecat.services.inworld.realtime.events.PCMUAudioFormat(*, type: Literal['audio/pcmu'] = 'audio/pcmu')[source]

Bases: AudioFormat

PCMU (G.711 mu-law) audio format configuration.

Fixed at 8000 Hz sample rate.

Parameters:

type – Audio format type, always “audio/pcmu”.

type: Literal['audio/pcmu']
class pipecat.services.inworld.realtime.events.PCMAAudioFormat(*, type: Literal['audio/pcma'] = 'audio/pcma')[source]

Bases: AudioFormat

PCMA (G.711 A-law) audio format configuration.

Fixed at 8000 Hz sample rate.

Parameters:

type – Audio format type, always “audio/pcma”.

type: Literal['audio/pcma']
class pipecat.services.inworld.realtime.events.TurnDetection(*, type: Literal['server_vad', 'semantic_vad'] | None = 'semantic_vad', eagerness: str | None = None, create_response: bool | None = None, interrupt_response: bool | None = None)[source]

Bases: BaseModel

Server-side voice activity detection configuration.

Parameters:
  • type – Detection type. “server_vad” for standard VAD, “semantic_vad” for semantic-based detection.

  • eagerness – How eagerly to detect end of turn. Options: “low”, “medium”, “high”.

  • create_response – Whether to automatically create a response on turn end.

  • interrupt_response – Whether user speech interrupts the current response.

type: Literal['server_vad', 'semantic_vad'] | None
eagerness: str | None
create_response: bool | None
interrupt_response: bool | None
class pipecat.services.inworld.realtime.events.InputTranscription(*, model: str | None = None)[source]

Bases: BaseModel

Configuration for input audio transcription.

Parameters:

model – The STT model to use for transcription.

model: str | None
class pipecat.services.inworld.realtime.events.AudioInput(*, format: PCMAudioFormat | PCMUAudioFormat | PCMAAudioFormat | None = None, transcription: InputTranscription | None = None, turn_detection: TurnDetection | None = None)[source]

Bases: BaseModel

Audio input configuration.

Parameters:
  • format – The format configuration for input audio.

  • transcription – Configuration for input audio transcription.

  • turn_detection – Configuration for turn detection.

format: PCMAudioFormat | PCMUAudioFormat | PCMAAudioFormat | None
transcription: InputTranscription | None
turn_detection: TurnDetection | None
class pipecat.services.inworld.realtime.events.AudioOutput(*, format: PCMAudioFormat | PCMUAudioFormat | PCMAAudioFormat | None = None, model: str | None = None, voice: str | None = None)[source]

Bases: BaseModel

Audio output configuration.

Parameters:
  • format – The format configuration for output audio.

  • model – The TTS model to use (e.g. “inworld-tts-1.5-max”).

  • voice – The voice ID to use (e.g. “Sarah”, “Clive”).

format: PCMAudioFormat | PCMUAudioFormat | PCMAAudioFormat | None
model: str | None
voice: str | None
class pipecat.services.inworld.realtime.events.AudioConfiguration(*, input: AudioInput | None = None, output: AudioOutput | None = None)[source]

Bases: BaseModel

Audio configuration for input and output.

Parameters:
  • input – Configuration for input audio.

  • output – Configuration for output audio.

input: AudioInput | None
output: AudioOutput | None
class pipecat.services.inworld.realtime.events.FunctionTool(*, type: Literal['function'] = 'function', name: str, description: str, parameters: dict[str, Any])[source]

Bases: BaseModel

Custom function tool configuration.

Parameters:
  • type – Tool type, always “function”.

  • name – Name of the function.

  • description – Description of what the function does.

  • parameters – JSON schema for function parameters.

type: Literal['function']
name: str
description: str
parameters: dict[str, Any]
class pipecat.services.inworld.realtime.events.SessionProperties(*, type: str | None = 'realtime', model: str | None = None, instructions: str | None = None, temperature: float | None = None, output_modalities: list[str] | None = None, audio: AudioConfiguration | None = None, tools: ToolsSchema | list[FunctionTool | dict[str, Any]] | None = None, provider_data: dict[str, Any] | None = None)[source]

Bases: BaseModel

Configuration properties for an Inworld Realtime session.

Parameters:
  • type – Session type, always “realtime”.

  • model – The LLM model to use (e.g. “openai/gpt-4.1-nano”).

  • instructions – System instructions for the assistant.

  • output_modalities – Output modalities (e.g. [“audio”, “text”]).

  • audio – Audio configuration including input (transcription, turn detection) and output (TTS model, voice).

  • tools – Available tools for the assistant.

type: str | None
model: str | None
instructions: str | None
temperature: float | None
output_modalities: list[str] | None
audio: AudioConfiguration | None
tools: ToolsSchema | list[FunctionTool | dict[str, Any]] | None
provider_data: dict[str, Any] | None
class pipecat.services.inworld.realtime.events.ItemContent(*, type: Literal['text', 'audio', 'input_text', 'input_audio', 'output_text', 'output_audio'], text: str | None = None, audio: str | None = None, transcript: str | None = None)[source]

Bases: BaseModel

Content within a conversation item.

Parameters:
  • type – Content type (input_text, input_audio, text, audio).

  • text – Text content for text-based items.

  • audio – Base64-encoded audio data for audio items.

  • transcript – Transcribed text for audio items.

type: Literal['text', 'audio', 'input_text', 'input_audio', 'output_text', 'output_audio']
text: str | None
audio: str | None
transcript: str | None
class pipecat.services.inworld.realtime.events.ConversationItem(*, id: str = <factory>, object: ~typing.Literal['realtime.item'] | None = None, type: ~typing.Literal['message', 'function_call', 'function_call_output'], status: ~typing.Literal['completed', 'in_progress', 'incomplete'] | None = None, role: ~typing.Literal['user', 'assistant', 'system', 'tool'] | None = None, content: list[~pipecat.services.inworld.realtime.events.ItemContent] | None = None, call_id: str | None = None, name: str | None = None, arguments: str | None = None, output: str | None = None)[source]

Bases: BaseModel

A conversation item in the realtime session.

Parameters:
  • id – Unique identifier for the item, auto-generated if not provided.

  • object – Object type identifier for the realtime API.

  • type – Item type (message, function_call, or function_call_output).

  • status – Current status of the item.

  • role – Speaker role for message items (user, assistant, or system).

  • content – Content list for message items.

  • call_id – Function call identifier for function_call items.

  • name – Function name for function_call items.

  • arguments – Function arguments as JSON string for function_call items.

  • output – Function output as JSON string for function_call_output items.

id: str
object: Literal['realtime.item'] | None
type: Literal['message', 'function_call', 'function_call_output']
status: Literal['completed', 'in_progress', 'incomplete'] | None
role: Literal['user', 'assistant', 'system', 'tool'] | None
content: list[ItemContent] | None
call_id: str | None
name: str | None
arguments: str | None
output: str | None
class pipecat.services.inworld.realtime.events.RealtimeConversation(*, id: str, object: Literal['realtime.conversation'])[source]

Bases: BaseModel

A realtime conversation session.

Parameters:
  • id – Unique identifier for the conversation.

  • object – Object type identifier, always “realtime.conversation”.

id: str
object: Literal['realtime.conversation']
class pipecat.services.inworld.realtime.events.ResponseProperties(*, modalities: list[Literal['text', 'audio']] | None = ['text', 'audio'])[source]

Bases: BaseModel

Properties for configuring assistant responses.

Parameters:

modalities – Output modalities for the response (text, audio, or both).

modalities: list[Literal['text', 'audio']] | None
class pipecat.services.inworld.realtime.events.RealtimeError(*, type: str | None = None, code: str | None = '', message: str, param: str | None = None, event_id: str | None = None)[source]

Bases: BaseModel

Error information from the realtime API.

Parameters:
  • type – Error type identifier.

  • code – Specific error code.

  • message – Human-readable error message.

  • param – Parameter name that caused the error, if applicable.

  • event_id – Event ID associated with the error, if applicable.

type: str | None
code: str | None
message: str
param: str | None
event_id: str | None
class pipecat.services.inworld.realtime.events.ClientEvent(*, event_id: str = <factory>)[source]

Bases: BaseModel

Base class for client events sent to the realtime API.

Parameters:

event_id – Unique identifier for the event, auto-generated if not provided.

event_id: str
class pipecat.services.inworld.realtime.events.SessionUpdateEvent(*, event_id: str = <factory>, type: Literal['session.update'] = 'session.update', session: SessionProperties)[source]

Bases: ClientEvent

Event to update session properties.

Parameters:
  • type – Event type, always “session.update”.

  • session – Updated session properties.

type: Literal['session.update']
session: SessionProperties
class pipecat.services.inworld.realtime.events.InputAudioBufferAppendEvent(*, event_id: str = <factory>, type: Literal['input_audio_buffer.append'] = 'input_audio_buffer.append', audio: str)[source]

Bases: ClientEvent

Event to append audio data to the input buffer.

Parameters:
  • type – Event type, always “input_audio_buffer.append”.

  • audio – Base64-encoded audio data to append.

type: Literal['input_audio_buffer.append']
audio: str
class pipecat.services.inworld.realtime.events.InputAudioBufferCommitEvent(*, event_id: str = <factory>, type: Literal['input_audio_buffer.commit'] = 'input_audio_buffer.commit')[source]

Bases: ClientEvent

Event to commit the current input audio buffer.

Used when turn_detection is null (manual mode).

Parameters:

type – Event type, always “input_audio_buffer.commit”.

type: Literal['input_audio_buffer.commit']
class pipecat.services.inworld.realtime.events.InputAudioBufferClearEvent(*, event_id: str = <factory>, type: Literal['input_audio_buffer.clear'] = 'input_audio_buffer.clear')[source]

Bases: ClientEvent

Event to clear the input audio buffer.

Parameters:

type – Event type, always “input_audio_buffer.clear”.

type: Literal['input_audio_buffer.clear']
class pipecat.services.inworld.realtime.events.ConversationItemCreateEvent(*, event_id: str = <factory>, type: Literal['conversation.item.create'] = 'conversation.item.create', previous_item_id: str | None = None, item: ConversationItem)[source]

Bases: ClientEvent

Event to create a new conversation item.

Parameters:
  • type – Event type, always “conversation.item.create”.

  • previous_item_id – ID of the item to insert after, if any.

  • item – The conversation item to create.

type: Literal['conversation.item.create']
previous_item_id: str | None
item: ConversationItem
class pipecat.services.inworld.realtime.events.ResponseCreateEvent(*, event_id: str = <factory>, type: Literal['response.create'] = 'response.create', response: ResponseProperties | None = None)[source]

Bases: ClientEvent

Event to create a new assistant response.

Parameters:
  • type – Event type, always “response.create”.

  • response – Optional response configuration properties.

type: Literal['response.create']
response: ResponseProperties | None
class pipecat.services.inworld.realtime.events.ResponseCancelEvent(*, event_id: str = <factory>, type: Literal['response.cancel'] = 'response.cancel')[source]

Bases: ClientEvent

Event to cancel the current assistant response.

Parameters:

type – Event type, always “response.cancel”.

type: Literal['response.cancel']
class pipecat.services.inworld.realtime.events.ServerEvent(*, event_id: str, type: str)[source]

Bases: BaseModel

Base class for server events received from the realtime API.

Parameters:
  • event_id – Unique identifier for the event.

  • type – Type of the server event.

event_id: str
type: str
class pipecat.services.inworld.realtime.events.SessionCreatedEvent(*, event_id: str, type: Literal['session.created'], session: SessionProperties | None = None)[source]

Bases: ServerEvent

Event indicating a session has been created.

This is the first event received after connecting.

Parameters:
  • type – Event type, always “session.created”.

  • session – The initial session properties.

type: Literal['session.created']
session: SessionProperties | None
class pipecat.services.inworld.realtime.events.SessionUpdatedEvent(*, event_id: str, type: Literal['session.updated'], session: SessionProperties)[source]

Bases: ServerEvent

Event indicating a session has been updated.

Parameters:
  • type – Event type, always “session.updated”.

  • session – The updated session properties.

type: Literal['session.updated']
session: SessionProperties
class pipecat.services.inworld.realtime.events.ConversationCreated(*, event_id: str, type: Literal['conversation.created'], conversation: RealtimeConversation)[source]

Bases: ServerEvent

Event indicating a conversation has been created.

This is the first message received after connecting.

Parameters:
  • type – Event type, always “conversation.created”.

  • conversation – The created conversation.

type: Literal['conversation.created']
conversation: RealtimeConversation
class pipecat.services.inworld.realtime.events.ConversationItemAdded(*, event_id: str, type: Literal['conversation.item.added'], previous_item_id: str | None = None, item: ConversationItem)[source]

Bases: ServerEvent

Event indicating a conversation item has been added.

Parameters:
  • type – Event type, always “conversation.item.added”.

  • previous_item_id – ID of the previous item, if any.

  • item – The added conversation item.

type: Literal['conversation.item.added']
previous_item_id: str | None
item: ConversationItem
class pipecat.services.inworld.realtime.events.ConversationItemInputAudioTranscriptionCompleted(*, event_id: str, type: Literal['conversation.item.input_audio_transcription.completed'], item_id: str, transcript: str)[source]

Bases: ServerEvent

Event indicating input audio transcription is complete.

Parameters:
  • type – Event type, always “conversation.item.input_audio_transcription.completed”.

  • item_id – ID of the conversation item that was transcribed.

  • transcript – Complete transcription text.

type: Literal['conversation.item.input_audio_transcription.completed']
item_id: str
transcript: str
class pipecat.services.inworld.realtime.events.ConversationItemInputAudioTranscriptionDelta(*, event_id: str, type: Literal['conversation.item.input_audio_transcription.delta'], item_id: str, content_index: int | None = None, delta: str)[source]

Bases: ServerEvent

Event containing incremental input audio transcription.

Parameters:
  • type – Event type, always “conversation.item.input_audio_transcription.delta”.

  • item_id – ID of the conversation item being transcribed.

  • content_index – Index of the content part.

  • delta – Incremental transcription text.

type: Literal['conversation.item.input_audio_transcription.delta']
item_id: str
content_index: int | None
delta: str
class pipecat.services.inworld.realtime.events.InputAudioBufferSpeechStarted(*, event_id: str, type: Literal['input_audio_buffer.speech_started'], item_id: str)[source]

Bases: ServerEvent

Event indicating speech has started in the input audio buffer.

Only sent when turn_detection is “server_vad”.

Parameters:
  • type – Event type, always “input_audio_buffer.speech_started”.

  • item_id – ID of the associated conversation item.

type: Literal['input_audio_buffer.speech_started']
item_id: str
class pipecat.services.inworld.realtime.events.InputAudioBufferSpeechStopped(*, event_id: str, type: Literal['input_audio_buffer.speech_stopped'], item_id: str)[source]

Bases: ServerEvent

Event indicating speech has stopped in the input audio buffer.

Only sent when turn_detection is “server_vad”.

Parameters:
  • type – Event type, always “input_audio_buffer.speech_stopped”.

  • item_id – ID of the associated conversation item.

type: Literal['input_audio_buffer.speech_stopped']
item_id: str
class pipecat.services.inworld.realtime.events.InputAudioBufferCommitted(*, event_id: str, type: Literal['input_audio_buffer.committed'], previous_item_id: str | None = None, item_id: str)[source]

Bases: ServerEvent

Event indicating the input audio buffer has been committed.

Parameters:
  • type – Event type, always “input_audio_buffer.committed”.

  • previous_item_id – ID of the previous item, if any.

  • item_id – ID of the committed conversation item.

type: Literal['input_audio_buffer.committed']
previous_item_id: str | None
item_id: str
class pipecat.services.inworld.realtime.events.InputAudioBufferCleared(*, event_id: str, type: Literal['input_audio_buffer.cleared'])[source]

Bases: ServerEvent

Event indicating the input audio buffer has been cleared.

Parameters:

type – Event type, always “input_audio_buffer.cleared”.

type: Literal['input_audio_buffer.cleared']
class pipecat.services.inworld.realtime.events.ResponseCreated(*, event_id: str, type: str)[source]

Bases: ServerEvent

Event indicating an assistant response has been created.

Parameters:
  • type – Event type, always “response.created”.

  • response – The created response object.

type: Literal['response.created']
response: Response
class pipecat.services.inworld.realtime.events.ResponseOutputItemAdded(*, event_id: str, type: Literal['response.output_item.added'], response_id: str, output_index: int, item: ConversationItem)[source]

Bases: ServerEvent

Event indicating an output item has been added to a response.

Parameters:
  • type – Event type, always “response.output_item.added”.

  • response_id – ID of the response.

  • output_index – Index of the output item.

  • item – The added conversation item.

type: Literal['response.output_item.added']
response_id: str
output_index: int
item: ConversationItem
class pipecat.services.inworld.realtime.events.ResponseAudioTranscriptDelta(*, event_id: str, type: Literal['response.output_audio_transcript.delta'], response_id: str, item_id: str, delta: str)[source]

Bases: ServerEvent

Event containing incremental audio transcript from a response.

Parameters:
  • type – Event type, always “response.output_audio_transcript.delta”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

  • delta – Incremental transcript text.

type: Literal['response.output_audio_transcript.delta']
response_id: str
item_id: str
delta: str
class pipecat.services.inworld.realtime.events.ResponseAudioTranscriptDone(*, event_id: str, type: Literal['response.output_audio_transcript.done'], response_id: str, item_id: str)[source]

Bases: ServerEvent

Event indicating audio transcript is complete.

Parameters:
  • type – Event type, always “response.output_audio_transcript.done”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

type: Literal['response.output_audio_transcript.done']
response_id: str
item_id: str
class pipecat.services.inworld.realtime.events.ResponseAudioDelta(*, event_id: str, type: Literal['response.output_audio.delta'], response_id: str, item_id: str, output_index: int, content_index: int, delta: str)[source]

Bases: ServerEvent

Event containing incremental audio data from a response.

Parameters:
  • type – Event type, always “response.output_audio.delta”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

  • output_index – Index of the output item.

  • content_index – Index of the content part.

  • delta – Base64-encoded incremental audio data.

type: Literal['response.output_audio.delta']
response_id: str
item_id: str
output_index: int
content_index: int
delta: str
class pipecat.services.inworld.realtime.events.ResponseAudioDone(*, event_id: str, type: Literal['response.output_audio.done'], response_id: str, item_id: str)[source]

Bases: ServerEvent

Event indicating audio content is complete.

Parameters:
  • type – Event type, always “response.output_audio.done”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

type: Literal['response.output_audio.done']
response_id: str
item_id: str
class pipecat.services.inworld.realtime.events.ResponseFunctionCallArgumentsDelta(*, event_id: str, type: Literal['response.function_call_arguments.delta'], response_id: str | None = None, item_id: str | None = None, call_id: str, delta: str, previous_item_id: str | None = None)[source]

Bases: ServerEvent

Event containing incremental function call arguments.

Parameters:
  • type – Event type, always “response.function_call_arguments.delta”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

  • call_id – ID of the function call.

  • delta – Incremental function arguments as JSON.

  • previous_item_id – ID of the previous item, if any.

type: Literal['response.function_call_arguments.delta']
response_id: str | None
item_id: str | None
call_id: str
delta: str
previous_item_id: str | None
class pipecat.services.inworld.realtime.events.ResponseFunctionCallArgumentsDone(*, event_id: str, type: Literal['response.function_call_arguments.done'], call_id: str, name: str | None = None, arguments: str)[source]

Bases: ServerEvent

Event indicating function call arguments are complete.

Parameters:
  • type – Event type, always “response.function_call_arguments.done”.

  • call_id – ID of the function call.

  • name – Name of the function being called. Optional — Inworld may omit this; the name can be resolved from the tracked function call item.

  • arguments – Complete function arguments as JSON string.

type: Literal['response.function_call_arguments.done']
call_id: str
name: str | None
arguments: str
class pipecat.services.inworld.realtime.events.Usage(*, total_tokens: int | None = None, input_tokens: int | None = None, output_tokens: int | None = None)[source]

Bases: BaseModel

Token usage statistics for a response.

Parameters:
  • total_tokens – Total number of tokens used.

  • input_tokens – Number of input tokens used.

  • output_tokens – Number of output tokens used.

total_tokens: int | None
input_tokens: int | None
output_tokens: int | None
class pipecat.services.inworld.realtime.events.Response(*, id: str, object: Literal['realtime.response'], status: Literal['completed', 'in_progress', 'incomplete', 'cancelled', 'failed'], status_details: Any | None = None, output: list[ConversationItem], usage: Usage | None = None)[source]

Bases: BaseModel

A complete assistant response.

Parameters:
  • id – Unique identifier for the response.

  • object – Object type, always “realtime.response”.

  • status – Current status of the response.

  • output – List of conversation items in the response.

  • usage – Token usage statistics for the response.

id: str
object: Literal['realtime.response']
status: Literal['completed', 'in_progress', 'incomplete', 'cancelled', 'failed']
status_details: Any | None
output: list[ConversationItem]
usage: Usage | None
class pipecat.services.inworld.realtime.events.ResponseDone(*, event_id: str, type: Literal['response.done'], response: Response, usage: Usage | None = None)[source]

Bases: ServerEvent

Event indicating an assistant response is complete.

Parameters:
  • type – Event type, always “response.done”.

  • response – The completed response object.

  • usage – Token usage (also available at top level).

type: Literal['response.done']
response: Response
usage: Usage | None
class pipecat.services.inworld.realtime.events.ResponseOutputItemDone(*, event_id: str, type: Literal['response.output_item.done'], response_id: str, output_index: int, item: ConversationItem)[source]

Bases: ServerEvent

Event indicating an output item is complete.

Parameters:
  • type – Event type, always “response.output_item.done”.

  • response_id – ID of the response.

  • output_index – Index of the output item.

  • item – The completed conversation item.

type: Literal['response.output_item.done']
response_id: str
output_index: int
item: ConversationItem
class pipecat.services.inworld.realtime.events.ContentPart(*, type: str, transcript: str | None = None)[source]

Bases: BaseModel

A content part within a response.

Parameters:
  • type – Type of the content part (audio, text).

  • transcript – Transcript text if applicable.

type: str
transcript: str | None
class pipecat.services.inworld.realtime.events.ResponseContentPartAdded(*, event_id: str, type: Literal['response.content_part.added'], response_id: str, item_id: str, content_index: int, output_index: int, part: ContentPart)[source]

Bases: ServerEvent

Event indicating a content part has been added to a response.

Parameters:
  • type – Event type, always “response.content_part.added”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

  • content_index – Index of the content part.

  • output_index – Index of the output item.

  • part – The added content part.

type: Literal['response.content_part.added']
response_id: str
item_id: str
content_index: int
output_index: int
part: ContentPart
class pipecat.services.inworld.realtime.events.ResponseContentPartDone(*, event_id: str, type: Literal['response.content_part.done'], response_id: str, item_id: str, content_index: int, output_index: int)[source]

Bases: ServerEvent

Event indicating a content part is complete.

Parameters:
  • type – Event type, always “response.content_part.done”.

  • response_id – ID of the response.

  • item_id – ID of the conversation item.

  • content_index – Index of the content part.

  • output_index – Index of the output item.

type: Literal['response.content_part.done']
response_id: str
item_id: str
content_index: int
output_index: int
class pipecat.services.inworld.realtime.events.PingEvent(*, event_id: str, type: Literal['ping'], timestamp: int)[source]

Bases: ServerEvent

Keep-alive ping event from the server.

Parameters:
  • type – Event type, always “ping”.

  • timestamp – Server timestamp in milliseconds.

type: Literal['ping']
timestamp: int
class pipecat.services.inworld.realtime.events.ErrorEvent(*, event_id: str, type: Literal['error'], error: RealtimeError)[source]

Bases: ServerEvent

Event indicating an error occurred.

Parameters:
  • type – Event type, always “error”.

  • error – Error details.

type: Literal['error']
error: RealtimeError
pipecat.services.inworld.realtime.events.parse_server_event(data: str)[source]

Parse a server event from JSON string.

Parameters:

data – JSON string containing the server event.

Returns:

Parsed server event object of the appropriate type.

Raises:

Exception – If the event type is unimplemented or parsing fails.