Class: OpenAI::Models::Live::InitialItem::User::Content

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/live/initial_item.rb,
sig/openai/models/live/initial_item.rbs

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, 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, coerce_with_error, 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(text:, type: nil) ⇒ Object

Text supplied in a developer or user message when starting a Live session.

Parameters:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/openai/models/live/initial_item.rb', line 192

class Content < OpenAI::Internal::Type::BaseModel
  # @!attribute text
  #   The message text to include in the Live session’s initial conversation history.
  #
  #   @return [String]
  required :text, String

  # @!attribute type
  #   The text content type. Always `input_text`.
  #
  #   @return [Symbol, OpenAI::Models::Live::InitialItem::User::Content::Type, nil]
  optional :type, enum: -> { OpenAI::Live::InitialItem::User::Content::Type }

  # @!method initialize(text:, type: nil)
  #   Text supplied in a developer or user message when starting a Live session.
  #
  #   @param text [String]
  #     The message text to include in the Live session’s initial conversation history.
  #
  #   @param type [Symbol, OpenAI::Models::Live::InitialItem::User::Content::Type]
  #     The text content type. Always `input_text`.

  # The text content type. Always `input_text`.
  #
  # @see OpenAI::Models::Live::InitialItem::User::Content#type
  module Type
    extend OpenAI::Internal::Type::Enum

    INPUT_TEXT = :input_text

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

Instance Attribute Details

#textString

The message text to include in the Live session’s initial conversation history.

Parameters:

  • value (String)

Returns:

  • (String)


197
# File 'lib/openai/models/live/initial_item.rb', line 197

required :text, String

#typeSymbol, ...

The text content type. Always input_text.



203
# File 'lib/openai/models/live/initial_item.rb', line 203

optional :type, enum: -> { OpenAI::Live::InitialItem::User::Content::Type }

Instance Method Details

#to_hash{

Returns:

  • ({)


170
# File 'sig/openai/models/live/initial_item.rbs', line 170

def to_hash: -> {