Class: OpenAI::Models::Chat::ChatCompletionUserMessageParam

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

Defined Under Namespace

Modules: Content

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(content:, name: nil, role: :user) ⇒ Object

Parameters:

  • content

    The contents of the user message.

  • name (defaults to: nil)

    An optional name for the participant. Provides the model information to differentiate between participants of the same role.

  • role (defaults to: :user)

    The role of the messages author, in this case user.



# File 'lib/openai/models/chat/chat_completion_user_message_param.rb', line 26

Instance Attribute Details

#contentOpenAI::Models::Chat::ChatCompletionUserMessageParam::content

The contents of the user message.

Returns:

  • (OpenAI::Models::Chat::ChatCompletionUserMessageParam::content)


11
# File 'lib/openai/models/chat/chat_completion_user_message_param.rb', line 11

required :content, union: -> { OpenAI::Chat::ChatCompletionUserMessageParam::Content }

#nameString?

An optional name for the participant. Provides the model information to differentiate between participants of the same role.

Returns:

  • (String, nil)


24
# File 'lib/openai/models/chat/chat_completion_user_message_param.rb', line 24

optional :name, String

#role:user

The role of the messages author, in this case user.

Returns:

  • (:user)


17
# File 'lib/openai/models/chat/chat_completion_user_message_param.rb', line 17

required :role, const: :user

Instance Method Details

#to_hash{

Returns:

  • ({)


41
# File 'sig/openai/models/chat/chat_completion_user_message_param.rbs', line 41

def to_hash: -> {