openai 0.101.0 → 0.102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/audio/speech_create_params.rb +3 -6
  5. data/lib/openai/models/audio/voice.rb +4 -9
  6. data/lib/openai/models/audio/voice_create_params.rb +3 -100
  7. data/lib/openai/models/beta/agents/environment_create_params.rb +300 -0
  8. data/lib/openai/models/beta/agents/environment_info.rb +4 -1
  9. data/lib/openai/models/beta/agents/environment_list_params.rb +78 -0
  10. data/lib/openai/models/beta/environment_param.rb +12 -1
  11. data/lib/openai/models/chat/chat_completion_audio_param.rb +3 -3
  12. data/lib/openai/models/realtime/realtime_audio_config_output.rb +3 -6
  13. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +3 -6
  14. data/lib/openai/models/webhooks/agent_environment_failed_webhook_event.rb +73 -0
  15. data/lib/openai/models/webhooks/agent_environment_ready_webhook_event.rb +73 -0
  16. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -3
  17. data/lib/openai/models/webhooks/webhook_create_params.rb +2 -0
  18. data/lib/openai/models/webhooks/webhook_test_params.rb +2 -0
  19. data/lib/openai/models/webhooks/webhook_update_params.rb +2 -0
  20. data/lib/openai/resources/audio/speech.rb +1 -2
  21. data/lib/openai/resources/audio/voices.rb +10 -10
  22. data/lib/openai/resources/beta/agents/environments/files.rb +4 -2
  23. data/lib/openai/resources/beta/agents/environments/templates.rb +10 -5
  24. data/lib/openai/resources/beta/agents/environments.rb +80 -1
  25. data/lib/openai/resources/beta/agents/sessions/artifacts.rb +8 -5
  26. data/lib/openai/resources/beta/agents/sessions/events.rb +10 -4
  27. data/lib/openai/resources/beta/agents/sessions/items.rb +2 -1
  28. data/lib/openai/resources/beta/agents/sessions/subagents/items.rb +2 -1
  29. data/lib/openai/resources/beta/agents/sessions/subagents/turns/items.rb +2 -1
  30. data/lib/openai/resources/beta/agents/sessions/subagents/turns.rb +4 -2
  31. data/lib/openai/resources/beta/agents/sessions/subagents.rb +4 -2
  32. data/lib/openai/resources/beta/agents/sessions/traces.rb +2 -1
  33. data/lib/openai/resources/beta/agents/sessions/turns/items.rb +2 -1
  34. data/lib/openai/resources/beta/agents/sessions/turns.rb +4 -2
  35. data/lib/openai/resources/beta/agents/sessions.rb +16 -7
  36. data/lib/openai/resources/beta/agents/vaults/credentials.rb +10 -5
  37. data/lib/openai/resources/beta/agents/vaults.rb +8 -4
  38. data/lib/openai/resources/beta/agents.rb +10 -5
  39. data/lib/openai/resources/beta/assistants.rb +10 -5
  40. data/lib/openai/resources/beta/chatkit/sessions.rb +4 -2
  41. data/lib/openai/resources/beta/chatkit/threads.rb +8 -4
  42. data/lib/openai/resources/beta/threads/messages.rb +10 -5
  43. data/lib/openai/resources/beta/threads/runs/steps.rb +4 -2
  44. data/lib/openai/resources/beta/threads/runs.rb +24 -10
  45. data/lib/openai/resources/beta/threads.rb +16 -7
  46. data/lib/openai/resources/vector_stores/file_batches.rb +8 -10
  47. data/lib/openai/resources/vector_stores/files.rb +12 -12
  48. data/lib/openai/resources/vector_stores.rb +12 -6
  49. data/lib/openai/resources/webhooks.rb +1 -1
  50. data/lib/openai/version.rb +1 -1
  51. data/lib/openai.rb +4 -0
  52. data/rbi/openai/models/audio/speech_create_params.rbi +3 -6
  53. data/rbi/openai/models/audio/voice.rbi +4 -9
  54. data/rbi/openai/models/audio/voice_create_params.rbi +4 -149
  55. data/rbi/openai/models/beta/agents/environment_create_params.rbi +499 -0
  56. data/rbi/openai/models/beta/agents/environment_info.rbi +3 -0
  57. data/rbi/openai/models/beta/agents/environment_list_params.rbi +136 -0
  58. data/rbi/openai/models/beta/environment_param.rbi +15 -0
  59. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +3 -3
  60. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +3 -6
  61. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +3 -6
  62. data/rbi/openai/models/webhooks/agent_environment_failed_webhook_event.rbi +134 -0
  63. data/rbi/openai/models/webhooks/agent_environment_ready_webhook_event.rbi +134 -0
  64. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +4 -2
  65. data/rbi/openai/models/webhooks/webhook_create_params.rbi +8 -0
  66. data/rbi/openai/models/webhooks/webhook_test_params.rbi +8 -0
  67. data/rbi/openai/models/webhooks/webhook_update_params.rbi +8 -0
  68. data/rbi/openai/resources/audio/speech.rbi +1 -2
  69. data/rbi/openai/resources/audio/voices.rbi +10 -13
  70. data/rbi/openai/resources/beta/agents/environments.rbi +53 -0
  71. data/rbi/openai/resources/webhooks.rbi +2 -0
  72. data/sig/openai/models/audio/speech_create_params.rbs +2 -4
  73. data/sig/openai/models/audio/voice.rbs +3 -6
  74. data/sig/openai/models/audio/voice_create_params.rbs +1 -90
  75. data/sig/openai/models/beta/agents/environment_create_params.rbs +268 -0
  76. data/sig/openai/models/beta/agents/environment_info.rbs +5 -1
  77. data/sig/openai/models/beta/agents/environment_list_params.rbs +97 -0
  78. data/sig/openai/models/beta/environment_param.rbs +14 -0
  79. data/sig/openai/models/chat/chat_completion_audio_param.rbs +2 -2
  80. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +3 -6
  81. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +3 -6
  82. data/sig/openai/models/webhooks/agent_environment_failed_webhook_event.rbs +70 -0
  83. data/sig/openai/models/webhooks/agent_environment_ready_webhook_event.rbs +70 -0
  84. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +3 -1
  85. data/sig/openai/models/webhooks/webhook_create_params.rbs +4 -0
  86. data/sig/openai/models/webhooks/webhook_test_params.rbs +4 -0
  87. data/sig/openai/models/webhooks/webhook_update_params.rbs +4 -0
  88. data/sig/openai/resources/beta/agents/environments.rbs +15 -0
  89. data/sig/openai/resources/webhooks.rbs +3 -1
  90. metadata +13 -1
