Class: OpenAI::Models::Live::InitialItem::Developer

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 ⇒ Developer

Returns a new instance of Developer.

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 developer.

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


58
59
60
61
62
63
64
# File 'sig/openai/models/live/initial_item.rbs', line 58

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

Instance Attribute Details

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

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

Returns:

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


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

required :content, -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Live::InitialItem::Developer::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)


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

optional :id, String, nil?: true

#role ⇒ :developer

The author of this history message. Always developer.

Returns:

  • (:developer)


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

required :role, const: :developer

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

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

Returns:

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


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

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

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

The history item type. Always message.

Returns:

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


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

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

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

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

Returns:

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


66
67
68
69
70
71
72
# File 'sig/openai/models/live/initial_item.rbs', line 66

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