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

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

Defined Under Namespace

Modules: ServiceTier Classes: Compaction, Experimental

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(time_awareness: nil) ⇒ Agent

Returns a new instance of Agent.

Parameters:

  • compaction —

    Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object uses blocking compaction.

  • experimental —

    Experimental settings to merge by key. Omitted settings keep their current values.

  • instructions —

    Additional instructions appended to the agent's default base instructions. Omit to leave unchanged.

  • model —

    The model to use for the agent. The requested model name is preserved.

  • multi_agent —

    Configuration for creating and coordinating subagents.

  • reasoning —

    Configuration for model reasoning. Omit to keep the current settings; pass null to reset to the model's default effort.

  • service_tier —

    The service tier used for model requests.

  • text —

    Configuration for text generated by the agent.

  • tools —

    Tools available to the agent. Omit to inherit, or pass null to clear them. The resolved tool list must fit within 8 MiB (8,388,608 bytes) of compact UTF-8 JSON.

  • compaction: (OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction, nil)
  • experimental: (OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental)
  • instructions: (String, nil)
  • model: (String)
  • multi_agent: (OpenAI::Beta::MultiAgentConfigParam, nil)
  • reasoning: (OpenAI::Beta::AgentReasoningParam, nil)
  • service_tier: (OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::service_tier, nil)
  • text: (OpenAI::Beta::AgentTextParam, nil)
  • tools: (::Array[OpenAI::Models::Beta::agent_tool_param], nil)


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 133