@@ -15,6 +15,34 @@ module OpenAI
15
15
  sig { returns(OpenAI::Resources::Beta::Agents::Environments::Templates) }
16
16
  attr_reader :templates
17
17
 
18
+ # Creates an OpenAI-hosted environment before creating a session. Requires access
19
+ # to the prewarming beta.
20
+ sig {
21
+ params(
22
+ environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::OrHash,
23
+ vault_ids: T.nilable(T::Array[String]),
24
+ idempotency_key: String,
25
+ request_options: OpenAI::RequestOptions::OrHash
26
+ )
27
+ .returns(OpenAI::Beta::Agents::EnvironmentInfo)
28
+ }
29
+ def create(
30
+ # Body param: The required hosting type and its configuration.
31
+ environment:,
32
+ # Body param: The IDs of up to 10 vaults made available to an OpenAI-hosted
33
+ # environment.
34
+ vault_ids: nil,
35
+ # Header param: Deduplicates creation for 24 hours within the authenticated
36
+ # organization, project, and creator. Retry the same JSON parameters with the same
37
+ # key to retrieve the original environment in its current state. Different
38
+ # parameters or an incomplete hosted creation return 409. Deleted environments are
39
+ # not recreated. After retention expires, the key may create a new environment.
40
+ # Without this header, each request creates a new environment.
41
+ idempotency_key: nil,
42
+ request_options: {}
43
+ )
44
+ end
45
+
18
46
  # Retrieves an execution environment's connection status and safe installed
