Class: OpenAI::Models::Beta::Agents::SessionCreateParams

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

Overview

See Also:

  • OpenAI::Resources::Beta::Agents::Sessions#create
  • OpenAI::Resources::Beta::Agents::Sessions#create_streaming

Defined Under Namespace

Modules: Input, Review Classes: Agent, PromptCacheOptions, SpendControl, StreamOptions

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Attributes inherited from Internal::Type::BaseModel

#last_response

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

==, #==, #[], #_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(limit:) ⇒ SessionCreateParams

Returns a new instance of SessionCreateParams.

Parameters:

  • environment —

    An inline execution environment or a reference to an environment template.

  • agent —

    Agent configuration. With agent_id, supplied fields override the saved agent for this session. Without agent_id, model is required.

  • agent_id —

    The ID of a saved reusable agent. Omit agent to use its configuration unchanged.

  • input —

    Initial input to submit when the session is created. A string is shorthand for a single user message. Required when environment.type is none, or when stream is true for an environment that is not self_hosted; optional for self-hosted and non-streaming execution environments.

  • metadata —

    Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission or null defaults to an empty map.

  • prompt_cache_options —

    Default prompt cache lifetime for turns in this session. Omit to use the model default.

  • review —

    Action review mode. Omit to use none.

  • spend_control —

    Optional spending limit in USD cents. Omission or null creates an unlimited session.

  • stream_options —

    Options for the event stream. Only allowed when stream is true.

  • vault_ids —

    The IDs of vaults made available to the session.

  • environment: (OpenAI::Models::Beta::environment_param)
  • agent: (OpenAI::Beta::Agents::SessionCreateParams::Agent)
  • agent_id: (String)
  • input: (OpenAI::Models::Beta::Agents::SessionCreateParams::input, nil)
  • metadata: (::Hash[Symbol, String], nil)
  • prompt_cache_options: (OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions, nil)
  • review: (OpenAI::Models::Beta::Agents::SessionCreateParams::review)
  • spend_control: (OpenAI::Beta::Agents::SessionCreateParams::SpendControl, nil)
  • stream_options: (OpenAI::Beta::Agents::SessionCreateParams::StreamOptions)
  • vault_ids: (::Array[String], nil)
  • request_options: (OpenAI::request_opts)


# File 'lib/openai/models/beta/agents/session_create_params.rb', line 383

Instance Attribute Details

#agent ⇒ OpenAI::Beta::Agents::SessionCreateParams::Agent?

Agent configuration. With agent_id, supplied fields override the saved agent for this session. Without agent_id, model is required.

Returns:

  • (OpenAI::Beta::Agents::SessionCreateParams::Agent, nil)


25
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 25

optional :agent, -> { OpenAI::Beta::Agents::SessionCreateParams::Agent }

#agent_id ⇒ String?

The ID of a saved reusable agent. Omit agent to use its configuration unchanged.

Returns:

  • (String, nil)


32
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 32

optional :agent_id, String

#environment ⇒ OpenAI::Models::Beta::environment_param

An inline execution environment or a reference to an environment template.

Returns:

  • (OpenAI::Models::Beta::environment_param)


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

required :environment, union: -> { OpenAI::Beta::EnvironmentParam }

#input ⇒ OpenAI::Models::Beta::Agents::SessionCreateParams::input?

Initial input to submit when the session is created. A string is shorthand for a single user message. Required when environment.type is none, or when stream is true for an environment that is not self_hosted; optional for self-hosted and non-streaming execution environments.

Returns:

  • (OpenAI::Models::Beta::Agents::SessionCreateParams::input, nil)


41
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 41

optional :input, union: -> { OpenAI::Beta::Agents::SessionCreateParams::Input }, nil?: true

#metadata ⇒ ::Hash[Symbol, String]?

Up to 16 string key-value pairs, with keys up to 64 and values up to 512 characters. Omission or null defaults to an empty map.

Returns:

  • (::Hash[Symbol, String], nil)


48
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 48

optional :metadata, OpenAI::Internal::Type::HashOf[String], nil?: true

#prompt_cache_options ⇒ OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions?