class Agent < OpenAI::Internal::Type::BaseModel
  # @!attribute compaction
  #   Context compaction settings. Omit to keep the current settings. A supplied
  #   object replaces the settings; null or an empty object uses blocking compaction.
  #
  #   @return [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
  optional(
    :compaction,
    -> {
      OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction
    },
    nil?: true
  )

  # @!attribute experimental
  #   Experimental settings to merge by key. Omitted settings keep their current
  #   values.
  #
  #   @return [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Experimental, nil]
  optional :experimental, -> { OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental }

  # @!attribute instructions
  #   Additional instructions appended to the agent's default base instructions. Omit
  #   to leave unchanged.
  #
  #   @return [String, nil]
  optional :instructions, String, nil?: true

  # @!attribute model
  #   The model to use for the agent. The requested model name is preserved.
  #
  #   @return [String, nil]
  optional :model, String

  # @!attribute multi_agent
  #   Configuration for creating and coordinating subagents.
  #
  #   @return [OpenAI::Models::Beta::MultiAgentConfigParam, nil]
  optional :multi_agent, -> { OpenAI::Beta::MultiAgentConfigParam }, nil?: true

  # @!attribute reasoning
  #   Configuration for model reasoning. Omit to keep the current settings; pass
  #   `null` to reset to the model's default effort.
  #
  #   @return [OpenAI::Models::Beta::AgentReasoningParam, nil]
  optional :reasoning, -> { OpenAI::Beta::AgentReasoningParam }, nil?: true

  # @!attribute service_tier
  #   The service tier used for model requests.
  #
  #   @return [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::ServiceTier, nil]
  optional(
    :service_tier,
    enum: -> { OpenAI::Beta::Agents::SessionCreateParams::Agent::ServiceTier },
    nil?: true
  )

  # @!attribute text
  #   Configuration for text generated by the agent.
  #
  #   @return [OpenAI::Models::Beta::AgentTextParam, nil]
  optional :text, -> { OpenAI::Beta::AgentTextParam }, nil?: true

  # @!attribute tools
  #   Tools available to the agent. Omit to inherit, or pass null to clear them. The
  #   resolved tool list must fit within 8 MiB (8,388,608 bytes) of compact UTF-8
  #   JSON.
  #
  #   @return [Array<OpenAI::Models::Beta::AgentToolParam::Function, OpenAI::Models::Beta::AgentToolParam::ToolSearch, OpenAI::Models::Beta::AgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::AgentToolParam::Mcp, OpenAI::Models::Beta::AgentToolParam::WebSearch, OpenAI::Models::Beta::AgentToolParam::ComputerUse, OpenAI::Models::Beta::AgentToolParam::Automations>, nil]
  optional(
    :tools,
    -> {
      OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AgentToolParam]
    },
    nil?: true
  )

  # @!method initialize(compaction: nil, experimental: nil, instructions: nil, model: nil, multi_agent: nil, reasoning: nil, service_tier: nil, text: nil, tools: nil)
  #   Agent configuration. With `agent_id`, supplied fields override the saved agent
  #   for this session. Without `agent_id`, `model` is required.
  #
  #   @param compaction [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Compaction, nil]
  #     Context compaction settings. Omit to keep the current settings. A supplied
  #     object replaces the settings; null or an empty object uses blocking compaction.
  #
  #   @param experimental [OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::Experimental]
  #     Experimental settings to merge by key. Omitted settings keep their current
  #     values.
  #
  #   @param instructions [String, nil]
  #     Additional instructions appended to the agent's default base instructions. Omit
  #     to leave unchanged.
  #
  #   @param model [String]
  #     The model to use for the agent. The requested model name is preserved.
  #
  #   @param multi_agent [OpenAI::Models::Beta::MultiAgentConfigParam, nil]
  #     Configuration for creating and coordinating subagents.
  #
  #   @param reasoning [OpenAI::Models::Beta::AgentReasoningParam, nil]
  #     Configuration for model reasoning. Omit to keep the current settings; pass
  #     `null` to reset to the model's default effort.
  #
  #   @param service_tier [Symbol, OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::ServiceTier, nil]
  #     The service tier used for model requests.
  #
  #   @param text [OpenAI::Models::Beta::AgentTextParam, nil]
  #     Configuration for text generated by the agent.
  #
  #   @param tools [Array<OpenAI::Models::Beta::AgentToolParam::Function, OpenAI::Models::Beta::AgentToolParam::ToolSearch, OpenAI::Models::Beta::AgentToolParam::ProgrammaticToolCalling, OpenAI::Models::Beta::AgentToolParam::Mcp, OpenAI::Models::Beta::AgentToolParam::WebSearch, OpenAI::Models::Beta::AgentToolParam::ComputerUse, OpenAI::Models::Beta::AgentToolParam::Automations>, nil]
  #     Tools available to the agent. Omit to inherit, or pass null to clear them. The
  #     resolved tool list must fit within 8 MiB (8,388,608 bytes) of compact UTF-8
  #     JSON.

  # @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#compaction
  class Compaction < OpenAI::Internal::Type::BaseModel
    # @!attribute async
    #   Whether to compact context in the background. Omission or null defaults to
    #   false. Set to true to enable background compaction. Background compaction may
    #   increase token usage.
    #
    #   @return [Boolean, nil]
    optional :async, OpenAI::Internal::Type::Boolean, nil?: true

    # @!method initialize(async: nil)
    #   Context compaction settings. Omit to keep the current settings. A supplied
    #   object replaces the settings; null or an empty object uses blocking compaction.
    #
    #   @param async [Boolean, nil]
    #     Whether to compact context in the background. Omission or null defaults to
    #     false. Set to true to enable background compaction. Background compaction may
    #     increase token usage.
  end

  # @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#experimental
  class Experimental < OpenAI::Internal::Type::BaseModel
    # @!attribute time_awareness
    #   Whether to give the model periodic current-time reminders. Omit to keep the
    #   current setting.
    #
    #   @return [Boolean, nil]
    optional :time_awareness, OpenAI::Internal::Type::Boolean

    # @!method initialize(time_awareness: nil)
    #   Experimental settings to merge by key. Omitted settings keep their current
    #   values.
    #
    #   @param time_awareness [Boolean]
    #     Whether to give the model periodic current-time reminders. Omit to keep the
    #     current setting.
  end

  # The service tier used for model requests.
  #
  # @see OpenAI::Models::Beta::Agents::SessionCreateParams::Agent#service_tier
  module ServiceTier
    extend OpenAI::Internal::Type::Enum

    # Selects the service tier automatically.
    AUTO = :auto

    # Uses the default service tier.
    DEFAULT = :default

    # Uses the flex service tier.
    FLEX = :flex

    # Uses the priority service tier.
    PRIORITY = :priority

    # Uses the fast service tier.
    FAST = :fast

    # Uses the ultrafast service tier.
    ULTRAFAST = :ultrafast

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#compaction ⇒ OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction?

