Class: OpenAI::Models::Beta::Subagent

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

Defined Under Namespace

Modules: Status

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(id:, closed_at:, instructions:, name:, opened_at:, parent_agent_id:, session_id:, status:, object: :"agent.session.subagent") ⇒ Subagent

Returns a new instance of Subagent.

Parameters:

  • id —

    The ID of the subagent.

  • closed_at —

    The Unix timestamp, in seconds, when the subagent was closed. Null while active, including after resume.

  • instructions —

    Initial task content, or null when unavailable. Text may contain placeholders for images or audio when only a preview is available.

  • name —

    The runner-assigned nickname, or null when unavailable.

  • opened_at —

    The Unix timestamp, in seconds, when the subagent was first opened. Resuming does not change it.

  • parent_agent_id —

    The ID of the agent that created this subagent.

  • session_id —

    The ID of the session that owns the subagent.

  • status —

    The current status of the subagent.

  • object (defaults to: :"agent.session.subagent") —

    The object type. Always agent.session.subagent.

  • id: (String)
  • closed_at: (Integer, nil)
  • instructions: (::Array[OpenAI::Models::Beta::agent_content], nil)
  • name: (String, nil)
  • opened_at: (Integer)
  • parent_agent_id: (String)
  • session_id: (String)
  • status: (OpenAI::Models::Beta::Subagent::status)
  • object: (:"agent.session.subagent") (defaults to: :"agent.session.subagent")


# File 'lib/openai/models/beta/subagent.rb', line 70

Instance Attribute Details

#closed_at ⇒ Integer?

The Unix timestamp, in seconds, when the subagent was closed. Null while active, including after resume.

Returns:

  • (Integer, nil)


18
# File 'lib/openai/models/beta/subagent.rb', line 18

required :closed_at, Integer, nil?: true

#id ⇒ String

The ID of the subagent.

Returns:

  • (String)


11
# File 'lib/openai/models/beta/subagent.rb', line 11

required :id, String

#instructions ⇒ ::Array[OpenAI::Models::Beta::agent_content]?

Initial task content, or null when unavailable. Text may contain placeholders for images or audio when only a preview is available.

Returns:

  • (::Array[OpenAI::Models::Beta::agent_content], nil)


25
26
27
28
29
30
31
# File 'lib/openai/models/beta/subagent.rb', line 25

required(
  :instructions,
  -> {
    OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AgentContent]
  },
  nil?: true
)

#name ⇒ String?

The runner-assigned nickname, or null when unavailable.

Returns:

  • (String, nil)


37
# File 'lib/openai/models/beta/subagent.rb', line 37

required :name, String, nil?: true

#object ⇒ :"agent.session.subagent"

The object type. Always agent.session.subagent.

Returns:

  • (:"agent.session.subagent")


43
# File 'lib/openai/models/beta/subagent.rb', line 43

required :object, const: :"agent.session.subagent"

#opened_at ⇒ Integer

The Unix timestamp, in seconds, when the subagent was first opened. Resuming does not change it.

Returns:

  • (Integer)


50
# File 'lib/openai/models/beta/subagent.rb', line 50

required :opened_at, Integer

#parent_agent_id ⇒ String

The ID of the agent that created this subagent.

Returns:

  • (String)


56
# File 'lib/openai/models/beta/subagent.rb', line 56

required :parent_agent_id, String

#session_id ⇒ String

The ID of the session that owns the subagent.

Returns:

  • (String)


62
# File 'lib/openai/models/beta/subagent.rb', line 62

required :session_id, String

#status ⇒ OpenAI::Models::Beta::Subagent::status

The current status of the subagent.

Returns:

  • (OpenAI::Models::Beta::Subagent::status)


68
# File 'lib/openai/models/beta/subagent.rb', line 68

required :status, enum: -> { OpenAI::Beta::Subagent::Status }

Instance Method Details

#to_hash ⇒ { id: String, closed_at: Integer?, instructions: ::Array[OpenAI::Models::Beta::agent_content]?, name: String?, ?object: :"agent.session.subagent", opened_at: Integer, parent_agent_id: String, session_id: String, status: OpenAI::Models::Beta::Subagent::status }

Returns:

  • ({ id: String, closed_at: Integer?, instructions: ::Array[OpenAI::Models::Beta::agent_content]?, name: String?, ?object: :"agent.session.subagent", opened_at: Integer, parent_agent_id: String, session_id: String, status: OpenAI::Models::Beta::Subagent::status })


81
82
83
84
85
86
87
88
89
90
91
# File 'sig/openai/models/beta/subagent.rbs', line 81

def to_hash: -> {
  id: String,
  closed_at: Integer?,
  instructions: ::Array[OpenAI::Models::Beta::agent_content]?,
  name: String?,
  ?object: :"agent.session.subagent",
  opened_at: Integer,
  parent_agent_id: String,
  session_id: String,
  status: OpenAI::Models::Beta::Subagent::status
}