Default prompt cache lifetime for turns in this session. Omit to use the model default.

Returns:

  • (OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions, nil)


55
56
57
58
59
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 55

optional(
  :prompt_cache_options,
  -> { OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions },
  nil?: true
)

#review ⇒ OpenAI::Models::Beta::Agents::SessionCreateParams::review?

Action review mode. Omit to use none.

Returns:

  • (OpenAI::Models::Beta::Agents::SessionCreateParams::review, nil)


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

optional :review, enum: -> { OpenAI::Beta::Agents::SessionCreateParams::Review }

#spend_control ⇒ OpenAI::Beta::Agents::SessionCreateParams::SpendControl?

Optional spending limit in USD cents. Omission or null creates an unlimited session.

Returns:

  • (OpenAI::Beta::Agents::SessionCreateParams::SpendControl, nil)


72
73
74
75
76
77
78
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 72

optional(
  :spend_control,
  -> {
    OpenAI::Beta::Agents::SessionCreateParams::SpendControl
  },
  nil?: true
)

#stream_options ⇒ OpenAI::Beta::Agents::SessionCreateParams::StreamOptions?

Options for the event stream. Only allowed when stream is true.

Returns:

  • (OpenAI::Beta::Agents::SessionCreateParams::StreamOptions, nil)


84
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 84

optional :stream_options, -> { OpenAI::Beta::Agents::SessionCreateParams::StreamOptions }

#vault_ids ⇒ ::Array[String]?

The IDs of vaults made available to the session.

Returns:

  • (::Array[String], nil)


90
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 90

optional :vault_ids, OpenAI::Internal::Type::ArrayOf[String], nil?: true

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/beta/agents/session_create_params.rb', line 309

Instance Method Details

#to_hash ⇒ { environment: OpenAI::Models::Beta::environment_param, ?agent: OpenAI::Beta::Agents::SessionCreateParams::Agent, ?agent_id: String, ?input: OpenAI::Models::Beta::Agents::SessionCreateParams::input?, ?metadata: ::Hash[Symbol, String]?, ?prompt_cache_options: OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions?, ?review: OpenAI::Models::Beta::Agents::SessionCreateParams::review, ?spend_control: OpenAI::Beta::Agents::SessionCreateParams::SpendControl?, ?stream_options: OpenAI::Beta::Agents::SessionCreateParams::StreamOptions, ?vault_ids: ::Array[String]?, ?request_options: OpenAI::RequestOptions }

Returns:

  • ({ environment: OpenAI::Models::Beta::environment_param, ?agent: OpenAI::Beta::Agents::SessionCreateParams::Agent, ?agent_id: String, ?input: OpenAI::Models::Beta::Agents::SessionCreateParams::input?, ?metadata: ::Hash[Symbol, String]?, ?prompt_cache_options: OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions?, ?review: OpenAI::Models::Beta::Agents::SessionCreateParams::review, ?spend_control: OpenAI::Beta::Agents::SessionCreateParams::SpendControl?, ?stream_options: OpenAI::Beta::Agents::SessionCreateParams::StreamOptions, ?vault_ids: ::Array[String]?, ?request_options: OpenAI::RequestOptions })


124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'sig/openai/models/beta/agents/session_create_params.rbs', line 124

def to_hash: -> {
  environment: OpenAI::Models::Beta::environment_param,
  ?agent: OpenAI::Beta::Agents::SessionCreateParams::Agent,
  ?agent_id: String,
  ?input: OpenAI::Models::Beta::Agents::SessionCreateParams::input?,
  ?metadata: ::Hash[Symbol, String]?,
  ?prompt_cache_options: OpenAI::Beta::Agents::SessionCreateParams::PromptCacheOptions?,
  ?review: OpenAI::Models::Beta::Agents::SessionCreateParams::review,
  ?spend_control: OpenAI::Beta::Agents::SessionCreateParams::SpendControl?,
  ?stream_options: OpenAI::Beta::Agents::SessionCreateParams::StreamOptions,
  ?vault_ids: ::Array[String]?,
  ?request_options: OpenAI::RequestOptions
}