Class: OpenAI::Models::Beta::Agents::AutomationTarget::NewSession::Input

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

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(agent:, agent_id:, environment:, input:, metadata:, vault_ids:, type: :new_session) ⇒ Input

Returns a new instance of Input.

Parameters:

  • content —

    The content of the message.

  • role —

    The role of the message author. Always user.

  • type (defaults to: :new_session) —

    The type of the input item. Always message.

  • content: (::Array[OpenAI::Models::Beta::input_content])
  • role: (:user)
  • type: (:message) (defaults to: :new_session)


84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/openai/models/beta/agents/automation_target.rb', line 84

class Input < OpenAI::Internal::Type::BaseModel
  # @!attribute content
  #   The content of the message.
  #
  #   @return [Array<OpenAI::Models::Beta::InputContent::InputText, OpenAI::Models::Beta::InputContent::InputImage>]
  required :content, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::InputContent] }

  # @!attribute role
  #   The role of the message author. Always `user`.
  #
  #   @return [Symbol, :user]
  required :role, const: :user

  # @!attribute type
  #   The type of the input item. Always `message`.
  #
  #   @return [Symbol, :message]
  required :type, const: :message

  # @!method initialize(content:, role: :user, type: :message)
  #   A user message recorded in a session.
  #
  #   @param content [Array<OpenAI::Models::Beta::InputContent::InputText, OpenAI::Models::Beta::InputContent::InputImage>]
  #     The content of the message.
  #
  #   @param role [Symbol, :user]
  #     The role of the message author. Always `user`.
  #
  #   @param type [Symbol, :message]
  #     The type of the input item. Always `message`.
end

Instance Attribute Details

#content ⇒ ::Array[OpenAI::Models::Beta::input_content]

The content of the message.

Returns:

  • (::Array[OpenAI::Models::Beta::input_content])


89
# File 'lib/openai/models/beta/agents/automation_target.rb', line 89

required :content, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::InputContent] }

#role ⇒ :user

The role of the message author. Always user.

Returns:

  • (:user)


95
# File 'lib/openai/models/beta/agents/automation_target.rb', line 95

required :role, const: :user

#type ⇒ :message

The type of the input item. Always message.

Returns:

  • (:message)


101
# File 'lib/openai/models/beta/agents/automation_target.rb', line 101

required :type, const: :message

Instance Method Details

#to_hash ⇒ { content: ::Array[OpenAI::Models::Beta::input_content], ?role: :user, ?type: :message }

Returns:

  • ({ content: ::Array[OpenAI::Models::Beta::input_content], ?role: :user, ?type: :message })


108
109
110
111
112
# File 'sig/openai/models/beta/agents/automation_target.rbs', line 108

def to_hash: -> {
  content: ::Array[OpenAI::Models::Beta::input_content],
  ?role: :user,
  ?type: :message
}