Class: OpenAI::Models::DecisionInputMessage::User

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

Defined Under Namespace

Modules: Content, 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_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(content:, type: nil, role: :user) ⇒ User

Returns a new instance of User.

Parameters:

  • content —

    A text string or an ordered list of text, image, and JSON parts.

  • content: (OpenAI::Models::DecisionInputMessage::User::content)
  • type: (OpenAI::Models::DecisionInputMessage::User::type_) (defaults to: nil)
  • role: (:user) (defaults to: :user)


# File 'lib/openai/models/decision_input_message.rb', line 40

Instance Attribute Details

#content ⇒ OpenAI::Models::DecisionInputMessage::User::content

A text string or an ordered list of text, image, and JSON parts.

Returns:

  • (OpenAI::Models::DecisionInputMessage::User::content)


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

required :content, union: -> { OpenAI::DecisionInputMessage::User::Content }

#role ⇒ Symbol, :user

Parameters:

  • value (:user)

Returns:

  • (Symbol, :user)


33
# File 'lib/openai/models/decision_input_message.rb', line 33

required :role, const: :user

#type ⇒ Symbol, ...

Parameters:

  • (OpenAI::Models::DecisionInputMessage::User::type_)

Returns:



38
# File 'lib/openai/models/decision_input_message.rb', line 38

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

Instance Method Details

#to_hash ⇒ { content: OpenAI::Models::DecisionInputMessage::User::content, ?role: :user, ?type: OpenAI::Models::DecisionInputMessage::User::type_ }

Returns:

  • ({ content: OpenAI::Models::DecisionInputMessage::User::content, ?role: :user, ?type: OpenAI::Models::DecisionInputMessage::User::type_ })


39
40
41
42
43
# File 'sig/openai/models/decision_input_message.rbs', line 39

def to_hash: -> {
  content: OpenAI::Models::DecisionInputMessage::User::content,
  ?role: :user,
  ?type: OpenAI::Models::DecisionInputMessage::User::type_
}