19
47
  # metadata. See
20
48
  # [environment lifecycle](https://developers.openai.com/api/docs/guides/agents-api/environments/lifecycle).
@@ -30,6 +58,31 @@ module OpenAI
30
58
  )
31
59
  end
32
60
 
61
+ # Lists OpenAI-hosted environments owned by the authenticated principal. Requires
62
+ # access to the prewarming beta.
63
+ sig {
64
+ params(
65
+ after: String,
66
+ limit: Integer,
67
+ order: OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol,
68
+ type: OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol,
69
+ request_options: OpenAI::RequestOptions::OrHash
70
+ )
71
+ .returns(OpenAI::Internal::CursorPage[OpenAI::Beta::Agents::EnvironmentInfo])
72
+ }
73
+ def list(
74
+ # Return environments after this environment ID in the selected order.
75
+ after: nil,
76
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
77
+ limit: nil,
78
+ # The order in which environments are returned. Defaults to `desc`.
79
+ order: nil,
80
+ # The hosting type to list. Defaults to `openai_hosted`.
81
+ type: nil,
82
+ request_options: {}
83
+ )
84
+ end
85
+
33
86
  # @api private
34
87
  sig { params(client: OpenAI::Client).returns(T.attached_class) }
35
88
  def self.new(client:)
@@ -140,6 +140,8 @@ module OpenAI
140
140
  )
