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
@@ -0,0 +1,136 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Beta
7
+
8
+ module Agents
9
+
10
+ class EnvironmentListParams < OpenAI::Internal::Type::BaseModel
11
+
12
+ extend OpenAI::Internal::Type::RequestParameters::Converter
13
+ include OpenAI::Internal::Type::RequestParameters
14
+
15
+ OrHash = T.type_alias do
16
+ T.any(
17
+ OpenAI::Beta::Agents::EnvironmentListParams,
18
+ OpenAI::Internal::AnyHash
19
+ )
20
+ end
21
+
22
+ # Return environments after this environment ID in the selected order.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :after
25
+
26
+ sig { params(after: String).void }
27
+ attr_writer :after
28
+
29
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :limit
32
+
33
+ sig { params(limit: Integer).void }
34
+ attr_writer :limit
35
+
36
+ # The order in which environments are returned. Defaults to `desc`.
37
+ sig { returns(T.nilable(OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol)) }
38
+ attr_reader :order
39
+
40
+ sig { params(order: OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol).void }
41
+ attr_writer :order
42
+
43
+ # The hosting type to list. Defaults to `openai_hosted`.
44
+ sig { returns(T.nilable(OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol)) }
45
+ attr_reader :type
46
+
47
+ sig { params(type: OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol).void }
48
+ attr_writer :type
49
+
50
+ sig do
51
+ params(
52
+
53
+ after: String,
54
+
55
+ limit: Integer,
56
+
57
+ order: OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol,
58
+
59
+ type: OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol,
60
+
61
+ request_options: OpenAI::RequestOptions::OrHash
62
+ )
63
+ .returns(T.attached_class)
64
+ end
65
+ def self.new(
66
+
67
+ # Return environments after this environment ID in the selected order.
68
+ after: nil,
69
+
70
+ # The maximum number of environments to return, between 1 and 100. Defaults to 20.
71
+ limit: nil,
72
+
73
+ # The order in which environments are returned. Defaults to `desc`.
74
+ order: nil,
75
+
76
+ # The hosting type to list. Defaults to `openai_hosted`.
77
+ type: nil,
78
+
79
+ request_options: {}
80
+ )
81
+ end
82
+
83
+ sig do
84
+ override.returns(
85
+ {
86
+ after: String,
87
+ limit: Integer,
88
+ order: OpenAI::Beta::Agents::EnvironmentListParams::Order::OrSymbol,
89
+ type: OpenAI::Beta::Agents::EnvironmentListParams::Type::OrSymbol,
90
+ request_options: OpenAI::RequestOptions
91
+ }
92
+ )
93
+ end
94
+ def to_hash
95
+ end
96
+
97
+ # The order in which environments are returned. Defaults to `desc`.
98
+ module Order
99
+ extend OpenAI::Internal::Type::Enum
100
+
101
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::Agents::EnvironmentListParams::Order) }
102
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
103
+
104
+ # Returns resources in ascending order.
105
+ ASC = T.let(:asc, OpenAI::Beta::Agents::EnvironmentListParams::Order::TaggedSymbol)
106
+
107
+ # Returns resources in descending order.
108
+ DESC = T.let(:desc, OpenAI::Beta::Agents::EnvironmentListParams::Order::TaggedSymbol)
109
+
110
+ sig { override.returns(T::Array[OpenAI::Beta::Agents::EnvironmentListParams::Order::TaggedSymbol]) }
111
+ def self.values
112
+ end
113
+ end
114
+
115
+ # The hosting type to list. Defaults to `openai_hosted`.
116
+ module Type
117
+ extend OpenAI::Internal::Type::Enum
118
+
119
+ TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Beta::Agents::EnvironmentListParams::Type) }
120
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
121
+
122
+ OPENAI_HOSTED = T.let(:openai_hosted, OpenAI::Beta::Agents::EnvironmentListParams::Type::TaggedSymbol)
123
+
124
+ sig { override.returns(T::Array[OpenAI::Beta::Agents::EnvironmentListParams::Type::TaggedSymbol]) }
125
+ def self.values
126
+ end
127
+ end
128
+
129
+ end
130
+
131
+ end
132
+
133
+ end
134
+
135
+ end
136
+ end
@@ -91,6 +91,14 @@ module OpenAI
91
91
  sig { returns(T.nilable(T::Hash[Symbol, String])) }
