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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c9c92914efc09920f412b87f40bd0401a68b41f69fa4ffcaee090cf8ee93959
4
- data.tar.gz: af39812b8849fa3bdb1f0f04dd5da8368c45b244ec24c52cfe901e5e22445690
3
+ metadata.gz: e214fa257d53a7b24aa14ad9d7bbabb907c47e3b50b2fbf769177dac7bfe04b8
4
+ data.tar.gz: 4356c890b1060157f4d252b411eb234f6987782cea1ab79a4eba9d8d00028a87
5
5
  SHA512:
6
- metadata.gz: 49f421e6b6fca640e3abbee1028b7df1935c9cc7c79ddecebc6fb50b01e920ca5fc0cbed0b652cc065730b5e6696f0de18367d51e0f4fa0ceec8caee92ccdcf5
7
- data.tar.gz: ae6558f4994712ecb02afe85d5961c26657bc48001ad4c8dde460f408b256434cf741a71f60bb17432e3c35d2dca4180d81a8b77ceafdc6831a8117ff7971116
6
+ metadata.gz: 1b6c400866161baef0e067c3ebd597b483249954373a32e193e58b8383638d52a977d10270f8e0d876b8838109ec3d086049548d20e77aa9d2d6adbd21a778ea
7
+ data.tar.gz: dfa20d336ce432cd06d9a65e4ef94575581783885fed890600f35dc32a54b69af9cc2ef63b3d474d561edc88fcc9f944423832e5aa55812f550395a8622bb35e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.102.0](https://github.com/openai/openai-ruby/compare/v0.101.1...v0.102.0) (2026-10-09)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add prewarmed hosted environments ([#818](https://github.com/openai/openai-ruby/issues/818)) ([a9e8015](https://github.com/openai/openai-ruby/commit/a9e80153b030395eca41bf4c6cce0b1e7fcea4dd))
9
+
10
+ ## [0.101.1](https://github.com/openai/openai-ruby/compare/v0.101.0...v0.101.1) (2026-10-08)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **api:** correct custom voice creation parameters ([#814](https://github.com/openai/openai-ruby/issues/814)) ([8e6daec](https://github.com/openai/openai-ruby/commit/8e6daecffadccb2f2cd5f442daa63cf4e2b73340))
16
+
3
17
  ## [0.101.0](https://github.com/openai/openai-ruby/compare/v0.100.0...v0.101.0) (2026-10-06)
4
18
 
5
19
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "openai", "~> 0.101.0"
18
+ gem "openai", "~> 0.102.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -29,8 +29,7 @@ module OpenAI
29
29
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
30
30
  # voices are available in the
31
31
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
32
- # Custom voices must be created from audio samples. Voices created from text
33
- # prompts are supported only in Live.
32
+ # Custom voices must be created from audio samples.
34
33
  #
35
34
  # @return [String, Symbol, OpenAI::Models::Audio::SpeechCreateParams::Voice::ID, OpenAI::Models::Audio::SpeechCreateParams::Voice]
36
35
  required :voice, union: -> { OpenAI::Audio::SpeechCreateParams::Voice }
@@ -79,8 +78,7 @@ module OpenAI
79
78
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
80
79
  # voices are available in the
81
80
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
82
- # Custom voices must be created from audio samples. Voices created from text
83
- # prompts are supported only in Live.
81
+ # Custom voices must be created from audio samples.
84
82
  #
85
83
  # @param instructions [String]
86
84
  # Control the voice of your generated audio with additional instructions. Does not
@@ -121,8 +119,7 @@ module OpenAI
121
119
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
122
120
  # voices are available in the
123
121
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
124
- # Custom voices must be created from audio samples. Voices created from text
125
- # prompts are supported only in Live.
122
+ # Custom voices must be created from audio samples.
126
123
  module Voice
127
124
  extend OpenAI::Internal::Type::Union
128
125
 
@@ -30,15 +30,13 @@ module OpenAI
30
30
  required :object, const: :"audio.voice"
31
31
 
32
32
  # @!attribute type
33
- # How the voice was created. Voices created from text prompts are supported only
34
- # in Live.
33
+ # How the voice was created.
35
34
  #
36
35
  # @return [Symbol, OpenAI::Models::Audio::Voice::Type]
37
36
  required :type, enum: -> { OpenAI::Audio::Voice::Type }
38
37
 
39
38
  # @!method initialize(id:, created_at:, name:, type:, object: :"audio.voice")
40
- # A custom voice that can be used for audio output. Voices created from text
41
- # prompts are supported only in Live.
39
+ # A custom voice that can be used for audio output.
42
40
  #
43
41
  # @param id [String]
44
42
  # The voice identifier, which can be referenced in API endpoints.
@@ -50,21 +48,18 @@ module OpenAI
50
48
  # The name of the voice.
51
49
  #
52
50
  # @param type [Symbol, OpenAI::Models::Audio::Voice::Type]
53
- # How the voice was created. Voices created from text prompts are supported only
54
- # in Live.
51
+ # How the voice was created.
55
52
  #
56
53
  # @param object [Symbol, :"audio.voice"]
57
54
  # The object type, which is always `audio.voice`.
58
55
 
59
- # How the voice was created. Voices created from text prompts are supported only
60
- # in Live.
56
+ # How the voice was created.
61
57
  #
62
58
  # @see OpenAI::Models::Audio::Voice#type
63
59
  module Type
64
60
  extend OpenAI::Internal::Type::Enum
65
61
 
66
62
  AUDIO_SAMPLE = :audio_sample
67
- PROMPT = :prompt
68
63
 
69
64
  # @!method self.values
70
65
  # @return [Array<Symbol>]
@@ -12,11 +12,11 @@ module OpenAI
12
12
  # Creates a voice from a consent recording and an audio sample. Requires
13
13
  # multipart/form-data.
14
14
  #
15
- # @return [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt]
15
+ # @return [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample]
16
16
  required :body, union: -> { OpenAI::Audio::VoiceCreateParams::Body }
17
17
 
18
18
  # @!method initialize(body:, request_options: {})
19
- # @param body [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt]
19
+ # @param body [OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample]
20
20
  # Creates a voice from a consent recording and an audio sample. Requires
21
21
  # multipart/form-data.
22
22
  #
@@ -43,9 +43,6 @@ module OpenAI
43
43
  # Creates a voice from a consent recording and an audio sample. Requires multipart/form-data.
44
44
  variant :audio_sample, -> { OpenAI::Audio::VoiceCreateParams::Body::AudioSample }
45
45
 
46
- # Creates a synthetic voice from a text description. Supports application/json or multipart/form-data.
47
- variant :prompt, -> { OpenAI::Audio::VoiceCreateParams::Body::Prompt }
48
-
49
46
  class AudioSample < OpenAI::Internal::Type::BaseModel
50
47
  # @!attribute audio_sample
51
48
  # The sample audio recording file. Maximum size is 10 MiB.
@@ -114,102 +111,8 @@ module OpenAI
114
111
  end
115
112
  end
116
113
 
117
- class Prompt < OpenAI::Internal::Type::BaseModel
118
- # @!attribute name
119
- # The name of the new voice.
120
- #
121
- # @return [String]
122
- required :name, String
123
-
124
- # @!attribute prompt
125
- # A description of the desired voice. Must not contain only whitespace.
126
- #
127
- # @return [String]
128
- required :prompt, String
129
-
130
- # @!attribute type
131
- # Set to `prompt` to create a voice from a text description.
132
- #
133
- # @return [Symbol, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Type]
134
- required :type, enum: -> { OpenAI::Audio::VoiceCreateParams::Body::Prompt::Type }
135
-
136
- # @!attribute model
137
- # The voice creation model to use. Defaults to `auto`.
138
- #
139
- # @return [String, Symbol, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Model, nil]
140
- optional :model, union: -> { OpenAI::Audio::VoiceCreateParams::Body::Prompt::Model }
141
-
142
- # @!attribute script_hint
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
- #
147
- # @return [String, nil]
148
- optional :script_hint, String
149
-
150
- # @!method initialize(name:, prompt:, type:, model: nil, script_hint: nil)
151
- # Creates a synthetic voice from a text description. Supports application/json or
152
- # multipart/form-data.
153
- #
154
- # @param name [String]
155
- # The name of the new voice.
156
- #
157
- # @param prompt [String]
158
- # A description of the desired voice. Must not contain only whitespace.
159
- #
160
- # @param type [Symbol, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Type]
161
- # Set to `prompt` to create a voice from a text description.
162
- #
163
- # @param model [String, Symbol, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Model]
164
- # The voice creation model to use. Defaults to `auto`.
165
- #
166
- # @param script_hint [String]
167
- # Optional text for the voice to speak during creation. If omitted, a script is
168
- # generated from the prompt. Must not be blank after trimming whitespace; scripts
169
- # that are too short are rejected.
170
-
171
- # Set to `prompt` to create a voice from a text description.
172
- #
173
- # @see OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt#type
174
- module Type
175
- extend OpenAI::Internal::Type::Enum
176
-
177
- PROMPT = :prompt
178
-
179
- # @!method self.values
180
- # @return [Array<Symbol>]
181
- end
182
-
183
- # The voice creation model to use. Defaults to `auto`.
184
- #
185
- # @see OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt#model
186
- module Model
187
- extend OpenAI::Internal::Type::Union
188
-
189
- variant String
190
-
191
- variant const: -> { OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Model::AUTO }
192
-
193
- variant const: -> { OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt::Model::MODEL_2026_10_01 }
194
-
195
- # @!method self.variants
196
- # @return [Array(String, Symbol)]
197
-
198
- define_sorbet_constant!(:Variants) do
199
- T.type_alias { T.any(String, OpenAI::Audio::VoiceCreateParams::Body::Prompt::Model::TaggedSymbol) }
200
- end
201
-
202
- # @!group
203
-
204
- AUTO = :auto
205
- MODEL_2026_10_01 = :"2026-10-01"
206
-
207
- # @!endgroup
208
- end
209
- end
210
-
211
114
  # @!method self.variants
212
- # @return [Array(OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample, OpenAI::Models::Audio::VoiceCreateParams::Body::Prompt)]
115
+ # @return [Array(OpenAI::Models::Audio::VoiceCreateParams::Body::AudioSample)]
213
116
  end
214
117
  end
215
118
  end
@@ -0,0 +1,300 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module Agents
7
+ # @see OpenAI::Resources::Beta::Agents::Environments#create
8
+ class EnvironmentCreateParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!attribute environment
13
+ # The required hosting type and its configuration.
14
+ #
15
+ # @return [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment]
16
+ required :environment, -> { OpenAI::Beta::Agents::EnvironmentCreateParams::Environment }
17
+
18
+ # @!attribute vault_ids
19
+ # The IDs of up to 10 vaults made available to an OpenAI-hosted environment.
20
+ #
21
+ # @return [Array<String>, nil]
22
+ optional :vault_ids, OpenAI::Internal::Type::ArrayOf[String], nil?: true
23
+
24
+ # @!attribute idempotency_key
25
+ #
26
+ # @return [String, nil]
27
+ optional :idempotency_key, String
28
+
29
+ # @!method initialize(environment:, vault_ids: nil, idempotency_key: nil, request_options: {})
30
+ # @param environment [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment]
31
+ # The required hosting type and its configuration.
32
+ #
33
+ # @param vault_ids [Array<String>, nil]
34
+ # The IDs of up to 10 vaults made available to an OpenAI-hosted environment.
35
+ #
36
+ # @param idempotency_key [String]
37
+ #
38
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
39
+
40
+ class Environment < OpenAI::Internal::Type::BaseModel
41
+ # @!attribute type
42
+ # The type of the object. Always `openai_hosted`.
43
+ #
44
+ # @return [Symbol, :openai_hosted]
45
+ required :type, const: :openai_hosted
46
+
47
+ # @!attribute capability_directories
48
+ # Directories that contain capabilities exposed to the agent. Defaults to an empty
49
+ # list.
50
+ #
51
+ # @return [Array<String>, nil]
52
+ optional :capability_directories, OpenAI::Internal::Type::ArrayOf[String], nil?: true
53
+
54
+ # @!attribute desktop
55
+ # Desktop provisioning. Omission or null inherits the template setting, or
56
+ # defaults to disabled.
57
+ #
58
+ # @return [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Desktop, nil]
59
+ optional(
60
+ :desktop,
61
+ -> {
62
+ OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Desktop
63
+ },
64
+ nil?: true
65
+ )
66
+
67
+ # @!attribute env
68
+ # Environment variables made available to the agent.
69
+ #
70
+ # @return [Hash{Symbol=>String}, nil]
71
+ optional :env, OpenAI::Internal::Type::HashOf[String], nil?: true
72
+
73
+ # @!attribute environment_template_id
74
+ # A reusable hosted template applied before inline configuration. Omitted fields
75
+ # inherit the template; network overrides cannot broaden its policy.
76
+ #
77
+ # @return [String, nil]
78
+ optional :environment_template_id, String
79
+
80
+ # @!attribute files
81
+ # Files available before the agent starts. Defaults to an empty list.
82
+ #
83
+ # @return [Array<OpenAI::Models::Beta::HostedEnvironmentFileParam::FileID, OpenAI::Models::Beta::HostedEnvironmentFileParam::Inline>, nil]
84
+ optional(
85
+ :files,
86
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::HostedEnvironmentFileParam] },
87
+ nil?: true
88
+ )
89
+
90
+ # @!attribute network
91
+ # Network access policy for the environment. If omitted, the API version
92
+ # determines whether network access is enabled or disabled.
93
+ #
94
+ # @return [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network, nil]
95
+ optional(
96
+ :network,
97
+ -> {
98
+ OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network
99
+ },
100
+ nil?: true
101
+ )
102
+
103
+ # @!attribute packages
104
+ # Packages to install in the environment. Defaults to empty package lists.
105
+ #
106
+ # @return [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Packages, nil]
107
+ optional(
108
+ :packages,
109
+ -> { OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Packages },
110
+ nil?: true
111
+ )
112
+
113
+ # @!attribute plugins
114
+ # Plugins provided as inline ZIP archives. Defaults to an empty list.
115
+ #
116
+ # @return [Array<OpenAI::Models::Beta::HostedPluginParam>, nil]
117
+ optional(
118
+ :plugins,
119
+ -> {
120
+ OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::HostedPluginParam]
121
+ },
122
+ nil?: true
123
+ )
124
+
125
+ # @!attribute setup_commands
126
+ # Ordered, confidential setup commands. Command bodies are never returned.
127
+ #
128
+ # @return [Array<OpenAI::Models::Beta::SetupCommandParam>, nil]
129
+ optional(
130
+ :setup_commands,
131
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Beta::SetupCommandParam] },
132
+ nil?: true
133
+ )
134
+
135
+ # @!attribute skills
136
+ # Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
137
+ # list.
138
+ #
139
+ # @return [Array<OpenAI::Models::Beta::HostedSkillParam::SkillReference, OpenAI::Models::Beta::HostedSkillParam::Inline>, nil]
140
+ optional(
141
+ :skills,
142
+ -> { OpenAI::Internal::Type::ArrayOf[union: OpenAI::Beta::HostedSkillParam] },
143
+ nil?: true
144
+ )
145
+
146
+ # @!method initialize(capability_directories: nil, desktop: nil, env: nil, environment_template_id: nil, files: nil, network: nil, packages: nil, plugins: nil, setup_commands: nil, skills: nil, type: :openai_hosted)
147
+ # The required hosting type and its configuration.
148
+ #
149
+ # @param capability_directories [Array<String>, nil]
150
+ # Directories that contain capabilities exposed to the agent. Defaults to an empty
151
+ # list.
152
+ #
153
+ # @param desktop [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Desktop, nil]
154
+ # Desktop provisioning. Omission or null inherits the template setting, or
155
+ # defaults to disabled.
156
+ #
157
+ # @param env [Hash{Symbol=>String}, nil]
158
+ # Environment variables made available to the agent.
159
+ #
160
+ # @param environment_template_id [String]
161
+ # A reusable hosted template applied before inline configuration. Omitted fields
162
+ # inherit the template; network overrides cannot broaden its policy.
163
+ #
164
+ # @param files [Array<OpenAI::Models::Beta::HostedEnvironmentFileParam::FileID, OpenAI::Models::Beta::HostedEnvironmentFileParam::Inline>, nil]
165
+ # Files available before the agent starts. Defaults to an empty list.
166
+ #
167
+ # @param network [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network, nil]
168
+ # Network access policy for the environment. If omitted, the API version
169
+ # determines whether network access is enabled or disabled.
170
+ #
171
+ # @param packages [OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Packages, nil]
172
+ # Packages to install in the environment. Defaults to empty package lists.
173
+ #
174
+ # @param plugins [Array<OpenAI::Models::Beta::HostedPluginParam>, nil]
175
+ # Plugins provided as inline ZIP archives. Defaults to an empty list.
176
+ #
177
+ # @param setup_commands [Array<OpenAI::Models::Beta::SetupCommandParam>, nil]
178
+ # Ordered, confidential setup commands. Command bodies are never returned.
179
+ #
180
+ # @param skills [Array<OpenAI::Models::Beta::HostedSkillParam::SkillReference, OpenAI::Models::Beta::HostedSkillParam::Inline>, nil]
181
+ # Skills referenced by ID or provided as inline ZIP archives. Defaults to an empty
182
+ # list.
183
+ #
184
+ # @param type [Symbol, :openai_hosted]
185
+ # The type of the object. Always `openai_hosted`.
186
+
187
+ # @see OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment#desktop
188
+ class Desktop < OpenAI::Internal::Type::BaseModel
189
+ # @!attribute enabled
190
+ # Whether to provision the desktop and its browser proxy.
191
+ #
192
+ # @return [Boolean]
193
+ required :enabled, OpenAI::Internal::Type::Boolean
194
+
195
+ # @!method initialize(enabled:)
196
+ # Desktop provisioning. Omission or null inherits the template setting, or
197
+ # defaults to disabled.
198
+ #
199
+ # @param enabled [Boolean]
200
+ # Whether to provision the desktop and its browser proxy.
201
+ end
202
+
203
+ # @see OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment#network
204
+ class Network < OpenAI::Internal::Type::BaseModel
205
+ # @!attribute access
206
+ # The environment's network access mode.
207
+ #
208
+ # @return [Symbol, OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::Access]
209
+ required(
210
+ :access,
211
+ enum: -> { OpenAI::Beta::Agents::EnvironmentCreateParams::Environment::Network::Access }
212
+ )
213
+
214
+ # @!attribute allowed_domains
215
+ # Domains the environment may access when network access is restricted.
216
+ #
217
+ # @return [Array<String>, nil]
218
+ optional :allowed_domains, OpenAI::Internal::Type::ArrayOf[String], nil?: true
219
+
220
+ # @!attribute blocked_domains
221
+ # Domains blocked for both executor and browser when access is restricted. A
222
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
223
+ # `allowed_domains`. Wildcard domains are not supported.
224
+ #
225
+ # @return [Array<String>, nil]
226
+ optional :blocked_domains, OpenAI::Internal::Type::ArrayOf[String], nil?: true
227
+
228
+ # @!method initialize(access:, allowed_domains: nil, blocked_domains: nil)
229
+ # Network access policy for the environment. If omitted, the API version
230
+ # determines whether network access is enabled or disabled.
231
+ #
232
+ # @param access [Symbol, OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network::Access]
233
+ # The environment's network access mode.
234
+ #
235
+ # @param allowed_domains [Array<String>, nil]
236
+ # Domains the environment may access when network access is restricted.
237
+ #
238
+ # @param blocked_domains [Array<String>, nil]
239
+ # Domains blocked for both executor and browser when access is restricted. A
240
+ # nonempty list requires `access: restricted` and cannot be combined with nonempty
241
+ # `allowed_domains`. Wildcard domains are not supported.
242
+
243
+ # The environment's network access mode.
244
+ #
245
+ # @see OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment::Network#access
246
+ module Access
247
+ extend OpenAI::Internal::Type::Enum
248
+
249
+ # Allows unrestricted network access.
250
+ ENABLED = :enabled
251
+
252
+ # Disables network access.
253
+ DISABLED = :disabled
254
+
255
+ # Applies the configured domain restrictions.
256
+ RESTRICTED = :restricted
257
+
258
+ # @!method self.values
259
+ # @return [Array<Symbol>]
260
+ end
261
+ end
262
+
263
+ # @see OpenAI::Models::Beta::Agents::EnvironmentCreateParams::Environment#packages
264
+ class Packages < OpenAI::Internal::Type::BaseModel
265
+ # @!attribute npm
266
+ # npm packages to install globally. Defaults to an empty list.
267
+ #
268
+ # @return [Array<String>, nil]
269
+ optional :npm, OpenAI::Internal::Type::ArrayOf[String], nil?: true
270
+
271
+ # @!attribute python
272
+ # Python packages to install. Defaults to an empty list.
273
+ #
274
+ # @return [Array<String>, nil]
275
+ optional :python, OpenAI::Internal::Type::ArrayOf[String], nil?: true
276
+
277
+ # @!attribute system_
278
+ # System packages to install. Defaults to an empty list.
279
+ #
280
+ # @return [Array<String>, nil]
281
+ optional :system_, OpenAI::Internal::Type::ArrayOf[String], api_name: :system, nil?: true
282
+
283
+ # @!method initialize(npm: nil, python: nil, system_: nil)
284
+ # Packages to install in the environment. Defaults to empty package lists.
285
+ #
286
+ # @param npm [Array<String>, nil]
287
+ # npm packages to install globally. Defaults to an empty list.
288
+ #
289
+ # @param python [Array<String>, nil]
290
+ # Python packages to install. Defaults to an empty list.
291
+ #
292
+ # @param system_ [Array<String>, nil]
293
+ # System packages to install. Defaults to an empty list.
294
+ end
295
+ end
296
+ end
297
+ end
298
+ end
299
+ end
300
+ end
@@ -4,7 +4,7 @@ module OpenAI
4
4
  module Models