Context compaction settings. Omit to keep the current settings. A supplied object replaces the settings; null or an empty object uses blocking compaction.

Returns:

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


139
140
141
142
143
144
145
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 139

optional(
  :compaction,
  -> {
    OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction
  },
  nil?: true
)

#experimental ⇒ OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental?

Experimental settings to merge by key. Omitted settings keep their current values.

Returns:

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


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

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

#instructions ⇒ String?

Additional instructions appended to the agent's default base instructions. Omit to leave unchanged.

Returns:

  • (String, nil)


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

optional :instructions, String, nil?: true

#model ⇒ String?

The model to use for the agent. The requested model name is preserved.

Returns:

  • (String, nil)


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

optional :model, String

#multi_agent ⇒ OpenAI::Beta::MultiAgentConfigParam?

Configuration for creating and coordinating subagents.

Returns:

  • (OpenAI::Beta::MultiAgentConfigParam, nil)


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

optional :multi_agent, -> { OpenAI::Beta::MultiAgentConfigParam }, nil?: true

#reasoning ⇒ OpenAI::Beta::AgentReasoningParam?

Configuration for model reasoning. Omit to keep the current settings; pass null to reset to the model's default effort.

Returns:

  • (OpenAI::Beta::AgentReasoningParam, nil)


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

optional :reasoning, -> { OpenAI::Beta::AgentReasoningParam }, nil?: true

#service_tier ⇒ OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::service_tier?

The service tier used for model requests.

Returns:

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


184
185
186
187
188
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 184

optional(
  :service_tier,
  enum: -> { OpenAI::Beta::Agents::SessionCreateParams::Agent::ServiceTier },
  nil?: true
)

#text ⇒ OpenAI::Beta::AgentTextParam?

Configuration for text generated by the agent.

Returns:

  • (OpenAI::Beta::AgentTextParam, nil)


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

optional :text, -> { OpenAI::Beta::AgentTextParam }, nil?: true

#tools ⇒ ::Array[OpenAI::Models::Beta::agent_tool_param]?

Tools available to the agent. Omit to inherit, or pass null to clear them. The resolved tool list must fit within 8 MiB (8,388,608 bytes) of compact UTF-8 JSON.

Returns:

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


202
203
204
205
206
207
208
# File 'lib/openai/models/beta/agents/session_create_params.rb', line 202

optional(
  :tools,
  -> {
    OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::AgentToolParam]
  },
  nil?: true
)

Instance Method Details

#to_hash ⇒ { ?compaction: OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction?, ?experimental: OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental, ?instructions: String?, ?model: String, ?multi_agent: OpenAI::Beta::MultiAgentConfigParam?, ?reasoning: OpenAI::Beta::AgentReasoningParam?, ?service_tier: OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::service_tier?, ?text: OpenAI::Beta::AgentTextParam?, ?tools: ::Array[OpenAI::Models::Beta::agent_tool_param]? }

Returns:

  • ({ ?compaction: OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction?, ?experimental: OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental, ?instructions: String?, ?model: String, ?multi_agent: OpenAI::Beta::MultiAgentConfigParam?, ?reasoning: OpenAI::Beta::AgentReasoningParam?, ?service_tier: OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::service_tier?, ?text: OpenAI::Beta::AgentTextParam?, ?tools: ::Array[OpenAI::Models::Beta::agent_tool_param]? })


230
231
232
233
234
235
236
237
238
239
240
# File 'sig/openai/models/beta/agents/session_create_params.rbs', line 230

def to_hash: -> {
  ?compaction: OpenAI::Beta::Agents::SessionCreateParams::Agent::Compaction?,
  ?experimental: OpenAI::Beta::Agents::SessionCreateParams::Agent::Experimental,
  ?instructions: String?,
  ?model: String,
  ?multi_agent: OpenAI::Beta::MultiAgentConfigParam?,
  ?reasoning: OpenAI::Beta::AgentReasoningParam?,
  ?service_tier: OpenAI::Models::Beta::Agents::SessionCreateParams::Agent::service_tier?,
  ?text: OpenAI::Beta::AgentTextParam?,
  ?tools: ::Array[OpenAI::Models::Beta::agent_tool_param]?
}