141
141
  .returns(
142
142
  T.any(
143
+ OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
144
+ OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
143
145
  OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
144
146
  OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
145
147
  OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
@@ -31,8 +31,7 @@ module OpenAI
31
31
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
32
32
  # voices are available in the
33
33
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
34
- # Custom voices must be created from audio samples. Voices created from text
35
- # prompts are supported only in Live.
34
+ # Custom voices must be created from audio samples.
36
35
  attr_accessor voice: OpenAI::Models::Audio::SpeechCreateParams::voice
37
36
 
38
37
  # Control the voice of your generated audio with additional instructions. Does not
@@ -84,8 +83,7 @@ module OpenAI
84
83
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
85
84
  # voices are available in the
86
85
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
87
- # Custom voices must be created from audio samples. Voices created from text
88
- # prompts are supported only in Live.
86
+ # Custom voices must be created from audio samples.
89
87
  # @param instructions
90
88
  # Control the voice of your generated audio with additional instructions. Does not
91
89
  # work with `tts-1` or `tts-1-hd`.
@@ -23,8 +23,7 @@ module OpenAI
23
23
  # The object type, which is always `audio.voice`.
24
24
  attr_accessor object: :"audio.voice"
25
25
 
26
- # How the voice was created. Voices created from text prompts are supported only
27
- # in Live.
26
+ # How the voice was created.
28
27
  attr_accessor type: OpenAI::Models::Audio::Voice::type_
29
28
 
30
29
  # @param id
@@ -34,8 +33,7 @@ module OpenAI
34
33
  # @param name
35
34
  # The name of the voice.
36
35
  # @param type
37
- # How the voice was created. Voices created from text prompts are supported only
38
- # in Live.
36
+ # How the voice was created.
39
37
  # @param object
40
38
  # The object type, which is always `audio.voice`.
41
39
  def initialize: (
@@ -54,13 +52,12 @@ module OpenAI
54
52
  type: OpenAI::Models::Audio::Voice::type_
55
53
  }
56
54
 
57
- type type_ = :audio_sample | :prompt
55
+ type type_ = :audio_sample
58
56
 
59
57
  module Type
60
58
  extend OpenAI::Internal::Type::Enum
61
59
 
62
60
  AUDIO_SAMPLE: :audio_sample
63
- PROMPT: :prompt
64
61
 
65
62
  def self?.values: -> ::Array[OpenAI::Models::Audio::Voice::type_]
66
63
  end
@@ -28,9 +28,7 @@ module OpenAI
28
28
  ?request_options: OpenAI::RequestOptions
29
29
  }
30
30
 
31
- type body =
32
- OpenAI::Audio::VoiceCreateParams::Body::AudioSample
33
- | OpenAI::Audio::VoiceCreateParams::Body::Prompt
31
+ type body = OpenAI::Audio::VoiceCreateParams::Body::AudioSample
34
32
 
35
33
  module Body
36
34
  extend OpenAI::Internal::Type::Union
@@ -108,93 +106,6 @@ module OpenAI
108
106
  end
109
107
  end
110
108
 
111
- type prompt =
112
- {
113
- name: String,
114
- prompt: String,
115
- type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
116
- ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
117
- ?script_hint: String
118
- }
119
-
120
- class Prompt < OpenAI::Internal::Type::BaseModel
121
- # The name of the new voice.
122
- attr_accessor name: String
123
-
124
- # A description of the desired voice. Must not contain only whitespace.
125
- attr_accessor prompt: String
126
-
127
- # Set to `prompt` to create a voice from a text description.
128
- attr_accessor type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_
129
-
130
- # The voice creation model to use. Defaults to `auto`.
131
- attr_reader model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model?
132
-
133
- # The voice creation model to use. Defaults to `auto`.
134
- def model=: (
135
- OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model
136
- ) -> OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model
137
-
138
- # Optional text for the voice to speak during creation. If omitted, a script is
139
- # generated from the prompt. Must not be blank after trimming whitespace; scripts
140
- # that are too short are rejected.
141
- attr_reader script_hint: String?
142
-
143
- # Optional text for the voice to speak during creation. If omitted, a script is
144
- # generated from the prompt. Must not be blank after trimming whitespace; scripts
145
- # that are too short are rejected.
146
- def script_hint=: (String) -> String
147
-
148
- # @param name
149
- # The name of the new voice.
150
- # @param prompt
151
- # A description of the desired voice. Must not contain only whitespace.
152
- # @param type
153
- # Set to `prompt` to create a voice from a text description.
154
- # @param model
155
- # The voice creation model to use. Defaults to `auto`.
156
- # @param script_hint
157
- # Optional text for the voice to speak during creation. If omitted, a script is
158
- # generated from the prompt. Must not be blank after trimming whitespace; scripts
159
- # that are too short are rejected.
160
- def initialize: (
161
- name: String,
162
- prompt: String,
163
- type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
164
- ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
165
- ?script_hint: String
166
- ) -> void
167
-
168
- def to_hash: -> {
169
- name: String,
170
- prompt: String,
171
- type: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_,
172
- ?model: OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model,
173
- ?script_hint: String
174
- }
175
-
176
- type type_ = :prompt
177
-
178
- module Type
179
- extend OpenAI::Internal::Type::Enum
180
-
181
- PROMPT: :prompt
182
-
183
- def self?.values: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::type_]
184
- end
185
-
186
- type model = String | :auto | :"2026-10-01"
187
-
188
- module Model
189
- extend OpenAI::Internal::Type::Union
190
-
191
- def self?.variants: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::model]
192
-
193
- AUTO: :auto
194
- MODEL_2026_10_01: :"2026-10-01"
195
- end
196
- end
197
-
198
109
  def self?.variants: -> ::Array[OpenAI::Models::Audio::VoiceCreateParams::body]
199
110
  end
200
111
  end
