Class: OpenAI::Models::Beta::AgentSession
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Beta::AgentSession
- Defined in:
- lib/openai/models/beta/agent_session.rb,
sig/openai/models/beta/agent_session.rbs
Defined Under Namespace
Modules: RequiredAction, Review, Status Classes: Agent, PromptCacheOptions, SpendControl
Instance Attribute Summary collapse
-
#agent ⇒ OpenAI::Beta::AgentSession::Agent
The agent running in the session.
-
#created_at ⇒ Integer
The Unix timestamp, in seconds, when the session was created.
-
#environment ⇒ OpenAI::Models::Beta::environment
The execution environment for the session.
-
#error ⇒ String?
The error that caused the session to fail, if any.
-
#id ⇒ String
The ID of the session.
-
#last_active_at ⇒ Integer
The Unix timestamp, in seconds, when the session was last active.
-
#metadata ⇒ ::Hash[Symbol, String]
Custom string key-value pairs attached to the session.
-
#object ⇒ :"agent.session"
The object type.
-
#prompt_cache_options ⇒ OpenAI::Beta::AgentSession::PromptCacheOptions?
Default prompt cache lifetime for turns in this session, when configured.
-
#required_actions ⇒ ::Array[OpenAI::Models::Beta::AgentSession::required_action]
Actions that must be completed before the session can continue.
-
#review ⇒ OpenAI::Models::Beta::AgentSession::review?
Review applied to eligible actions in this session.
-
#spend_control ⇒ OpenAI::Beta::AgentSession::SpendControl
Spending limit and best-effort consumption, in USD cents.
-
#status ⇒ OpenAI::Models::Beta::AgentSession::status
The current status of the session.
-
#usage ⇒ OpenAI::Beta::TokenUsage?
Best-effort token usage for the session, or null if unknown.
-
#vault_ids ⇒ ::Array[String]
The IDs of vaults made available to the session.
Attributes inherited from Internal::Type::BaseModel
Class Method Summary collapse
- .values ⇒ Array<Symbol>
- .variants ⇒ Array(OpenAI::Models::Beta::AgentSession::RequiredAction::McpApprovalRequest, OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest, OpenAI::Models::Beta::AgentSession::RequiredAction::FunctionCall, OpenAI::Models::Beta::AgentSession::RequiredAction::EnvironmentConnection)
Instance Method Summary collapse
-
#initialize(consumed:, limit:) ⇒ AgentSession
constructor
A new instance of AgentSession.
- #to_hash ⇒ { id: String, agent: OpenAI::Beta::AgentSession::Agent, created_at: Integer, environment: OpenAI::Models::Beta::environment, error: String?, last_active_at: Integer, metadata: ::Hash[Symbol, String], ?object: :"agent.session", required_actions: ::Array[OpenAI::Models::Beta::AgentSession::required_action], spend_control: OpenAI::Beta::AgentSession::SpendControl, status: OpenAI::Models::Beta::AgentSession::status, usage: OpenAI::Beta::TokenUsage?, vault_ids: ::Array[String], ?prompt_cache_options: OpenAI::Beta::AgentSession::PromptCacheOptions?, ?review: OpenAI::Models::Beta::AgentSession::review }
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(consumed:, limit:) ⇒ AgentSession
Returns a new instance of AgentSession.
|
|
# File 'lib/openai/models/beta/agent_session.rb', line 103
|
Instance Attribute Details
#agent ⇒ OpenAI::Beta::AgentSession::Agent
The agent running in the session.
17 |
# File 'lib/openai/models/beta/agent_session.rb', line 17 required :agent, -> { OpenAI::Beta::AgentSession::Agent } |
#created_at ⇒ Integer
The Unix timestamp, in seconds, when the session was created.
23 |
# File 'lib/openai/models/beta/agent_session.rb', line 23 required :created_at, Integer |
#environment ⇒ OpenAI::Models::Beta::environment
The execution environment for the session.
29 |
# File 'lib/openai/models/beta/agent_session.rb', line 29 required :environment, union: -> { OpenAI::Beta::Environment } |
#error ⇒ String?
The error that caused the session to fail, if any.
35 |
# File 'lib/openai/models/beta/agent_session.rb', line 35 required :error, String, nil?: true |
#id ⇒ String
The ID of the session.
11 |
# File 'lib/openai/models/beta/agent_session.rb', line 11 required :id, String |
#last_active_at ⇒ Integer
The Unix timestamp, in seconds, when the session was last active.
41 |
# File 'lib/openai/models/beta/agent_session.rb', line 41 required :last_active_at, Integer |
#metadata ⇒ ::Hash[Symbol, String]
Custom string key-value pairs attached to the session.
47 |
# File 'lib/openai/models/beta/agent_session.rb', line 47 required :metadata, OpenAI::Internal::Type::HashOf[String] |
#object ⇒ :"agent.session"
The object type. Always agent.session.
53 |
# File 'lib/openai/models/beta/agent_session.rb', line 53 required :object, const: :"agent.session" |
#prompt_cache_options ⇒ OpenAI::Beta::AgentSession::PromptCacheOptions?
Default prompt cache lifetime for turns in this session, when configured.
94 |
# File 'lib/openai/models/beta/agent_session.rb', line 94 optional :prompt_cache_options, -> { OpenAI::Beta::AgentSession::PromptCacheOptions }, nil?: true |
#required_actions ⇒ ::Array[OpenAI::Models::Beta::AgentSession::required_action]
Actions that must be completed before the session can continue.
59 60 61 62 |
# File 'lib/openai/models/beta/agent_session.rb', line 59 required( :required_actions, -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AgentSession::RequiredAction] } ) |
#review ⇒ OpenAI::Models::Beta::AgentSession::review?
Review applied to eligible actions in this session. Omitted when review is none and automatic review is not enabled. Omission means none.
101 |
# File 'lib/openai/models/beta/agent_session.rb', line 101 optional :review, enum: -> { OpenAI::Beta::AgentSession::Review } |
#spend_control ⇒ OpenAI::Beta::AgentSession::SpendControl
Spending limit and best-effort consumption, in USD cents. The limit is null for an unlimited session. Consumption is null when unavailable.
69 |
# File 'lib/openai/models/beta/agent_session.rb', line 69 required :spend_control, -> { OpenAI::Beta::AgentSession::SpendControl } |
#status ⇒ OpenAI::Models::Beta::AgentSession::status
The current status of the session.
75 |
# File 'lib/openai/models/beta/agent_session.rb', line 75 required :status, enum: -> { OpenAI::Beta::AgentSession::Status } |
#usage ⇒ OpenAI::Beta::TokenUsage?
Best-effort token usage for the session, or null if unknown. Recorded usage may change.
82 |
# File 'lib/openai/models/beta/agent_session.rb', line 82 required :usage, -> { OpenAI::Beta::TokenUsage }, nil?: true |
#vault_ids ⇒ ::Array[String]
The IDs of vaults made available to the session.
88 |
# File 'lib/openai/models/beta/agent_session.rb', line 88 required :vault_ids, OpenAI::Internal::Type::ArrayOf[String] |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/openai/models/beta/agent_session.rb', line 780
|
.variants ⇒ Array(OpenAI::Models::Beta::AgentSession::RequiredAction::McpApprovalRequest, OpenAI::Models::Beta::AgentSession::RequiredAction::ComputerUseApprovalRequest, OpenAI::Models::Beta::AgentSession::RequiredAction::FunctionCall, OpenAI::Models::Beta::AgentSession::RequiredAction::EnvironmentConnection)
|
|
# File 'lib/openai/models/beta/agent_session.rb', line 730
|
Instance Method Details
#to_hash ⇒ { id: String, agent: OpenAI::Beta::AgentSession::Agent, created_at: Integer, environment: OpenAI::Models::Beta::environment, error: String?, last_active_at: Integer, metadata: ::Hash[Symbol, String], ?object: :"agent.session", required_actions: ::Array[OpenAI::Models::Beta::AgentSession::required_action], spend_control: OpenAI::Beta::AgentSession::SpendControl, status: OpenAI::Models::Beta::AgentSession::status, usage: OpenAI::Beta::TokenUsage?, vault_ids: ::Array[String], ?prompt_cache_options: OpenAI::Beta::AgentSession::PromptCacheOptions?, ?review: OpenAI::Models::Beta::AgentSession::review }
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'sig/openai/models/beta/agent_session.rbs', line 129
def to_hash: -> {
id: String,
agent: OpenAI::Beta::AgentSession::Agent,
created_at: Integer,
environment: OpenAI::Models::Beta::environment,
error: String?,
last_active_at: Integer,
metadata: ::Hash[Symbol, String],
?object: :"agent.session",
required_actions: ::Array[OpenAI::Models::Beta::AgentSession::required_action],
spend_control: OpenAI::Beta::AgentSession::SpendControl,
status: OpenAI::Models::Beta::AgentSession::status,
usage: OpenAI::Beta::TokenUsage?,
vault_ids: ::Array[String],
?prompt_cache_options: OpenAI::Beta::AgentSession::PromptCacheOptions?,
?review: OpenAI::Models::Beta::AgentSession::review
}
|