5
5
  module Beta
6
6
  module Agents
7
- # @see OpenAI::Resources::Beta::Agents::Environments#retrieve
7
+ # @see OpenAI::Resources::Beta::Agents::Environments#create
8
8
  class EnvironmentInfo < OpenAI::Internal::Type::BaseModel
9
9
  # @!attribute id
10
10
  # The ID of the environment.
@@ -79,6 +79,9 @@ module OpenAI
79
79
  extend OpenAI::Internal::Type::Enum
80
80
 
81
81
  PENDING = :pending
82
+ # Provisioning succeeded and the environment is available for attachment or use.
83
+ READY = :ready
84
+
82
85
  CONNECTED = :connected
83
86
  DISCONNECTED = :disconnected
84
87
  EXPIRED = :expired
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Beta
6
+ module Agents
7
+ # @see OpenAI::Resources::Beta::Agents::Environments#list
8
+ class EnvironmentListParams < OpenAI::Internal::Type::BaseModel
9
+ extend OpenAI::Internal::Type::RequestParameters::Converter
10
+ include OpenAI::Internal::Type::RequestParameters
11
+
12
+ # @!attribute after
13
+ # Return environments after this environment ID in the selected order.
14
+ #
15
+ # @return [String, nil]
16
+ optional :after, String
17
+
18
+ # @!attribute limit
19
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
20
+ #
21
+ # @return [Integer, nil]
22
+ optional :limit, Integer
23
+
24
+ # @!attribute order
25
+ # The order in which environments are returned. Defaults to `desc`.
26
+ #
27
+ # @return [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Order, nil]
28
+ optional :order, enum: -> { OpenAI::Beta::Agents::EnvironmentListParams::Order }
29
+
30
+ # @!attribute type
31
+ # The hosting type to list. Defaults to `openai_hosted`.
32
+ #
33
+ # @return [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Type, nil]
34
+ optional :type, enum: -> { OpenAI::Beta::Agents::EnvironmentListParams::Type }
35
+
36
+ # @!method initialize(after: nil, limit: nil, order: nil, type: nil, request_options: {})
37
+ # @param after [String]
38
+ # Return environments after this environment ID in the selected order.
39
+ #
40
+ # @param limit [Integer]
41
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
42
+ #
43
+ # @param order [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Order]
44
+ # The order in which environments are returned. Defaults to `desc`.
45
+ #
46
+ # @param type [Symbol, OpenAI::Models::Beta::Agents::EnvironmentListParams::Type]
47
+ # The hosting type to list. Defaults to `openai_hosted`.
48
+ #
49
+ # @param request_options [OpenAI::RequestOptions, Hash{Symbol=>Object}]
50
+
51
+ # The order in which environments are returned. Defaults to `desc`.
52
+ module Order
53
+ extend OpenAI::Internal::Type::Enum
54
+
55
+ # Returns resources in ascending order.
56
+ ASC = :asc
57
+
58
+ # Returns resources in descending order.
59
+ DESC = :desc
60
+
61
+ # @!method self.values
62
+ # @return [Array<Symbol>]
63
+ end
64
+
65
+ # The hosting type to list. Defaults to `openai_hosted`.
66
+ module Type
67
+ extend OpenAI::Internal::Type::Enum
68
+
69
+ OPENAI_HOSTED = :openai_hosted
70
+
71
+ # @!method self.values
72
+ # @return [Array<Symbol>]
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -65,6 +65,13 @@ module OpenAI
65
65
  # @return [Hash{Symbol=>String}, nil]