@@ -0,0 +1,268 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module Agents
5
+ type environment_create_params =
6
+ {
7
+ environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment,
8
+ ?vault_ids: ::Array[String]?,
9
+ ?idempotency_key: String,
10
+ ?request_options: OpenAI::request_opts
11
+ }
12
+
13
+ class EnvironmentCreateParams < OpenAI::Internal::Type::BaseModel
14
+ extend OpenAI::Internal::Type::RequestParameters::Converter
15
+ include OpenAI::Internal::Type::RequestParameters
16
+
17
+ # The required hosting type and its configuration.
18
+ attr_accessor environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment
19
+
20
+ # The IDs of up to 10 vaults made available to an OpenAI-hosted environment.
21
+ attr_accessor vault_ids: ::Array[String]?
22
+
23
+ attr_reader idempotency_key: String?
24
+
25
+ def idempotency_key=: (String) -> String
26
+
27
+ # @param environment
28
+ # The required hosting type and its configuration.
29
+ # @param vault_ids
30
+ # The IDs of up to 10 vaults made available to an OpenAI-hosted environment.
31
+ def initialize: (
32
+ environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment,
33
+ ?vault_ids: ::Array[String]?,
34
+ ?idempotency_key: String,
35
+ ?request_options: OpenAI::request_opts
36
+ ) -> void
37
+
38
+ def to_hash: -> {
39
+ environment: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment,
40
+ ?vault_ids: ::Array[String]?,
41
+ ?idempotency_key: String,
42
+ ?request_options: OpenAI::RequestOptions
43
+ }
44
+
45
+ type environment =
46
+ {
47
+ ?type: :openai_hosted,
48
+ ?capability_directories: ::Array[String]?,
49
+ ?desktop: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Desktop?,
50
+ ?env: ::Hash[Symbol, String]?,
51
+ ?environment_template_id: String,
52
+ ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
53
+ ?network: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network?,
54
+ ?packages: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Packages?,
55
+ ?plugins: ::Array[OpenAI::Beta::HostedPluginParam]?,
56
+ ?setup_commands: ::Array[OpenAI::Beta::SetupCommandParam]?,
57
+ ?skills: ::Array[OpenAI::Models::Beta::hosted_skill_param]?
58
+ }
59
+
60
+ class Environment < OpenAI::Internal::Type::BaseModel
61
+ # The type of the object. Always `openai_hosted`.
62
+ attr_accessor type: :openai_hosted
63
+
64
+ # Directories that contain capabilities exposed to the agent. Defaults to an empty
65
+ # list.
66
+ attr_accessor capability_directories: ::Array[String]?
67
+
68
+ # Desktop provisioning. Omission or null inherits the template setting, or
69
+ # defaults to disabled.
70
+ attr_accessor desktop: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Desktop?
71
+
72
+ # Environment variables made available to the agent.
73
+ attr_accessor env: ::Hash[Symbol, String]?
74
+
75
+ # A reusable hosted template applied before inline configuration. Omitted fields
76
+ # inherit the template; network overrides cannot broaden its policy.
77
+ attr_reader environment_template_id: String?
78
+
79
+ # A reusable hosted template applied before inline configuration. Omitted fields
80
+ # inherit the template; network overrides cannot broaden its policy.
81
+ def environment_template_id=: (String) -> String
82
+
83
+ # Files available before the agent starts. Defaults to an empty list.
84
+ attr_accessor files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?
85
+
86
+ # Network access policy for the environment. If omitted, the API version
87
+ # determines whether network access is enabled or disabled.
88
+ attr_accessor network: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network?
89
+
90
+ # Packages to install in the environment. Defaults to empty package lists.
91
+ attr_accessor packages: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Packages?
92
+
93
+ # Plugins provided as inline ZIP archives. Defaults to an empty list.
94
+ attr_accessor plugins: ::Array[OpenAI::Beta::HostedPluginParam]?
95
+
96
+ # Ordered, confidential setup commands. Command bodies are never returned.
97
+ attr_accessor setup_commands: ::Array[OpenAI::Beta::SetupCommandParam]?
98
+
99
+ # Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
100
+ # list.
101
+ attr_accessor skills: ::Array[OpenAI::Models::Beta::hosted_skill_param]?
102
+
103
+ # @param capability_directories
104
+ # Directories that contain capabilities exposed to the agent. Defaults to an empty
105
+ # list.
106
+ # @param desktop
107
+ # Desktop provisioning. Omission or null inherits the template setting, or
108
+ # defaults to disabled.
109
+ # @param env
110
+ # Environment variables made available to the agent.
111
+ # @param environment_template_id
112
+ # A reusable hosted template applied before inline configuration. Omitted fields
113
+ # inherit the template; network overrides cannot broaden its policy.
114
+ # @param files
115
+ # Files available before the agent starts. Defaults to an empty list.
116
+ # @param network
117
+ # Network access policy for the environment. If omitted, the API version
118
+ # determines whether network access is enabled or disabled.
119
+ # @param packages
120
+ # Packages to install in the environment. Defaults to empty package lists.
121
+ # @param plugins
122
+ # Plugins provided as inline ZIP archives. Defaults to an empty list.
123
+ # @param setup_commands
124
+ # Ordered, confidential setup commands. Command bodies are never returned.
125
+ # @param skills
126
+ # Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
127
+ # list.
128
+ # @param type
129
+ # The type of the object. Always `openai_hosted`.
130
+ def initialize: (
131
+ ?capability_directories: ::Array[String]?,
132
+ ?desktop: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Desktop?,
133
+ ?env: ::Hash[Symbol, String]?,
134
+ ?environment_template_id: String,
135
+ ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
136
+ ?network: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network?,
137
+ ?packages: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Packages?,
138
+ ?plugins: ::Array[OpenAI::Beta::HostedPluginParam]?,
139
+ ?setup_commands: ::Array[OpenAI::Beta::SetupCommandParam]?,
140
+ ?skills: ::Array[OpenAI::Models::Beta::hosted_skill_param]?,
141
+ ?type: :openai_hosted
142
+ ) -> void
143
+
144
+ def to_hash: -> {
145
+ ?type: :openai_hosted,
146
+ ?capability_directories: ::Array[String]?,
147
+ ?desktop: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Desktop?,
148
+ ?env: ::Hash[Symbol, String]?,
149
+ ?environment_template_id: String,
150
+ ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
151
+ ?network: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network?,
152
+ ?packages: OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Packages?,
153
+ ?plugins: ::Array[OpenAI::Beta::HostedPluginParam]?,
154
+ ?setup_commands: ::Array[OpenAI::Beta::SetupCommandParam]?,
155
+ ?skills: ::Array[OpenAI::Models::Beta::hosted_skill_param]?
156
+ }
157
+
158
+ type desktop = { enabled: bool }
159
+
160
+ class Desktop < OpenAI::Internal::Type::BaseModel
161
+ # Whether to provision the desktop and its browser proxy.
162
+ attr_accessor enabled: bool
163
+
164
+ # @param enabled
165
+ # Whether to provision the desktop and its browser proxy.
166
+ def initialize: (enabled: bool) -> void
167
+
168
+ def to_hash: -> { enabled: bool }
169
+ end
170
+
171
+ type network =
172
+ {
173
+ access: OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::access,
174
+ ?allowed_domains: ::Array[String]?,
175
+ ?blocked_domains: ::Array[String]?
176
+ }
177
+
178
+ class Network < OpenAI::Internal::Type::BaseModel
179
+ # The environment's network access mode.
180
+ attr_accessor access: OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::access
181
+
182
+ # Domains the environment may access when network access is restricted.
183
+ attr_accessor allowed_domains: ::Array[String]?
184
+
185
+ # Domains blocked for both executor and browser when access is restricted. A
186
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
187
+ # `allowed_domains`. Wildcard domains are not supported.
188
+ attr_accessor blocked_domains: ::Array[String]?
189
+
190
+ # @param access
191
+ # The environment's network access mode.
192
+ # @param allowed_domains
193
+ # Domains the environment may access when network access is restricted.
194
+ # @param blocked_domains
195
+ # Domains blocked for both executor and browser when access is restricted. A
196
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
197
+ # `allowed_domains`. Wildcard domains are not supported.
198
+ def initialize: (
199
+ access: OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::access,
200
+ ?allowed_domains: ::Array[String]?,
201
+ ?blocked_domains: ::Array[String]?
202
+ ) -> void
203
+
204
+ def to_hash: -> {
205
+ access: OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::access,
206
+ ?allowed_domains: ::Array[String]?,
207
+ ?blocked_domains: ::Array[String]?
208
+ }
209
+
210
+ type access = :enabled | :disabled | :restricted
211
+
212
+ module Access
213
+ extend OpenAI::Internal::Type::Enum
214
+
215
+ # Allows unrestricted network access.
216
+ ENABLED: :enabled
217
+
218
+ # Disables network access.
219
+ DISABLED: :disabled
220
+
221
+ # Applies the configured domain restrictions.
222
+ RESTRICTED: :restricted
223
+
224
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::access]
225
+ end
226
+ end
227
+
228
+ type packages =
229
+ {
230
+ ?npm: ::Array[String]?,
231
+ ?python: ::Array[String]?,
232
+ ?system_: ::Array[String]?
233
+ }
234
+
235
+ class Packages < OpenAI::Internal::Type::BaseModel
236
+ # npm packages to install globally. Defaults to an empty list.
237
+ attr_accessor npm: ::Array[String]?
238
+
239
+ # Python packages to install. Defaults to an empty list.
240
+ attr_accessor python: ::Array[String]?
241
+
242
+ # System packages to install. Defaults to an empty list.
243
+ attr_accessor system_: ::Array[String]?
244
+
245
+ # @param npm
246
+ # npm packages to install globally. Defaults to an empty list.
247
+ # @param python
248
+ # Python packages to install. Defaults to an empty list.
249
+ # @param system_
250
+ # System packages to install. Defaults to an empty list.
251
+ def initialize: (
252
+ ?npm: ::Array[String]?,
253
+ ?python: ::Array[String]?,
254
+ ?system_: ::Array[String]?
255
+ ) -> void
256
+
257
+ def to_hash: -> {
258
+ ?npm: ::Array[String]?,
259
+ ?python: ::Array[String]?,
260
+ ?system_: ::Array[String]?
261
+ }
262
+ end
263
+ end
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
@@ -70,12 +70,16 @@ module OpenAI
70
70
  }
