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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_completions_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_costs_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_images_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +16 -3
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +16 -3
- data/lib/openai/models/all_models.rb +42 -0
- data/lib/openai/models/audio/speech_create_params.rb +6 -0
- data/lib/openai/models/audio/voice.rb +75 -0
- data/lib/openai/models/audio/voice_create_params.rb +217 -0
- data/lib/openai/models/beta/agent_create_params.rb +0 -3
- data/lib/openai/models/beta/agent_update_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_create_params.rb +0 -3
- data/lib/openai/models/beta/agents/session_update_params.rb +0 -3
- data/lib/openai/models/beta/beta_response.rb +220 -0
- data/lib/openai/models/beta/beta_responses_client_event.rb +220 -0
- data/lib/openai/models/beta/beta_tool.rb +3 -9
- data/lib/openai/models/beta/response_compact_params.rb +220 -0
- data/lib/openai/models/beta/response_create_params.rb +220 -0
- data/lib/openai/models/chat/chat_completion_audio_param.rb +6 -3
- data/lib/openai/models/chat_model.rb +178 -0
- data/lib/openai/models/image.rb +14 -14
- data/lib/openai/models/image_create_variation_params.rb +7 -7
- data/lib/openai/models/image_edit_params.rb +76 -87
- data/lib/openai/models/image_generate_params.rb +51 -62
- data/lib/openai/models/image_model.rb +5 -3
- data/lib/openai/models/realtime/realtime_audio_config_output.rb +9 -6
- data/lib/openai/models/realtime/realtime_response_create_audio_output.rb +9 -6
- data/lib/openai/models/responses/response_compact_params.rb +220 -0
- data/lib/openai/models/responses/tool.rb +3 -9
- data/lib/openai/models/responses_model.rb +42 -0
- data/lib/openai/models/webhooks/agent_session_action_required_webhook_event.rb +109 -0
- data/lib/openai/models/webhooks/agent_session_created_webhook_event.rb +106 -0
- data/lib/openai/models/webhooks/agent_session_failed_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_idle_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/agent_session_in_progress_webhook_event.rb +86 -0
- data/lib/openai/models/webhooks/unwrap_webhook_event.rb +18 -2
- data/lib/openai/models/webhooks/webhook_create_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_test_params.rb +5 -0
- data/lib/openai/models/webhooks/webhook_update_params.rb +5 -0
- data/lib/openai/resources/audio/speech.rb +2 -0
- data/lib/openai/resources/audio/voices.rb +53 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/resources/images.rb +71 -103
- data/lib/openai/resources/webhooks.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +19 -2
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +19 -2
- data/rbi/openai/models/audio/speech_create_params.rbi +6 -0
- data/rbi/openai/models/audio/voice.rbi +111 -0
- data/rbi/openai/models/audio/voice_create_params.rbi +321 -0
- data/rbi/openai/models/beta/agent_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agent_update_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_create_params.rbi +0 -3
- data/rbi/openai/models/beta/agents/session_update_params.rbi +0 -3
- data/rbi/openai/models/beta/beta_tool.rbi +3 -9
- data/rbi/openai/models/chat/chat_completion_audio_param.rbi +6 -3
- data/rbi/openai/models/image.rbi +14 -14
- data/rbi/openai/models/image_create_variation_params.rbi +6 -6
- data/rbi/openai/models/image_edit_params.rbi +61 -82
- data/rbi/openai/models/image_generate_params.rbi +30 -61
- data/rbi/openai/models/image_model.rbi +3 -3
- data/rbi/openai/models/realtime/realtime_audio_config_output.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_response_create_audio_output.rbi +9 -6
- data/rbi/openai/models/responses/tool.rbi +3 -9
- data/rbi/openai/models/webhooks/agent_session_action_required_webhook_event.rbi +222 -0
- data/rbi/openai/models/webhooks/agent_session_created_webhook_event.rbi +202 -0
- data/rbi/openai/models/webhooks/agent_session_failed_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_idle_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/agent_session_in_progress_webhook_event.rbi +151 -0
- data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +7 -1
- data/rbi/openai/models/webhooks/webhook_create_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_test_params.rbi +20 -0
- data/rbi/openai/models/webhooks/webhook_update_params.rbi +20 -0
- data/rbi/openai/resources/audio/speech.rbi +2 -0
- data/rbi/openai/resources/audio/voices.rbi +49 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/rbi/openai/resources/images.rbi +69 -103
- data/rbi/openai/resources/webhooks.rbi +5 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_images_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +20 -3
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +20 -3
- data/sig/openai/models/audio/speech_create_params.rbs +4 -0
- data/sig/openai/models/audio/voice.rbs +70 -0
- data/sig/openai/models/audio/voice_create_params.rbs +203 -0
- data/sig/openai/models/beta/agent_create_params.rbs +1 -5
- data/sig/openai/models/beta/agent_update_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_create_params.rbs +1 -5
- data/sig/openai/models/beta/agents/session_update_params.rbs +1 -5
- data/sig/openai/models/beta/beta_tool.rbs +3 -9
- data/sig/openai/models/chat/chat_completion_audio_param.rbs +4 -2
- data/sig/openai/models/image.rbs +21 -21
- data/sig/openai/models/image_create_variation_params.rbs +4 -4
- data/sig/openai/models/image_edit_params.rbs +46 -60
- data/sig/openai/models/image_generate_params.rbs +23 -45
- data/sig/openai/models/image_model.rbs +6 -6
- data/sig/openai/models/realtime/realtime_audio_config_output.rbs +9 -6
- data/sig/openai/models/realtime/realtime_response_create_audio_output.rbs +9 -6
- data/sig/openai/models/responses/tool.rbs +3 -9
- data/sig/openai/models/webhooks/agent_session_action_required_webhook_event.rbs +114 -0
- data/sig/openai/models/webhooks/agent_session_created_webhook_event.rbs +115 -0
- data/sig/openai/models/webhooks/agent_session_failed_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_idle_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/agent_session_in_progress_webhook_event.rbs +89 -0
- data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +6 -1
- data/sig/openai/models/webhooks/webhook_create_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_test_params.rbs +10 -0
- data/sig/openai/models/webhooks/webhook_update_params.rbs +10 -0
- data/sig/openai/resources/audio/voices.rbs +14 -0
- data/sig/openai/resources/audio.rbs +2 -0
- data/sig/openai/resources/webhooks.rbs +6 -1
- metadata +25 -1
|
@@ -206,7 +206,16 @@ module OpenAI
|
|
|
206
206
|
sig { params(input_audio_tokens: Integer).void }
|
|
207
207
|
attr_writer :input_audio_tokens
|
|
208
208
|
|
|
209
|
-
# The aggregated number of input tokens written to the cache
|
|
209
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
210
|
+
# retention period.
|
|
211
|
+
sig { returns(T.nilable(Integer)) }
|
|
212
|
+
attr_reader :input_cache_write_12h_tokens
|
|
213
|
+
|
|
214
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
215
|
+
attr_writer :input_cache_write_12h_tokens
|
|
216
|
+
|
|
217
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
218
|
+
# retention period.
|
|
210
219
|
sig { returns(T.nilable(Integer)) }
|
|
211
220
|
attr_reader :input_cache_write_tokens
|
|
212
221
|
|
|
@@ -322,6 +331,8 @@ module OpenAI
|
|
|
322
331
|
|
|
323
332
|
input_audio_tokens: Integer,
|
|
324
333
|
|
|
334
|
+
input_cache_write_12h_tokens: Integer,
|
|
335
|
+
|
|
325
336
|
input_cache_write_tokens: Integer,
|
|
326
337
|
|
|
327
338
|
input_cached_audio_tokens: Integer,
|
|
@@ -382,7 +393,12 @@ module OpenAI
|
|
|
382
393
|
# The aggregated number of uncached audio input tokens used.
|
|
383
394
|
input_audio_tokens: nil,
|
|
384
395
|
|
|
385
|
-
# The aggregated number of input tokens written to the cache
|
|
396
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
397
|
+
# retention period.
|
|
398
|
+
input_cache_write_12h_tokens: nil,
|
|
399
|
+
|
|
400
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
401
|
+
# retention period.
|
|
386
402
|
input_cache_write_tokens: nil,
|
|
387
403
|
|
|
388
404
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -448,6 +464,7 @@ module OpenAI
|
|
|
448
464
|
api_key_id: T.nilable(String),
|
|
449
465
|
batch: T.nilable(T::Boolean),
|
|
450
466
|
input_audio_tokens: Integer,
|
|
467
|
+
input_cache_write_12h_tokens: Integer,
|
|
451
468
|
input_cache_write_tokens: Integer,
|
|
452
469
|
input_cached_audio_tokens: Integer,
|
|
453
470
|
input_cached_image_tokens: Integer,
|
|
@@ -208,7 +208,16 @@ module OpenAI
|
|
|
208
208
|
sig { params(input_audio_tokens: Integer).void }
|
|
209
209
|
attr_writer :input_audio_tokens
|
|
210
210
|
|
|
211
|
-
# The aggregated number of input tokens written to the cache
|
|
211
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
212
|
+
# retention period.
|
|
213
|
+
sig { returns(T.nilable(Integer)) }
|
|
214
|
+
attr_reader :input_cache_write_12h_tokens
|
|
215
|
+
|
|
216
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
217
|
+
attr_writer :input_cache_write_12h_tokens
|
|
218
|
+
|
|
219
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
220
|
+
# retention period.
|
|
212
221
|
sig { returns(T.nilable(Integer)) }
|
|
213
222
|
attr_reader :input_cache_write_tokens
|
|
214
223
|
|
|
@@ -324,6 +333,8 @@ module OpenAI
|
|
|
324
333
|
|
|
325
334
|
input_audio_tokens: Integer,
|
|
326
335
|
|
|
336
|
+
input_cache_write_12h_tokens: Integer,
|
|
337
|
+
|
|
327
338
|
input_cache_write_tokens: Integer,
|
|
328
339
|
|
|
329
340
|
input_cached_audio_tokens: Integer,
|
|
@@ -384,7 +395,12 @@ module OpenAI
|
|
|
384
395
|
# The aggregated number of uncached audio input tokens used.
|
|
385
396
|
input_audio_tokens: nil,
|
|
386
397
|
|
|
387
|
-
# The aggregated number of input tokens written to the cache
|
|
398
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
399
|
+
# retention period.
|
|
400
|
+
input_cache_write_12h_tokens: nil,
|
|
401
|
+
|
|
402
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
403
|
+
# retention period.
|
|
388
404
|
input_cache_write_tokens: nil,
|
|
389
405
|
|
|
390
406
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -450,6 +466,7 @@ module OpenAI
|
|
|
450
466
|
api_key_id: T.nilable(String),
|
|
451
467
|
batch: T.nilable(T::Boolean),
|
|
452
468
|
input_audio_tokens: Integer,
|
|
469
|
+
input_cache_write_12h_tokens: Integer,
|
|
453
470
|
input_cache_write_tokens: Integer,
|
|
454
471
|
input_cached_audio_tokens: Integer,
|
|
455
472
|
input_cached_image_tokens: Integer,
|
|
@@ -202,7 +202,16 @@ module OpenAI
|
|
|
202
202
|
sig { params(input_audio_tokens: Integer).void }
|
|
203
203
|
attr_writer :input_audio_tokens
|
|
204
204
|
|
|
205
|
-
# The aggregated number of input tokens written to the cache
|
|
205
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
206
|
+
# retention period.
|
|
207
|
+
sig { returns(T.nilable(Integer)) }
|
|
208
|
+
attr_reader :input_cache_write_12h_tokens
|
|
209
|
+
|
|
210
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
211
|
+
attr_writer :input_cache_write_12h_tokens
|
|
212
|
+
|
|
213
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
214
|
+
# retention period.
|
|
206
215
|
sig { returns(T.nilable(Integer)) }
|
|
207
216
|
attr_reader :input_cache_write_tokens
|
|
208
217
|
|
|
@@ -318,6 +327,8 @@ module OpenAI
|
|
|
318
327
|
|
|
319
328
|
input_audio_tokens: Integer,
|
|
320
329
|
|
|
330
|
+
input_cache_write_12h_tokens: Integer,
|
|
331
|
+
|
|
321
332
|
input_cache_write_tokens: Integer,
|
|
322
333
|
|
|
323
334
|
input_cached_audio_tokens: Integer,
|
|
@@ -378,7 +389,12 @@ module OpenAI
|
|
|
378
389
|
# The aggregated number of uncached audio input tokens used.
|
|
379
390
|
input_audio_tokens: nil,
|
|
380
391
|
|
|
381
|
-
# The aggregated number of input tokens written to the cache
|
|
392
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
393
|
+
# retention period.
|
|
394
|
+
input_cache_write_12h_tokens: nil,
|
|
395
|
+
|
|
396
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
397
|
+
# retention period.
|
|
382
398
|
input_cache_write_tokens: nil,
|
|
383
399
|
|
|
384
400
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -444,6 +460,7 @@ module OpenAI
|
|
|
444
460
|
api_key_id: T.nilable(String),
|
|
445
461
|
batch: T.nilable(T::Boolean),
|
|
446
462
|
input_audio_tokens: Integer,
|
|
463
|
+
input_cache_write_12h_tokens: Integer,
|
|
447
464
|
input_cache_write_tokens: Integer,
|
|
448
465
|
input_cached_audio_tokens: Integer,
|
|
449
466
|
input_cached_image_tokens: Integer,
|
|
@@ -206,7 +206,16 @@ module OpenAI
|
|
|
206
206
|
sig { params(input_audio_tokens: Integer).void }
|
|
207
207
|
attr_writer :input_audio_tokens
|
|
208
208
|
|
|
209
|
-
# The aggregated number of input tokens written to the cache
|
|
209
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
210
|
+
# retention period.
|
|
211
|
+
sig { returns(T.nilable(Integer)) }
|
|
212
|
+
attr_reader :input_cache_write_12h_tokens
|
|
213
|
+
|
|
214
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
215
|
+
attr_writer :input_cache_write_12h_tokens
|
|
216
|
+
|
|
217
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
218
|
+
# retention period.
|
|
210
219
|
sig { returns(T.nilable(Integer)) }
|
|
211
220
|
attr_reader :input_cache_write_tokens
|
|
212
221
|
|
|
@@ -322,6 +331,8 @@ module OpenAI
|
|
|
322
331
|
|
|
323
332
|
input_audio_tokens: Integer,
|
|
324
333
|
|
|
334
|
+
input_cache_write_12h_tokens: Integer,
|
|
335
|
+
|
|
325
336
|
input_cache_write_tokens: Integer,
|
|
326
337
|
|
|
327
338
|
input_cached_audio_tokens: Integer,
|
|
@@ -382,7 +393,12 @@ module OpenAI
|
|
|
382
393
|
# The aggregated number of uncached audio input tokens used.
|
|
383
394
|
input_audio_tokens: nil,
|
|
384
395
|
|
|
385
|
-
# The aggregated number of input tokens written to the cache
|
|
396
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
397
|
+
# retention period.
|
|
398
|
+
input_cache_write_12h_tokens: nil,
|
|
399
|
+
|
|
400
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
401
|
+
# retention period.
|
|
386
402
|
input_cache_write_tokens: nil,
|
|
387
403
|
|
|
388
404
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -448,6 +464,7 @@ module OpenAI
|
|
|
448
464
|
api_key_id: T.nilable(String),
|
|
449
465
|
batch: T.nilable(T::Boolean),
|
|
450
466
|
input_audio_tokens: Integer,
|
|
467
|
+
input_cache_write_12h_tokens: Integer,
|
|
451
468
|
input_cache_write_tokens: Integer,
|
|
452
469
|
input_cached_audio_tokens: Integer,
|
|
453
470
|
input_cached_image_tokens: Integer,
|
|
@@ -206,7 +206,16 @@ module OpenAI
|
|
|
206
206
|
sig { params(input_audio_tokens: Integer).void }
|
|
207
207
|
attr_writer :input_audio_tokens
|
|
208
208
|
|
|
209
|
-
# The aggregated number of input tokens written to the cache
|
|
209
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
210
|
+
# retention period.
|
|
211
|
+
sig { returns(T.nilable(Integer)) }
|
|
212
|
+
attr_reader :input_cache_write_12h_tokens
|
|
213
|
+
|
|
214
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
215
|
+
attr_writer :input_cache_write_12h_tokens
|
|
216
|
+
|
|
217
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
218
|
+
# retention period.
|
|
210
219
|
sig { returns(T.nilable(Integer)) }
|
|
211
220
|
attr_reader :input_cache_write_tokens
|
|
212
221
|
|
|
@@ -322,6 +331,8 @@ module OpenAI
|
|
|
322
331
|
|
|
323
332
|
input_audio_tokens: Integer,
|
|
324
333
|
|
|
334
|
+
input_cache_write_12h_tokens: Integer,
|
|
335
|
+
|
|
325
336
|
input_cache_write_tokens: Integer,
|
|
326
337
|
|
|
327
338
|
input_cached_audio_tokens: Integer,
|
|
@@ -382,7 +393,12 @@ module OpenAI
|
|
|
382
393
|
# The aggregated number of uncached audio input tokens used.
|
|
383
394
|
input_audio_tokens: nil,
|
|
384
395
|
|
|
385
|
-
# The aggregated number of input tokens written to the cache
|
|
396
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
397
|
+
# retention period.
|
|
398
|
+
input_cache_write_12h_tokens: nil,
|
|
399
|
+
|
|
400
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
401
|
+
# retention period.
|
|
386
402
|
input_cache_write_tokens: nil,
|
|
387
403
|
|
|
388
404
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -448,6 +464,7 @@ module OpenAI
|
|
|
448
464
|
api_key_id: T.nilable(String),
|
|
449
465
|
batch: T.nilable(T::Boolean),
|
|
450
466
|
input_audio_tokens: Integer,
|
|
467
|
+
input_cache_write_12h_tokens: Integer,
|
|
451
468
|
input_cache_write_tokens: Integer,
|
|
452
469
|
input_cached_audio_tokens: Integer,
|
|
453
470
|
input_cached_image_tokens: Integer,
|
|
@@ -208,7 +208,16 @@ module OpenAI
|
|
|
208
208
|
sig { params(input_audio_tokens: Integer).void }
|
|
209
209
|
attr_writer :input_audio_tokens
|
|
210
210
|
|
|
211
|
-
# The aggregated number of input tokens written to the cache
|
|
211
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
212
|
+
# retention period.
|
|
213
|
+
sig { returns(T.nilable(Integer)) }
|
|
214
|
+
attr_reader :input_cache_write_12h_tokens
|
|
215
|
+
|
|
216
|
+
sig { params(input_cache_write_12h_tokens: Integer).void }
|
|
217
|
+
attr_writer :input_cache_write_12h_tokens
|
|
218
|
+
|
|
219
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
220
|
+
# retention period.
|
|
212
221
|
sig { returns(T.nilable(Integer)) }
|
|
213
222
|
attr_reader :input_cache_write_tokens
|
|
214
223
|
|
|
@@ -324,6 +333,8 @@ module OpenAI
|
|
|
324
333
|
|
|
325
334
|
input_audio_tokens: Integer,
|
|
326
335
|
|
|
336
|
+
input_cache_write_12h_tokens: Integer,
|
|
337
|
+
|
|
327
338
|
input_cache_write_tokens: Integer,
|
|
328
339
|
|
|
329
340
|
input_cached_audio_tokens: Integer,
|
|
@@ -384,7 +395,12 @@ module OpenAI
|
|
|
384
395
|
# The aggregated number of uncached audio input tokens used.
|
|
385
396
|
input_audio_tokens: nil,
|
|
386
397
|
|
|
387
|
-
# The aggregated number of input tokens written to the cache
|
|
398
|
+
# The aggregated number of input tokens written to the cache with a 12-hour
|
|
399
|
+
# retention period.
|
|
400
|
+
input_cache_write_12h_tokens: nil,
|
|
401
|
+
|
|
402
|
+
# The aggregated number of input tokens written to the cache with a 30-minute
|
|
403
|
+
# retention period.
|
|
388
404
|
input_cache_write_tokens: nil,
|
|
389
405
|
|
|
390
406
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -450,6 +466,7 @@ module OpenAI
|
|
|
450
466
|
api_key_id: T.nilable(String),
|
|
451
467
|
batch: T.nilable(T::Boolean),
|
|
452
468
|
input_audio_tokens: Integer,
|
|
469
|
+
input_cache_write_12h_tokens: Integer,
|
|
453
470
|
input_cache_write_tokens: Integer,
|
|
454
471
|
input_cached_audio_tokens: Integer,
|
|
455
472
|
input_cached_image_tokens: Integer,
|
|
@@ -33,6 +33,8 @@ module OpenAI
|
|
|
33
33
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
34
34
|
# voices are available in the
|
|
35
35
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
36
|
+
# Custom voices must be created from audio samples. Voices created from text
|
|
37
|
+
# prompts are supported only in Live.
|
|
36
38
|
sig {
|
|
37
39
|
returns(
|
|
38
40
|
T.any(
|
|
@@ -117,6 +119,8 @@ module OpenAI
|
|
|
117
119
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
118
120
|
# voices are available in the
|
|
119
121
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
122
|
+
# Custom voices must be created from audio samples. Voices created from text
|
|
123
|
+
# prompts are supported only in Live.
|
|
120
124
|
voice:,
|
|
121
125
|
|
|
122
126
|
# Control the voice of your generated audio with additional instructions. Does not
|
|
@@ -180,6 +184,8 @@ module OpenAI
|
|
|
180
184
|
# object with an `id`, for example `{ "id": "voice_1234" }`. Previews of the
|
|
181
185
|
# voices are available in the
|
|
182
186
|
# [Text to speech guide](https://developers.openai.com/api/docs/guides/text-to-speech#voice-options).
|
|
187
|
+
# Custom voices must be created from audio samples. Voices created from text
|
|
188
|
+
# prompts are supported only in Live.
|
|
183
189
|
module Voice
|
|
184
190
|
extend OpenAI::Internal::Type::Union
|
|
185
191
|
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Audio
|
|
7
|
+
|
|
8
|
+
class Voice < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Audio::Voice,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The voice identifier, which can be referenced in API endpoints.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The Unix timestamp (in seconds) for when the voice was created.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
# The name of the voice.
|
|
26
|
+
sig { returns(String) }
|
|
27
|
+
attr_accessor :name
|
|
28
|
+
|
|
29
|
+
# The object type, which is always `audio.voice`.
|
|
30
|
+
sig { returns(Symbol) }
|
|
31
|
+
attr_accessor :object
|
|
32
|
+
|
|
33
|
+
# How the voice was created. Voices created from text prompts are supported only
|
|
34
|
+
# in Live.
|
|
35
|
+
sig { returns(OpenAI::Audio::Voice::Type::TaggedSymbol) }
|
|
36
|
+
attr_accessor :type
|
|
37
|
+
|
|
38
|
+
# A custom voice that can be used for audio output. Voices created from text
|
|
39
|
+
# prompts are supported only in Live.
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
|
|
43
|
+
id: String,
|
|
44
|
+
|
|
45
|
+
created_at: Integer,
|
|
46
|
+
|
|
47
|
+
name: String,
|
|
48
|
+
|
|
49
|
+
type: OpenAI::Audio::Voice::Type::OrSymbol,
|
|
50
|
+
|
|
51
|
+
object: Symbol
|
|
52
|
+
)
|
|
53
|
+
.returns(T.attached_class)
|
|
54
|
+
end
|
|
55
|
+
def self.new(
|
|
56
|
+
|
|
57
|
+
# The voice identifier, which can be referenced in API endpoints.
|
|
58
|
+
id:,
|
|
59
|
+
|
|
60
|
+
# The Unix timestamp (in seconds) for when the voice was created.
|
|
61
|
+
created_at:,
|
|
62
|
+
|
|
63
|
+
# The name of the voice.
|
|
64
|
+
name:,
|
|
65
|
+
|
|
66
|
+
# How the voice was created. Voices created from text prompts are supported only
|
|
67
|
+
# in Live.
|
|
68
|
+
type:,
|
|
69
|
+
|
|
70
|
+
# The object type, which is always `audio.voice`.
|
|
71
|
+
|
|
72
|
+
object: :"audio.voice"
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
sig do
|
|
77
|
+
override.returns(
|
|
78
|
+
{
|
|
79
|
+
id: String,
|
|
80
|
+
created_at: Integer,
|
|
81
|
+
name: String,
|
|
82
|
+
object: Symbol,
|
|
83
|
+
type: OpenAI::Audio::Voice::Type::TaggedSymbol
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
def to_hash
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# How the voice was created. Voices created from text prompts are supported only
|
|
91
|
+
# in Live.
|
|
92
|
+
module Type
|
|
93
|
+
extend OpenAI::Internal::Type::Enum
|
|
94
|
+
|
|
95
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::Audio::Voice::Type) }
|
|
96
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
97
|
+
|
|
98
|
+
AUDIO_SAMPLE = T.let(:audio_sample, OpenAI::Audio::Voice::Type::TaggedSymbol)
|
|
99
|
+
PROMPT = T.let(:prompt, OpenAI::Audio::Voice::Type::TaggedSymbol)
|
|
100
|
+
|
|
101
|
+
sig { override.returns(T::Array[OpenAI::Audio::Voice::Type::TaggedSymbol]) }
|
|
102
|
+
def self.values
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
end
|
|
111
|
+
end
|