Class: Anthropic::Models::Beta::SessionCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/anthropic/models/beta/session_create_params.rb,
sig/anthropic/models/beta/session_create_params.rbs

Overview

See Also:

  • Anthropic::Resources::Beta::Sessions#create

Defined Under Namespace

Modules: Agent, InitialEvent, Resource

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #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(agent:, environment_id:, budget: nil, initial_events: nil, metadata: nil, resources: nil, title: nil, vault_ids: nil, betas: nil, workspace_id: nil, request_options: {}) ⇒ SessionCreateParams

Some parameter documentations has been truncated, see Anthropic::Models::Beta::SessionCreateParams for more details.

Parameters:



# File 'lib/anthropic/models/beta/session_create_params.rb', line 85

Instance Attribute Details

#agent ⇒ Anthropic::Models::Beta::BetaManagedAgentsAgentParams, ...

Agent identifier. Accepts the agent ID string, which pins the latest version for the session, or an agent object with both id and version specified.

Parameters:

  • value (Anthropic::Models::Beta::SessionCreateParams::agent)

Returns:



16
# File 'lib/anthropic/models/beta/session_create_params.rb', line 16

required :agent, union: -> { Anthropic::Beta::SessionCreateParams::Agent }

#betas ⇒ Array<Symbol, String, Anthropic::Models::AnthropicBeta>?

This endpoint is in beta: requests must send managed-agents-2026-04-01 in this header.

Parameters:

  • (::Array[Anthropic::Models::anthropic_beta])

Returns:



72
# File 'lib/anthropic/models/beta/session_create_params.rb', line 72

optional :betas, -> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::AnthropicBeta] }

#budget ⇒ Anthropic::Models::Beta::BetaManagedAgentsBudgetLimit?

Enforced spend ceiling for the session. Omit to create an uncapped session. Every model the session can run — the agent's model and each callable agent's model — must have a public list price, or the request is rejected with reason model_not_budgetable.

Parameters:

  • (Anthropic::Beta::BetaManagedAgentsBudgetLimit)

Returns:



31
# File 'lib/anthropic/models/beta/session_create_params.rb', line 31

optional :budget, -> { Anthropic::Beta::BetaManagedAgentsBudgetLimit }

#environment_id ⇒ String

ID of the environment defining the container configuration for this session.

Parameters:

  • value (String)

Returns:

  • (String)


22
# File 'lib/anthropic/models/beta/session_create_params.rb', line 22

required :environment_id, String

#initial_events ⇒ Array<Anthropic::Models::Beta::Sessions::BetaManagedAgentsUserMessageEventParams, Anthropic::Models::Beta::Sessions::BetaManagedAgentsUserDefineOutcomeEventParams>?

Initial events to send to the session at creation, processed in order. Supports user.message and user.define_outcome events. Maximum 50 events.

Parameters:

  • (::Array[Anthropic::Models::Beta::SessionCreateParams::initial_event])

Returns:



38
39
# File 'lib/anthropic/models/beta/session_create_params.rb', line 38

optional :initial_events,
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::SessionCreateParams::InitialEvent] }

#metadata ⇒ Hash{Symbol=>String}?

Arbitrary key-value metadata attached to the session. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


46
# File 'lib/anthropic/models/beta/session_create_params.rb', line 46

optional :metadata, Anthropic::Internal::Type::HashOf[String]

#resources ⇒ Array<Anthropic::Models::Beta::BetaManagedAgentsGitHubRepositoryResourceParams, Anthropic::Models::Beta::BetaManagedAgentsFileResourceParams, Anthropic::Models::Beta::BetaManagedAgentsMemoryStoreResourceParam>?

Resources (e.g. repositories, files) to mount into the session's container.



52
53
# File 'lib/anthropic/models/beta/session_create_params.rb', line 52

optional :resources,
-> { Anthropic::Internal::Type::ArrayOf[union: Anthropic::Beta::SessionCreateParams::Resource] }

#title ⇒ String?

Human-readable session title.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


59
# File 'lib/anthropic/models/beta/session_create_params.rb', line 59

optional :title, String, nil?: true

#vault_ids ⇒ Array<String>?

Vault IDs for stored credentials the agent can use during the session.

Parameters:

  • (::Array[String])

Returns:

  • (Array<String>, nil)


65
# File 'lib/anthropic/models/beta/session_create_params.rb', line 65

optional :vault_ids, Anthropic::Internal::Type::ArrayOf[String]

#workspace_id ⇒ String?

Optional header to select the Workspace for this request. The value is a Workspace ID (for example, wrkspc_011CZkZaBF1tNoB5wlCeusgy).

Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

Parameters:

  • (String)

Returns:

  • (String, nil)


83
# File 'lib/anthropic/models/beta/session_create_params.rb', line 83

optional :workspace_id, String

Class Method Details

.variants ⇒ Array(Anthropic::Models::Beta::BetaManagedAgentsAgentParams, Anthropic::Models::Beta::BetaManagedAgentsAgentWithOverridesParams, String)



# File 'lib/anthropic/models/beta/session_create_params.rb', line 124

Instance Method Details

#to_hash ⇒ { agent: Anthropic::Models::Beta::SessionCreateParams::agent, environment_id: String, budget: Anthropic::Beta::BetaManagedAgentsBudgetLimit, initial_events: ::Array[Anthropic::Models::Beta::SessionCreateParams::initial_event], metadata: ::Hash[Symbol, String], resources: ::Array[Anthropic::Models::Beta::SessionCreateParams::resource], title: String?, vault_ids: ::Array[String], betas: ::Array[Anthropic::Models::anthropic_beta], workspace_id: String, request_options: Anthropic::RequestOptions }

Returns:

  • ({ agent: Anthropic::Models::Beta::SessionCreateParams::agent, environment_id: String, budget: Anthropic::Beta::BetaManagedAgentsBudgetLimit, initial_events: ::Array[Anthropic::Models::Beta::SessionCreateParams::initial_event], metadata: ::Hash[Symbol, String], resources: ::Array[Anthropic::Models::Beta::SessionCreateParams::resource], title: String?, vault_ids: ::Array[String], betas: ::Array[Anthropic::Models::anthropic_beta], workspace_id: String, request_options: Anthropic::RequestOptions })


79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'sig/anthropic/models/beta/session_create_params.rbs', line 79

def to_hash: -> {
  agent: Anthropic::Models::Beta::SessionCreateParams::agent,
  environment_id: String,
  budget: Anthropic::Beta::BetaManagedAgentsBudgetLimit,
  initial_events: ::Array[Anthropic::Models::Beta::SessionCreateParams::initial_event],
  metadata: ::Hash[Symbol, String],
  resources: ::Array[Anthropic::Models::Beta::SessionCreateParams::resource],
  title: String?,
  vault_ids: ::Array[String],
  betas: ::Array[Anthropic::Models::anthropic_beta],
  workspace_id: String,
  request_options: Anthropic::RequestOptions
}