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

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: Status, Type Classes: Content

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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 ⇒ User

Returns a new instance of User.

Parameters:

  • content —

    The message content. Supply exactly one text part for the initial Live conversation history.

  • id —

    An optional identifier for the supplied history message. Live uses the message’s role and text to initialize the conversation.

  • status —

    The supplied message’s status. Live uses its text as history and does not resume an incomplete message.

  • type —

    The history item type. Always message.

  • role —

    The author of this history message. Always user.

  • content: (::Array[OpenAI::Live::InitialItem::User::Content])
  • id: (String, nil)
  • status: (OpenAI::Models::Live::InitialItem::User::status, nil)
  • type: (OpenAI::Models::Live::InitialItem::User::type_)
  • role: (:user)


185
186
187
188
189
190
191
# File 'sig/openai/models/live/initial_item.rbs', line 185

def initialize: (
  content: ::Array[OpenAI::Live::InitialItem::User::Content],
  ?id: String?,
  ?status: OpenAI::Models::Live::InitialItem::User::status?,
  ?type: OpenAI::Models::Live::InitialItem::User::type_,
  ?role: :user
) -> void

Instance Attribute Details

#content ⇒ ::Array[OpenAI::Live::InitialItem::User::Content]

The message content. Supply exactly one text part for the initial Live conversation history.

Returns:

  • (::Array[OpenAI::Live::InitialItem::User::Content])


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

required :content, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::InitialItem::User::Content] }

#id ⇒ String?

An optional identifier for the supplied history message. Live uses the message’s role and text to initialize the conversation.

Returns:

  • (String, nil)


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

optional :id, String, nil?: true

#role ⇒ :user

The author of this history message. Always user.

Returns:

  • (:user)


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

required :role, const: :user

#status ⇒ OpenAI::Models::Live::InitialItem::User::status?

The supplied message’s status. Live uses its text as history and does not resume an incomplete message.

Returns:

  • (OpenAI::Models::Live::InitialItem::User::status, nil)


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

optional :status, enum: -> { OpenAI::Live::InitialItem::User::Status }, nil?: true

#type ⇒ OpenAI::Models::Live::InitialItem::User::type_?

The history item type. Always message.

Returns:

  • (OpenAI::Models::Live::InitialItem::User::type_, nil)


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

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

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#to_hash ⇒ { content: ::Array[OpenAI::Live::InitialItem::User::Content], ?role: :user, ?id: String?, ?status: OpenAI::Models::Live::InitialItem::User::status?, ?type: OpenAI::Models::Live::InitialItem::User::type_ }

Returns:

  • ({ content: ::Array[OpenAI::Live::InitialItem::User::Content], ?role: :user, ?id: String?, ?status: OpenAI::Models::Live::InitialItem::User::status?, ?type: OpenAI::Models::Live::InitialItem::User::type_ })


193
194
195
196
197
198
199
# File 'sig/openai/models/live/initial_item.rbs', line 193

def to_hash: -> {
  content: ::Array[OpenAI::Live::InitialItem::User::Content],
  ?role: :user,
  ?id: String?,
  ?status: OpenAI::Models::Live::InitialItem::User::status?,
  ?type: OpenAI::Models::Live::InitialItem::User::type_
}