71
71
 
72
72
  type status =
73
- :pending | :connected | :disconnected | :expired | :failed
73
+ :pending | :ready | :connected | :disconnected | :expired | :failed
74
74
 
75
75
  module Status
76
76
  extend OpenAI::Internal::Type::Enum
77
77
 
78
78
  PENDING: :pending
79
+
80
+ # Provisioning succeeded and the environment is available for attachment or use.
81
+ READY: :ready
82
+
79
83
  CONNECTED: :connected
80
84
  DISCONNECTED: :disconnected
81
85
  EXPIRED: :expired
@@ -0,0 +1,97 @@
1
+ module OpenAI
2
+ module Models
3
+ module Beta
4
+ module Agents
5
+ type environment_list_params =
6
+ {
7
+ ?after: String,
8
+ ?limit: Integer,
9
+ ?order: OpenAI::Models::Beta::Agents::EnvironmentListParams::order,
10
+ ?type: OpenAI::Models::Beta::Agents::EnvironmentListParams::type_,
11
+ ?request_options: OpenAI::request_opts
12
+ }
13
+
14
+ class EnvironmentListParams < OpenAI::Internal::Type::BaseModel
15
+ extend OpenAI::Internal::Type::RequestParameters::Converter
16
+ include OpenAI::Internal::Type::RequestParameters
17
+
18
+ # Return environments after this environment ID in the selected order.
19
+ attr_reader after: String?
20
+
21
+ # Return environments after this environment ID in the selected order.
22
+ def after=: (String) -> String
23
+
24
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
25
+ attr_reader limit: Integer?
26
+
27
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
28
+ def limit=: (Integer) -> Integer
29
+
30
+ # The order in which environments are returned. Defaults to `desc`.
31
+ attr_reader order: OpenAI::Models::Beta::Agents::EnvironmentListParams::order?
32
+
33
+ # The order in which environments are returned. Defaults to `desc`.
34
+ def order=: (
35
+ OpenAI::Models::Beta::Agents::EnvironmentListParams::order
36
+ ) -> OpenAI::Models::Beta::Agents::EnvironmentListParams::order
37
+
38
+ # The hosting type to list. Defaults to `openai_hosted`.
39
+ attr_reader type: OpenAI::Models::Beta::Agents::EnvironmentListParams::type_?
40
+
41
+ # The hosting type to list. Defaults to `openai_hosted`.
42
+ def type=: (
43
+ OpenAI::Models::Beta::Agents::EnvironmentListParams::type_
44
+ ) -> OpenAI::Models::Beta::Agents::EnvironmentListParams::type_
45
+
46
+ # @param after
47
+ # Return environments after this environment ID in the selected order.
48
+ # @param limit
49
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
50
+ # @param order
51
+ # The order in which environments are returned. Defaults to `desc`.
52
+ # @param type
53
+ # The hosting type to list. Defaults to `openai_hosted`.
54
+ def initialize: (
55
+ ?after: String,
56
+ ?limit: Integer,
57
+ ?order: OpenAI::Models::Beta::Agents::EnvironmentListParams::order,
58
+ ?type: OpenAI::Models::Beta::Agents::EnvironmentListParams::type_,
59
+ ?request_options: OpenAI::request_opts
60
+ ) -> void
61
+
62
+ def to_hash: -> {
63
+ ?after: String,
64
+ ?limit: Integer,
65
+ ?order: OpenAI::Models::Beta::Agents::EnvironmentListParams::order,
66
+ ?type: OpenAI::Models::Beta::Agents::EnvironmentListParams::type_,
67
+ ?request_options: OpenAI::RequestOptions
68
+ }
69
+
70
+ type order = :asc | :desc
71
+
72
+ module Order
73
+ extend OpenAI::Internal::Type::Enum
74
+
75
+ # Returns resources in ascending order.
76
+ ASC: :asc
77
+
78
+ # Returns resources in descending order.
79
+ DESC: :desc
80
+
81
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::EnvironmentListParams::order]
82
+ end
83
+
84
+ type type_ = :openai_hosted
85
+
86
+ module Type
87
+ extend OpenAI::Internal::Type::Enum
88
+
89
+ OPENAI_HOSTED: :openai_hosted
90
+
91
+ def self?.values: -> ::Array[OpenAI::Models::Beta::Agents::EnvironmentListParams::type_]
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -29,6 +29,7 @@ module OpenAI
29
29
  ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
