View Source ExOpenAI.Components.RealtimeResponse (ex_openai.ex v2.0.0-beta2)
The response resource.
Fields
:audio- optional -{:%{}, [], [{{:optional, [], [:output]}, {:%{}, [], [{{:optional, [], [:format]}, {{:., [], [ExOpenAI.Components.RealtimeAudioFormats, :t]}, [], []}}, {{:optional, [], [:voice]}, {{:., [], [ExOpenAI.Components.VoiceIdsShared, :t]}, [], []}}]}}]}
Configuration for audio output.:conversation_id- optional -String.t()
Which conversation the response is added to, determined by theconversationfield in theresponse.createevent. Ifauto, the response will be added to the default conversation and the value ofconversation_idwill be an id likeconv_1234. Ifnone, the response will not be added to any conversation and the value ofconversation_idwill benull. If responses are being triggered automatically by VAD the response will be added to the default conversation:id- optional -String.t()
The unique ID of the response, will look likeresp_1234.:max_output_tokens- optional -integer() | :inf
Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.:metadata- optional -ExOpenAI.Components.Metadata.t():object- optional -:"realtime.response"
The object type, must berealtime.response.
Allowed values:"realtime.response":output- optional -[ExOpenAI.Components.RealtimeConversationItem.t()]
The list of output items generated by the response.:output_modalities- optional -[:text | :audio]
The set of modalities the model used to respond, currently the only possible values are["audio"],["text"]. Audio output always include a text transcript. Setting the output to modetextwill disable audio output from the model.:status- optional -:completed | :cancelled | :failed | :incomplete | :in_progress
The final status of the response (completed,cancelled,failed, orincomplete,in_progress).
Allowed values:"completed","cancelled","failed","incomplete","in_progress":status_details- optional -{:%{}, [], [{{:optional, [], [:error]}, {:%{}, [], [{{:optional, [], [:code]}, {{:., [], [{:__aliases__, [alias: false], [:String]}, :t]}, [], []}}, {{:optional, [], [:type]}, {{:., [], [{:__aliases__, [alias: false], [:String]}, :t]}, [], []}}]}}, {{:optional, [], [:reason]}, {:|, [], [{:|, [], [{:|, [], [:turn_detected, :client_cancelled]}, :max_output_tokens]}, :content_filter]}}, {{:optional, [], [:type]}, {:|, [], [{:|, [], [{:|, [], [:completed, :cancelled]}, :failed]}, :incomplete]}}]}
Additional details about the status.:usage- optional -{:%{}, [], [{{:optional, [], [:input_token_details]}, {:%{}, [], [{{:optional, [], [:audio_tokens]}, {:integer, [], []}}, {{:optional, [], [:cached_tokens]}, {:integer, [], []}}, {{:optional, [], [:cached_tokens_details]}, {:%{}, [], [{{:optional, [], [:audio_tokens]}, {:integer, [], []}}, {{:optional, [], [:image_tokens]}, {:integer, [], []}}, {{:optional, [], [:text_tokens]}, {:integer, [], []}}]}}, {{:optional, [], [:image_tokens]}, {:integer, [], []}}, {{:optional, [], [:text_tokens]}, {:integer, [], []}}]}}, {{:optional, [], [:input_tokens]}, {:integer, [], []}}, {{:optional, [], [:output_token_details]}, {:%{}, [], [{{:optional, [], [:audio_tokens]}, {:integer, [], []}}, {{:optional, [], [:text_tokens]}, {:integer, [], []}}]}}, {{:optional, [], [:output_tokens]}, {:integer, [], []}}, {{:optional, [], [:total_tokens]}, {:integer, [], []}}]}
Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.
Summary
Types
@type t() :: %ExOpenAI.Components.RealtimeResponse{ audio: %{ optional(:output) => %{ optional(:format) => ExOpenAI.Components.RealtimeAudioFormats.t(), optional(:voice) => ExOpenAI.Components.VoiceIdsShared.t() } } | nil, conversation_id: String.t() | nil, id: String.t() | nil, max_output_tokens: (integer() | :inf) | nil, metadata: ExOpenAI.Components.Metadata.t() | nil, object: :"realtime.response" | nil, output: [ExOpenAI.Components.RealtimeConversationItem.t()] | nil, output_modalities: [:text | :audio] | nil, status: ((((:completed | :cancelled) | :failed) | :incomplete) | :in_progress) | nil, status_details: %{ optional(:error) => %{ optional(:code) => String.t(), optional(:type) => String.t() }, optional(:reason) => ((:turn_detected | :client_cancelled) | :max_output_tokens) | :content_filter, optional(:type) => ((:completed | :cancelled) | :failed) | :incomplete } | nil, usage: %{ optional(:input_token_details) => %{ optional(:audio_tokens) => integer(), optional(:cached_tokens) => integer(), optional(:cached_tokens_details) => %{ optional(:audio_tokens) => integer(), optional(:image_tokens) => integer(), optional(:text_tokens) => integer() }, optional(:image_tokens) => integer(), optional(:text_tokens) => integer() }, optional(:input_tokens) => integer(), optional(:output_token_details) => %{ optional(:audio_tokens) => integer(), optional(:text_tokens) => integer() }, optional(:output_tokens) => integer(), optional(:total_tokens) => integer() } | nil }