Class: OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_conversation_item_user_message.rb

Defined Under Namespace

Modules: Detail, Type

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(audio: nil, detail: nil, image_url: nil, text: nil, transcript: nil, type: nil) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content for more details.

Parameters:

  • audio (String) (defaults to: nil)

    Base64-encoded audio bytes (for ‘input_audio`), these will be parsed as the form

  • detail (Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Detail) (defaults to: nil)

    The detail level of the image (for ‘input_image`). `auto` will default to `high`

  • image_url (String) (defaults to: nil)

    Base64-encoded image bytes (for ‘input_image`) as a data URI. For example `data:

  • text (String) (defaults to: nil)

    The text content (for ‘input_text`).

  • transcript (String) (defaults to: nil)

    Transcript of the audio (for ‘input_audio`). This is not sent to the model, but

  • type (Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Type) (defaults to: nil)

    The content type (‘input_text`, `input_audio`, or `input_image`).



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 65

class Content < OpenAI::Internal::Type::BaseModel
  # @!attribute audio
  #   Base64-encoded audio bytes (for `input_audio`), these will be parsed as the
  #   format specified in the session input audio type configuration. This defaults to
  #   PCM 16-bit 24kHz mono if not specified.
  #
  #   @return [String, nil]
  optional :audio, String

  # @!attribute detail
  #   The detail level of the image (for `input_image`). `auto` will default to
  #   `high`.
  #
  #   @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Detail, nil]
  optional :detail, enum: -> { OpenAI::Realtime::RealtimeConversationItemUserMessage::Content::Detail }

  # @!attribute image_url
  #   Base64-encoded image bytes (for `input_image`) as a data URI. For example
  #   `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...`. Supported formats are PNG
  #   and JPEG.
  #
  #   @return [String, nil]
  optional :image_url, String

  # @!attribute text
  #   The text content (for `input_text`).
  #
  #   @return [String, nil]
  optional :text, String

  # @!attribute transcript
  #   Transcript of the audio (for `input_audio`). This is not sent to the model, but
  #   will be attached to the message item for reference.
  #
  #   @return [String, nil]
  optional :transcript, String

  # @!attribute type
  #   The content type (`input_text`, `input_audio`, or `input_image`).
  #
  #   @return [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Type, nil]
  optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemUserMessage::Content::Type }

  # @!method initialize(audio: nil, detail: nil, image_url: nil, text: nil, transcript: nil, type: nil)
  #   Some parameter documentations has been truncated, see
  #   {OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content} for
  #   more details.
  #
  #   @param audio [String] Base64-encoded audio bytes (for `input_audio`), these will be parsed as the form
  #
  #   @param detail [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Detail] The detail level of the image (for `input_image`). `auto` will default to `high`
  #
  #   @param image_url [String] Base64-encoded image bytes (for `input_image`) as a data URI. For example `data:
  #
  #   @param text [String] The text content (for `input_text`).
  #
  #   @param transcript [String] Transcript of the audio (for `input_audio`). This is not sent to the model, but
  #
  #   @param type [Symbol, OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content::Type] The content type (`input_text`, `input_audio`, or `input_image`).

  # The detail level of the image (for `input_image`). `auto` will default to
  # `high`.
  #
  # @see OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content#detail
  module Detail
    extend OpenAI::Internal::Type::Enum

    AUTO = :auto
    LOW = :low
    HIGH = :high

    # @!method self.values
    #   @return [Array<Symbol>]
  end

  # The content type (`input_text`, `input_audio`, or `input_image`).
  #
  # @see OpenAI::Models::Realtime::RealtimeConversationItemUserMessage::Content#type
  module Type
    extend OpenAI::Internal::Type::Enum

    INPUT_TEXT = :input_text
    INPUT_AUDIO = :input_audio
    INPUT_IMAGE = :input_image

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#audioString?

Base64-encoded audio bytes (for ‘input_audio`), these will be parsed as the format specified in the session input audio type configuration. This defaults to PCM 16-bit 24kHz mono if not specified.

Returns:

  • (String, nil)


72
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 72

optional :audio, String

#detailSymbol, ...

The detail level of the image (for ‘input_image`). `auto` will default to `high`.



79
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 79

optional :detail, enum: -> { OpenAI::Realtime::RealtimeConversationItemUserMessage::Content::Detail }

#image_urlString?

Base64-encoded image bytes (for ‘input_image`) as a data URI. For example `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA…`. Supported formats are PNG and JPEG.

Returns:

  • (String, nil)


87
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 87

optional :image_url, String

#textString?

The text content (for ‘input_text`).

Returns:

  • (String, nil)


93
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 93

optional :text, String

#transcriptString?

Transcript of the audio (for ‘input_audio`). This is not sent to the model, but will be attached to the message item for reference.

Returns:

  • (String, nil)


100
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 100

optional :transcript, String

#typeSymbol, ...

The content type (‘input_text`, `input_audio`, or `input_image`).



106
# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 106

optional :type, enum: -> { OpenAI::Realtime::RealtimeConversationItemUserMessage::Content::Type }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/realtime/realtime_conversation_item_user_message.rb', line 136