30
30
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
31
31
  ?env: ::Hash[Symbol, String]?,
32
+ ?environment_id: String,
32
33
  ?environment_template_id: String,
33
34
  ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
34
35
  ?network: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network?,
@@ -61,6 +62,14 @@ module OpenAI
61
62
  # Environment variables made available to the agent.
62
63
  attr_accessor env: ::Hash[Symbol, String]?
63
64
 
65
+ # An existing prewarmed environment. Cannot be combined with a template or inline
66
+ # configuration.
67
+ attr_reader environment_id: String?
68
+
69
+ # An existing prewarmed environment. Cannot be combined with a template or inline
70
+ # configuration.
71
+ def environment_id=: (String) -> String
72
+
64
73
  # A reusable hosted template applied before inline session configuration. Omitted
65
74
  # fields inherit the template; network overrides cannot broaden its policy.
66
75
  attr_reader environment_template_id: String?
@@ -99,6 +108,9 @@ module OpenAI
99
108
  # defaults to disabled.
100
109
  # @param env
101
110
  # Environment variables made available to the agent.
111
+ # @param environment_id
112
+ # An existing prewarmed environment. Cannot be combined with a template or inline
113
+ # configuration.
102
114
  # @param environment_template_id
103
115
  # A reusable hosted template applied before inline session configuration. Omitted
104
116
  # fields inherit the template; network overrides cannot broaden its policy.
@@ -123,6 +135,7 @@ module OpenAI
123
135
  ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
124
136
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
125
137
  ?env: ::Hash[Symbol, String]?,
138
+ ?environment_id: String,
126
139
  ?environment_template_id: String,
127
140
  ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
128
141
  ?network: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network?,
@@ -139,6 +152,7 @@ module OpenAI
139
152
  ?container_size: OpenAI::Models::Beta::EnvironmentParam::OpenAIHosted::container_size,
140
153
  ?desktop: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop?,
141
154
  ?env: ::Hash[Symbol, String]?,
155
+ ?environment_id: String,
142
156
  ?environment_template_id: String,
143
157
  ?files: ::Array[OpenAI::Models::Beta::hosted_environment_file_param]?,
144
158
  ?network: OpenAI::Beta::EnvironmentParam::OpenAIHosted::Network?,