66
66
  optional :env, OpenAI::Internal::Type::HashOf[String], nil?: true
67
67
 
68
+ # @!attribute environment_id
69
+ # An existing prewarmed environment. Cannot be combined with a template or inline
70
+ # configuration.
71
+ #
72
+ # @return [String, nil]
73
+ optional :environment_id, String
74
+
68
75
  # @!attribute environment_template_id
69
76
  # A reusable hosted template applied before inline session configuration. Omitted
70
77
  # fields inherit the template; network overrides cannot broaden its policy.
@@ -128,7 +135,7 @@ module OpenAI
128
135
  nil?: true
129
136
  )
130
137
 
131
- # @!method initialize(capability_directories: nil, container_size: nil, desktop: nil, env: nil, environment_template_id: nil, files: nil, network: nil, packages: nil, plugins: nil, setup_commands: nil, skills: nil, type: :openai_hosted)
138
+ # @!method initialize(capability_directories: nil, container_size: nil, desktop: nil, env: nil, environment_id: nil, environment_template_id: nil, files: nil, network: nil, packages: nil, plugins: nil, setup_commands: nil, skills: nil, type: :openai_hosted)
132
139
  # An existing OpenAI-hosted environment or new inline/template-based hosted
133
140
  # configuration.
134
141
  #
@@ -146,6 +153,10 @@ module OpenAI
146
153
  # @param env [Hash{Symbol=>String}, nil]
147
154
  # Environment variables made available to the agent.
148
155
  #
156
+ # @param environment_id [String]
157
+ # An existing prewarmed environment. Cannot be combined with a template or inline
158
+ # configuration.
159
+ #
149
160
  # @param environment_template_id [String]
150
161
  # A reusable hosted template applied before inline session configuration. Omitted
151
162
  # fields inherit the template; network overrides cannot broaden its policy.