View Source ExOpenAI.Components.RealtimeBetaResponse (ex_openai.ex v2.0.0-beta2)

The response resource.

Fields

  • :conversation_id - optional - String.t()
    Which conversation the response is added to, determined by the conversation field in the response.create event. If auto, the response will be added to the default conversation and the value of conversation_id will be an id like conv_1234. If none, the response will not be added to any conversation and the value of conversation_id will be null. If responses are being triggered by server VAD, the response will be added to the default conversation, thus the conversation_id will be an id like conv_1234.

  • :id - optional - String.t()
    The unique ID of the response.

  • :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()

  • :modalities - optional - [:text | :audio]
    The set of modalities the model used to respond. If there are multiple modalities, the model will pick one, for example if modalities is ["text", "audio"], the model could be responding in either text or audio.

  • :object - optional - :"realtime.response"
    The object type, must be realtime.response.
    Allowed values: "realtime.response"

  • :output - optional - [ExOpenAI.Components.RealtimeConversationItem.t()]
    The list of output items generated by the response.

  • :output_audio_format - optional - :pcm16 | :g711_ulaw | :g711_alaw
    The format of output audio. Options are pcm16, g711_ulaw, or g711_alaw.
    Allowed values: "pcm16", "g711_ulaw", "g711_alaw"

  • :status - optional - :completed | :cancelled | :failed | :incomplete | :in_progress
    The final status of the response (completed, cancelled, failed, or incomplete, 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.

  • :temperature - optional - number()
    Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.

  • :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.

  • :voice - optional - ExOpenAI.Components.VoiceIdsShared.t()
    The voice the model used to respond. Current voice options are alloy, ash, ballad, coral, echo, sage, shimmer, and verse.

Summary

Types

@type t() :: %ExOpenAI.Components.RealtimeBetaResponse{
  conversation_id: String.t() | nil,
  id: String.t() | nil,
  max_output_tokens: (integer() | :inf) | nil,
  metadata: ExOpenAI.Components.Metadata.t() | nil,
  modalities: [:text | :audio] | nil,
  object: :"realtime.response" | nil,
  output: [ExOpenAI.Components.RealtimeConversationItem.t()] | nil,
  output_audio_format: ((:pcm16 | :g711_ulaw) | :g711_alaw) | 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,
  temperature: number() | 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,
  voice: ExOpenAI.Components.VoiceIdsShared.t() | nil
}