openai 0.98.0 → 0.99.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 (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
  5. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
  6. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
  7. data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
  8. data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
  9. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
  10. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
  11. data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
  12. data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
  13. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
  14. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
  15. data/lib/openai/models/all_models.rb +42 -0
  16. data/lib/openai/models/audio/speech_create_params.rb +6 -0
  17. data/lib/openai/models/audio/voice.rb +75 -0
  18. data/lib/openai/models/audio/voice_create_params.rb +217 -0
  19. data/lib/openai/models/beta/agent_create_params.rb +0 -3
  20. data/lib/openai/models/beta/agent_update_params.rb +0 -3
  21. data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
  22. data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
  23. data/lib/openai/models/beta/beta_response.rb +220 -0
  24. data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
  25. data/lib/openai/models/beta/beta_tool.rb +3 -9
  26. data/lib/openai/models/beta/response_compact_params.rb +220 -0
  27. data/lib/openai/models/beta/response_create_params.rb +220 -0
  28. data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
  29. data/lib/openai/models/chat_model.rb +178 -0
  30. data/lib/openai/models/image.rb +14 -14
  31. data/lib/openai/models/image_create_variation_params.rb +7 -7
  32. data/lib/openai/models/image_edit_params.rb +76 -87
  33. data/lib/openai/models/image_generate_params.rb +51 -62
  34. data/lib/openai/models/image_model.rb +5 -3
  35. data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
  36. data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
  37. data/lib/openai/models/responses/response_compact_params.rb +220 -0
  38. data/lib/openai/models/responses/tool.rb +3 -9
  39. data/lib/openai/models/responses_model.rb +42 -0
  40. data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
  41. data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
  42. data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
  43. data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
  44. data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
  45. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
  46. data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
  47. data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
  48. data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
  49. data/lib/openai/resources/audio/speech.rb +2 -0
  50. data/lib/openai/resources/audio/voices.rb +53 -0
  51. data/lib/openai/resources/audio.rb +5 -0
  52. data/lib/openai/resources/images.rb +71 -103
  53. data/lib/openai/resources/webhooks.rb +1 -1
  54. data/lib/openai/version.rb +1 -1
  55. data/lib/openai.rb +8 -0
  56. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
  57. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
  58. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
  59. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
  60. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
  61. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
  62. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
  63. data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
  64. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
  65. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
  66. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
  67. data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
  68. data/rbi/openai/models/audio/voice.rbi +111 -0
  69. data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
  70. data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
  71. data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
  72. data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
  73. data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
  74. data/rbi/openai/models/beta/beta_tool.rbi +3 -9
  75. data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
  76. data/rbi/openai/models/image.rbi +14 -14
  77. data/rbi/openai/models/image_create_variation_params.rbi +6 -6
  78. data/rbi/openai/models/image_edit_params.rbi +61 -82
  79. data/rbi/openai/models/image_generate_params.rbi +30 -61
  80. data/rbi/openai/models/image_model.rbi +3 -3
  81. data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
  82. data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
  83. data/rbi/openai/models/responses/tool.rbi +3 -9
  84. data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
  85. data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
  86. data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
  87. data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
  88. data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
  89. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
  90. data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
  91. data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
  92. data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
  93. data/rbi/openai/resources/audio/speech.rbi +2 -0
  94. data/rbi/openai/resources/audio/voices.rbi +49 -0
  95. data/rbi/openai/resources/audio.rbi +4 -0
  96. data/rbi/openai/resources/images.rbi +69 -103
  97. data/rbi/openai/resources/webhooks.rbi +5 -0
  98. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
  99. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
  100. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
  101. data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
  102. data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
  103. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
  104. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
  105. data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
  106. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
  107. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
  108. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
  109. data/sig/openai/models/audio/speech_create_params.rbs +4 -0
  110. data/sig/openai/models/audio/voice.rbs +70 -0
  111. data/sig/openai/models/audio/voice_create_params.rbs +203 -0
  112. data/sig/openai/models/beta/agent_create_params.rbs +1 -5
  113. data/sig/openai/models/beta/agent_update_params.rbs +1 -5
  114. data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
  115. data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
  116. data/sig/openai/models/beta/beta_tool.rbs +3 -9
  117. data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
  118. data/sig/openai/models/image.rbs +21 -21
  119. data/sig/openai/models/image_create_variation_params.rbs +4 -4
  120. data/sig/openai/models/image_edit_params.rbs +46 -60
  121. data/sig/openai/models/image_generate_params.rbs +23 -45
  122. data/sig/openai/models/image_model.rbs +6 -6
  123. data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
  124. data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
  125. data/sig/openai/models/responses/tool.rbs +3 -9
  126. data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
  127. data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
  128. data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
  129. data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
  130. data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
  131. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
  132. data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
  133. data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
  134. data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
  135. data/sig/openai/resources/audio/voices.rbs +14 -0
  136. data/sig/openai/resources/audio.rbs +2 -0
  137. data/sig/openai/resources/webhooks.rbs +6 -1
  138. metadata +25 -1
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -89,6 +89,7 @@ module OpenAI
89
89
  ?api_key_id: String?,
90
90
  ?batch: bool?,
91
91
  ?input_audio_tokens: Integer,
92
+ ?:input_cache_write_12h_tokens => Integer,
92
93
  ?input_cache_write_tokens: Integer,
93
94
  ?input_cached_audio_tokens: Integer,
94
95
  ?input_cached_image_tokens: Integer,
@@ -136,10 +137,20 @@ module OpenAI
136
137
  # The aggregated number of uncached audio input tokens used.
137
138
  def input_audio_tokens=: (Integer) -> Integer
138
139
 
139
- # The aggregated number of input tokens written to the cache.
140
+ # The aggregated number of input tokens written to the cache with a 12-hour
141
+ # retention period.
142
+ attr_reader input_cache_write_12h_tokens: Integer?
143
+
144
+ # The aggregated number of input tokens written to the cache with a 12-hour
145
+ # retention period.
146
+ def input_cache_write_12h_tokens=: (Integer) -> Integer
147
+
148
+ # The aggregated number of input tokens written to the cache with a 30-minute
149
+ # retention period.
140
150
  attr_reader input_cache_write_tokens: Integer?
141
151
 
142
- # The aggregated number of input tokens written to the cache.
152
+ # The aggregated number of input tokens written to the cache with a 30-minute
153
+ # retention period.
143
154
  def input_cache_write_tokens=: (Integer) -> Integer
144
155
 
145
156
  # The aggregated number of cached audio input tokens used.
@@ -242,8 +253,12 @@ module OpenAI
242
253
  # batch or not.
243
254
  # @param input_audio_tokens
244
255
  # The aggregated number of uncached audio input tokens used.
256
+ # @param input_cache_write_12h_tokens
257
+ # The aggregated number of input tokens written to the cache with a 12-hour
258
+ # retention period.
245
259
  # @param input_cache_write_tokens
246
- # The aggregated number of input tokens written to the cache.
260
+ # The aggregated number of input tokens written to the cache with a 30-minute
261
+ # retention period.
247
262
  # @param input_cached_audio_tokens
248
263
  # The aggregated number of cached audio input tokens used.
249
264
  # @param input_cached_image_tokens
@@ -286,6 +301,7 @@ module OpenAI
286
301
  ?api_key_id: String?,
287
302
  ?batch: bool?,
288
303
  ?input_audio_tokens: Integer,
304
+ ?input_cache_write_12h_tokens: Integer,
289
305
  ?input_cache_write_tokens: Integer,
290
306
  ?input_cached_audio_tokens: Integer,
291
307
  ?input_cached_image_tokens: Integer,
@@ -312,6 +328,7 @@ module OpenAI
312
328
  ?api_key_id: String?,
313
329
  ?batch: bool?,
314
330
  ?input_audio_tokens: Integer,
331
+ ?:input_cache_write_12h_tokens => Integer,
315
332
  ?input_cache_write_tokens: Integer,
316
333
  ?input_cached_audio_tokens: Integer,
317
334
  ?input_cached_image_tokens: Integer,
@@ -31,6 +31,8 @@ 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
36
  attr_accessor voice: OpenAI::Models::Audio::SpeechCreateParams::voice
35
37
 
36
38
  # Control the voice of your generated audio with additional instructions. Does not
@@ -82,6 +84,8 @@ module OpenAI
82
84
  # object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
83
85
  # voices are available in the
84
86
  # [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.
85
89
  # @param instructions
86
90
  # Control the voice of your generated audio with additional instructions. Does not
87
91
  # work with `tts-1` or `tts-1-hd`.
@@ -0,0 +1,70 @@
1
+ module OpenAI
2
+ module Models
3
+ module Audio
4
+ type voice =
5
+ {
6
+ id: String,
7
+ created_at: Integer,
8
+ name: String,
9
+ ?object: :"audio.voice",
10
+ type: OpenAI::Models::Audio::Voice::type_
11
+ }
12
+
13
+ class Voice < OpenAI::Internal::Type::BaseModel
14
+ # The voice identifier, which can be referenced in API endpoints.
15
+ attr_accessor id: String
16
+
17
+ # The Unix timestamp (in seconds) for when the voice was created.
18
+ attr_accessor created_at: Integer
19
+
20
+ # The name of the voice.
21
+ attr_accessor name: String
22
+
23
+ # The object type, which is always `audio.voice`.
24
+ attr_accessor object: :"audio.voice"
25
+
26
+ # How the voice was created. Voices created from text prompts are supported only
27
+ # in Live.
28
+ attr_accessor type: OpenAI::Models::Audio::Voice::type_
29
+
30
+ # @param id
31
+ # The voice identifier, which can be referenced in API endpoints.
32
+ # @param created_at
33
+ # The Unix timestamp (in seconds) for when the voice was created.
34
+ # @param name
35
+ # The name of the voice.
36
+ # @param type
37
+ # How the voice was created. Voices created from text prompts are supported only
38
+ # in Live.
39
+ # @param object
40
+ # The object type, which is always `audio.voice`.
41
+ def initialize: (
42
+ id: String,
43
+ created_at: Integer,
44
+ name: String,
45
+ type: OpenAI::Models::Audio::Voice::type_,
46
+ ?object: :"audio.voice"
47
+ ) -> void
48
+
49
+ def to_hash: -> {
50
+ id: String,
51
+ created_at: Integer,
52
+ name: String,
53
+ ?object: :"audio.voice",
54
+ type: OpenAI::Models::Audio::Voice::type_
55
+ }
56
+
57
+ type type_ = :audio_sample | :prompt
58
+
59
+ module Type
60
+ extend OpenAI::Internal::Type::Enum
61
+
62
+ AUDIO_SAMPLE: :audio_sample
63
+ PROMPT: :prompt
64
+
65
+ def self?.values: -> ::Array[OpenAI::Models::Audio::Voice::type_]
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end