92
92
  attr_accessor :env
93
93
 
94
+ # An existing prewarmed environment. Cannot be combined with a template or inline
95
+ # configuration.
96
+ sig { returns(T.nilable(String)) }
97
+ attr_reader :environment_id
98
+
99
+ sig { params(environment_id: String).void }
100
+ attr_writer :environment_id
101
+
94
102
  # A reusable hosted template applied before inline session configuration. Omitted
95
103
  # fields inherit the template; network overrides cannot broaden its policy.
96
104
  sig { returns(T.nilable(String)) }
@@ -161,6 +169,8 @@ module OpenAI
161
169
 
162
170
  env: T.nilable(T::Hash[Symbol, String]),
163
171
 
172
+ environment_id: String,
173
+
164
174
  environment_template_id: String,
165
175
 
166
176
  files: T.nilable(
@@ -209,6 +219,10 @@ module OpenAI
209
219
  # Environment variables made available to the agent.
210
220
  env: nil,
211
221
 
222
+ # An existing prewarmed environment. Cannot be combined with a template or inline
223
+ # configuration.
224
+ environment_id: nil,
225
+
212
226
  # A reusable hosted template applied before inline session configuration. Omitted
213
227
  # fields inherit the template; network overrides cannot broaden its policy.
214
228
  environment_template_id: nil,
@@ -247,6 +261,7 @@ module OpenAI
247
261
  container_size: OpenAI::Beta::EnvironmentParam::OpenAIHosted::ContainerSize::OrSymbol,
248
262
  desktop: T.nilable(OpenAI::Beta::EnvironmentParam::OpenAIHosted::Desktop),
249
263
  env: T.nilable(T::Hash[Symbol, String]),
264
+ environment_id: String,
250
265
  environment_template_id: String,
251
266
  files: T.nilable(
252
267
  T::Array[
@@ -25,7 +25,7 @@ module OpenAI
25
25
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
26
26
  # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
27
27
  # for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
28
- # samples. Voices created from text prompts are supported only in Live.
28
+ # samples.
29
29
  sig {
30
30
  returns(
31
31
  T.any(
@@ -63,7 +63,7 @@ module OpenAI
63
63
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
64
64
  # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
65
65
  # for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
66
- # samples. Voices created from text prompts are supported only in Live.
66
+ # samples.
67
67
 
68
68
  voice:
69
69
  )
@@ -108,7 +108,7 @@ module OpenAI
108
108
  # `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, `shimmer`,
109
109
  # `marin`, and `cedar`. You may also provide a custom voice object with an `id`,
110
110
  # for example `{ "id": "voice_1234" }`. Custom voices must be created from audio
111
- # samples. Voices created from text prompts are supported only in Live.
111
+ # samples.
112
112
  module Voice
113
113
  extend OpenAI::Internal::Type::Union
114
114
 
@@ -58,8 +58,7 @@ module OpenAI
58
58
  # `cedar`. You may also provide a custom voice object with an `id`, for example
59
59
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
60
60
  # model has responded with audio at least once. Custom voices must be created from
61
- # audio samples. Voices created from text prompts are supported only in Live. We
62
- # recommend `marin` and `cedar` for best quality.
61
+ # audio samples. We recommend `marin` and `cedar` for best quality.
63
62
  sig {
64
63
  returns(
65
64
  T.nilable(
@@ -123,8 +122,7 @@ module OpenAI
123
122
  # `cedar`. You may also provide a custom voice object with an `id`, for example
124
123
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
125
124
  # model has responded with audio at least once. Custom voices must be created from
126
- # audio samples. Voices created from text prompts are supported only in Live. We
127
- # recommend `marin` and `cedar` for best quality.
125
+ # audio samples. We recommend `marin` and `cedar` for best quality.
128
126
 
129
127
  voice: nil
130
128
  )
@@ -155,8 +153,7 @@ module OpenAI
155
153
  # `cedar`. You may also provide a custom voice object with an `id`, for example
156
154
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
157
155
  # model has responded with audio at least once. Custom voices must be created from
158
- # audio samples. Voices created from text prompts are supported only in Live. We
159
- # recommend `marin` and `cedar` for best quality.
156
+ # audio samples. We recommend `marin` and `cedar` for best quality.
160
157
  module Voice
161
158
  extend OpenAI::Internal::Type::Union
162
159
 
@@ -81,8 +81,7 @@ module OpenAI
81
81
  # `cedar`. You may also provide a custom voice object with an `id`, for example
82
82
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
83
83
  # model has responded with audio at least once. Custom voices must be created from
84
- # audio samples. Voices created from text prompts are supported only in Live. We
85
- # recommend `marin` and `cedar` for best quality.
84
+ # audio samples. We recommend `marin` and `cedar` for best quality.
86
85
  sig {
87
86
  returns(
88
87
  T.nilable(
@@ -135,8 +134,7 @@ module OpenAI
135
134
  # `cedar`. You may also provide a custom voice object with an `id`, for example
136
135
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
137
136
  # model has responded with audio at least once. Custom voices must be created from
138
- # audio samples. Voices created from text prompts are supported only in Live. We
139
- # recommend `marin` and `cedar` for best quality.
137
+ # audio samples. We recommend `marin` and `cedar` for best quality.
140
138
 
141
139
  voice: nil
142
140
  )
@@ -166,8 +164,7 @@ module OpenAI
166
164
  # `cedar`. You may also provide a custom voice object with an `id`, for example
167
165
  # `{ "id": "voice_1234" }`. Voice cannot be changed during the session once the
168
166
  # model has responded with audio at least once. Custom voices must be created from
169
- # audio samples. Voices created from text prompts are supported only in Live. We
170
- # recommend `marin` and `cedar` for best quality.
167
+ # audio samples. We recommend `marin` and `cedar` for best quality.
171
168
  module Voice
172
169
  extend OpenAI::Internal::Type::Union
173
170
 
@@ -0,0 +1,134 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Webhooks
7
+
8
+ class AgentEnvironmentFailedWebhookEvent < OpenAI::Internal::Type::BaseModel
9
+
10
+ OrHash = T.type_alias do
11
+ T.any(
12
+ OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
13
+ OpenAI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The unique ID of the event.
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # The Unix timestamp, in seconds, when the event was created.
22
+ sig { returns(Integer) }
23
+ attr_accessor :created_at
24
+
25
+ # Identifies the environment whose lifecycle changed.
26
+ sig { returns(OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data) }
27
+ attr_reader :data
28
+
29
+ sig { params(data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data::OrHash).void }
30
+ attr_writer :data
31
+
32
+ # The object type. Always `event`.
33
+ sig { returns(Symbol) }
34
+ attr_accessor :object
35
+
36
+ # The event type. Always `agent.environment.failed`.
37
+ sig { returns(Symbol) }
38
+ attr_accessor :type
39
+
40
+ # Sent when setup fails for a prewarmed OpenAI-hosted environment before it is
41
+ # attached to a session.
42
+ sig do
43
+ params(
44
+
45
+ id: String,
46
+
47
+ created_at: Integer,
48
+
49
+ data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data::OrHash,
50
+
51
+ object: Symbol,
52
+
53
+ type: Symbol
54
+ )
55
+ .returns(T.attached_class)
56
+ end
57
+ def self.new(
58
+
59
+ # The unique ID of the event.
60
+ id:,
61
+
62
+ # The Unix timestamp, in seconds, when the event was created.
63
+ created_at:,
64
+
65
+ # Identifies the environment whose lifecycle changed.
66
+ data:,
67
+
68
+ # The object type. Always `event`.
69
+ object: :event,
70
+
71
+ # The event type. Always `agent.environment.failed`.
72
+
73
+ type: :"agent.environment.failed"
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ id: String,
81
+ created_at: Integer,
82
+ data: OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data,
83
+ object: Symbol,
84
+ type: Symbol
85
+ }
86
+ )
87
+ end
88
+ def to_hash
89
+ end
90
+
91
+ class Data < OpenAI::Internal::Type::BaseModel
92
+ OrHash = T.type_alias do
93
+ T.any(
94
+ OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent::Data,
95
+ OpenAI::Internal::AnyHash
96
+ )
97
+ end
98
+
99
+ # The ID of the environment.
100
+ sig { returns(String) }
101
+ attr_accessor :id
102
+
103
+ # Identifies the environment whose lifecycle changed.
104
+ sig do
105
+ params(
106
+
107
+ id: String
108
+ )
109
+ .returns(T.attached_class)
110
+ end
111
+ def self.new(
112
+
113
+ # The ID of the environment.
114
+
115
+ id:
116
+ )
117
+ end
118
+
119
+ sig do
120
+ override.returns(
121
+ {id: String}
122
+ )
123
+ end
124
+ def to_hash
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+
131
+ end
132
+
133
+ end
134
+ end
@@ -0,0 +1,134 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Webhooks
7
+
8
+ class AgentEnvironmentReadyWebhookEvent < OpenAI::Internal::Type::BaseModel
9
+
10
+ OrHash = T.type_alias do
11
+ T.any(
12
+ OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
13
+ OpenAI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ # The unique ID of the event.
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ # The Unix timestamp, in seconds, when the event was created.
22
+ sig { returns(Integer) }
23
+ attr_accessor :created_at
24
+
25
+ # Identifies the environment whose lifecycle changed.
26
+ sig { returns(OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data) }
27
+ attr_reader :data
28
+
29
+ sig { params(data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data::OrHash).void }
30
+ attr_writer :data
31
+
32
+ # The object type. Always `event`.
33
+ sig { returns(Symbol) }
34
+ attr_accessor :object
35
+
36
+ # The event type. Always `agent.environment.ready`.
37
+ sig { returns(Symbol) }
38
+ attr_accessor :type
39
+
40
+ # Sent when a prewarmed OpenAI-hosted environment finishes setup before being
41
+ # attached to a session.
42
+ sig do
43
+ params(
44
+
45
+ id: String,
46
+
47
+ created_at: Integer,
48
+
49
+ data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data::OrHash,
50
+
51
+ object: Symbol,
52
+
53
+ type: Symbol
54
+ )
55
+ .returns(T.attached_class)
56
+ end
57
+ def self.new(
58
+
59
+ # The unique ID of the event.
60
+ id:,
61
+
62
+ # The Unix timestamp, in seconds, when the event was created.
63
+ created_at:,
64
+
65
+ # Identifies the environment whose lifecycle changed.
66
+ data:,
67
+
68
+ # The object type. Always `event`.
69
+ object: :event,
70
+
71
+ # The event type. Always `agent.environment.ready`.
72
+
73
+ type: :"agent.environment.ready"
74
+ )
75
+ end
76
+
77
+ sig do
78
+ override.returns(
79
+ {
80
+ id: String,
81
+ created_at: Integer,
82
+ data: OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data,
83
+ object: Symbol,
84
+ type: Symbol
85
+ }
86
+ )
87
+ end
88
+ def to_hash
89
+ end
90
+
91
+ class Data < OpenAI::Internal::Type::BaseModel
92
+ OrHash = T.type_alias do
93
+ T.any(
94
+ OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent::Data,
95
+ OpenAI::Internal::AnyHash
96
+ )
97
+ end
98
+
99
+ # The ID of the environment.
100
+ sig { returns(String) }
101
+ attr_accessor :id
102
+
103
+ # Identifies the environment whose lifecycle changed.
104
+ sig do
105
+ params(
106
+
107
+ id: String
108
+ )
109
+ .returns(T.attached_class)
110
+ end
111
+ def self.new(
112
+
113
+ # The ID of the environment.
114
+
115
+ id:
116
+ )
117
+ end
118
+
119
+ sig do
120
+ override.returns(
121
+ {id: String}
122
+ )
123
+ end
124
+ def to_hash
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+
131
+ end
132
+
133
+ end
134
+ end
@@ -5,13 +5,15 @@ module OpenAI
5
5
 
6
6
  module Webhooks
7
7
 
8
- # Sent when an agent session requires an action. Retrieve the session for action
9
- # details.
8
+ # Sent when setup fails for a prewarmed OpenAI-hosted environment before it is
9
+ # attached to a session.
10
10
  module UnwrapWebhookEvent
11
11
  extend OpenAI::Internal::Type::Union
12
12
 
13
13
  Variants = T.type_alias do
14
14
  T.any(
15
+ OpenAI::Webhooks::AgentEnvironmentFailedWebhookEvent,
16
+ OpenAI::Webhooks::AgentEnvironmentReadyWebhookEvent,
15
17
  OpenAI::Webhooks::AgentSessionActionRequiredWebhookEvent,
16
18
  OpenAI::Webhooks::AgentSessionCreatedWebhookEvent,
17
19
  OpenAI::Webhooks::AgentSessionFailedWebhookEvent,
@@ -121,6 +121,14 @@ module OpenAI
121
121
  )
122
122
  VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
123
123
  VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol)
124
+ AGENT_ENVIRONMENT_READY = T.let(
125
+ :"agent.environment.ready",
126
+ OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
127
+ )
128
+ AGENT_ENVIRONMENT_FAILED = T.let(
129
+ :"agent.environment.failed",
130
+ OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
131
+ )
124
132
  AGENT_SESSION_CREATED = T.let(
125
133
  :"agent.session.created",
126
134
  OpenAI::Webhooks::WebhookCreateParams::EventType::TaggedSymbol
@@ -106,6 +106,14 @@ module OpenAI
106
106
  )
107
107
  VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol)
108
108
  VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol)
109
+ AGENT_ENVIRONMENT_READY = T.let(
110
+ :"agent.environment.ready",
111
+ OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
112
+ )
113
+ AGENT_ENVIRONMENT_FAILED = T.let(
114
+ :"agent.environment.failed",
115
+ OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
116
+ )
109
117
  AGENT_SESSION_CREATED = T.let(
110
118
  :"agent.session.created",
111
119
  OpenAI::Webhooks::WebhookTestParams::EventType::TaggedSymbol
@@ -138,6 +138,14 @@ module OpenAI
138
138
  )
139
139
  VIDEO_COMPLETED = T.let(:"video.completed", OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol)
140
140
  VIDEO_FAILED = T.let(:"video.failed", OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol)
141
+ AGENT_ENVIRONMENT_READY = T.let(
142
+ :"agent.environment.ready",
143
+ OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
144
+ )
145
+ AGENT_ENVIRONMENT_FAILED = T.let(
146
+ :"agent.environment.failed",
147
+ OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
148
+ )
141
149
  AGENT_SESSION_CREATED = T.let(
142
150
  :"agent.session.created",
143
151
  OpenAI::Webhooks::WebhookUpdateParams::EventType::TaggedSymbol
@@ -41,8 +41,7 @@ module OpenAI
41
41
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
42
42
  # voices are available in the
43
43
  # [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
44
- # Custom voices must be created from audio samples. Voices created from text
45
- # prompts are supported only in Live.
44
+ # Custom voices must be created from audio samples.
46
45
  voice:,
47
46
  # Control the voice of your generated audio with additional instructions. Does not
48
47
  # work with `tts-1` or `tts-1-hd`.
@@ -8,23 +8,20 @@ module OpenAI
8
8
  # Turn audio into text or text into audio.
9
9
  class Voices
10
10
 
11
- # Creates a voice from a text prompt or from a consent recording and an audio
12
- # sample.
11
+ # Create a custom voice you can use for audio output (for example, in
12
+ # Text-to-Speech and the Realtime API). This requires an audio sample and a
13
+ # previously uploaded consent recording.
13
14
  #
14
- # For prompt-based creation, send `type: "prompt"` with a `name` and `prompt` as
15
- # JSON or multipart form data. For creation from an audio sample, send
16
- # `type: "audio_sample"` with a `name`, `audio_sample`, and `consent` recording ID
17
- # as multipart form data. The type defaults to `audio_sample` when omitted.
15
+ # Send `name`, `audio_sample`, and the `consent` recording ID as multipart form
16
+ # data. The optional `type` defaults to `audio_sample`.
18
17
  #
19
- # Returns the saved voice's metadata. Voices created from text prompts are
20
- # supported only in Live, not in Realtime or the speech endpoint. The response
21
- # does not include preview audio.
18
+ # Returns the saved voice's metadata. See the
19
+ # [custom voices guide](https://developers.openai.com/api/docs/guides/text-to-speech#custom-voices)
20
+ # for requirements and best practices. Custom voices are limited to eligible
21
+ # customers.
22
22
  sig {
23
23
  params(
24
- body: T.any(
25
- OpenAI::Audio::VoiceCreateParams::Body::AudioSample::OrHash,
26
- OpenAI::Audio::VoiceCreateParams::Body::Prompt::OrHash
27
- ),
24
+ body: OpenAI::Audio::VoiceCreateParams::Body::AudioSample::OrHash,
28
25
  request_options: OpenAI::RequestOptions::OrHash
29
26
  )
30
27
  .returns(OpenAI::Audio::Voice)