openai 0.107.0 → 0.108.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 +23 -0
- data/README.md +49 -1
- data/examples/chat/tool_runner.rb +33 -0
- data/lib/openai/client.rb +2 -2
- data/lib/openai/helpers/chat/tool_runner.rb +259 -0
- data/lib/openai/helpers/realtime/recovery.rb +8 -2
- data/lib/openai/helpers/responses_websocket/incremental.rb +5 -1
- data/lib/openai/helpers/responses_websocket/session.rb +11 -4
- data/lib/openai/helpers/streaming/chat_completion_resource.rb +52 -0
- data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_completions_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_costs_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_decisions_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_embeddings_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_images_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_moderations_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +4 -4
- data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +4 -4
- data/lib/openai/models/audio/voice_consent.rb +58 -0
- data/lib/openai/models/audio/voice_consent_create_params.rb +57 -0
- data/lib/openai/models/audio/voice_consent_delete_params.rb +22 -0
- data/lib/openai/models/audio/voice_consent_deleted.rb +34 -0
- data/lib/openai/models/audio/voice_consent_list_params.rb +42 -0
- data/lib/openai/models/audio/voice_consent_retrieve_params.rb +22 -0
- data/lib/openai/models/audio/voice_consent_update_params.rb +32 -0
- data/lib/openai/resources/audio/voice_consents.rb +163 -0
- data/lib/openai/resources/audio.rb +5 -0
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/helpers/chat/tool_runner.rbi +74 -0
- data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_completions_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_costs_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_images_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +4 -4
- data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +4 -4
- data/rbi/openai/models/audio/voice_consent.rbi +86 -0
- data/rbi/openai/models/audio/voice_consent_create_params.rbi +92 -0
- data/rbi/openai/models/audio/voice_consent_delete_params.rbi +53 -0
- data/rbi/openai/models/audio/voice_consent_deleted.rbi +62 -0
- data/rbi/openai/models/audio/voice_consent_list_params.rbi +78 -0
- data/rbi/openai/models/audio/voice_consent_retrieve_params.rbi +53 -0
- data/rbi/openai/models/audio/voice_consent_update_params.rbi +62 -0
- data/rbi/openai/models/response_format_json_schema.rbi +13 -11
- data/rbi/openai/resources/audio/voice_consents.rbi +108 -0
- data/rbi/openai/resources/audio.rbi +4 -0
- data/sig/openai/helpers/chat/tool_runner.rbs +48 -0
- data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_completions_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_costs_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_decisions_response.rbs +4 -4
- data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_images_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_moderations_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +6 -6
- data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +6 -6
- data/sig/openai/models/audio/voice_consent.rbs +57 -0
- data/sig/openai/models/audio/voice_consent_create_params.rbs +61 -0
- data/sig/openai/models/audio/voice_consent_delete_params.rbs +25 -0
- data/sig/openai/models/audio/voice_consent_deleted.rbs +31 -0
- data/sig/openai/models/audio/voice_consent_list_params.rbs +57 -0
- data/sig/openai/models/audio/voice_consent_retrieve_params.rbs +25 -0
- data/sig/openai/models/audio/voice_consent_update_params.rbs +36 -0
- data/sig/openai/resources/audio/voice_consents.rbs +38 -0
- data/sig/openai/resources/audio.rbs +2 -0
- metadata +29 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Helpers
|
|
5
|
+
module Chat
|
|
6
|
+
class ToolRunner
|
|
7
|
+
Handler = T.type_alias { T.proc.params(arguments: T::Hash[String, T.untyped]).returns(T.untyped) }
|
|
8
|
+
|
|
9
|
+
class Error < StandardError
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class MaxRoundsError < Error
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @api private
|
|
16
|
+
sig do
|
|
17
|
+
params(
|
|
18
|
+
completions: OpenAI::Resources::Chat::Completions,
|
|
19
|
+
params: T::Hash[Symbol, T.untyped],
|
|
20
|
+
tool_handlers: T::Hash[String, Handler],
|
|
21
|
+
max_rounds: Integer
|
|
22
|
+
)
|
|
23
|
+
.void
|
|
24
|
+
end
|
|
25
|
+
def initialize(completions:, params:, tool_handlers:, max_rounds:)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# @api private
|
|
29
|
+
sig { returns(OpenAI::Chat::ChatCompletion) }
|
|
30
|
+
def run
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
module Resources
|
|
37
|
+
class Chat
|
|
38
|
+
class Completions
|
|
39
|
+
# @api private
|
|
40
|
+
sig { params(params: T::Hash[Symbol, T.untyped]).returns(OpenAI::Chat::ChatCompletion) }
|
|
41
|
+
def create_for_tool_runner(params)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
model: T.any(String, OpenAI::ChatModel::OrSymbol),
|
|
47
|
+
messages: T::Array[
|
|
48
|
+
T.any(
|
|
49
|
+
OpenAI::Chat::ChatCompletionDeveloperMessageParam::OrHash,
|
|
50
|
+
OpenAI::Chat::ChatCompletionSystemMessageParam::OrHash,
|
|
51
|
+
OpenAI::Chat::ChatCompletionUserMessageParam::OrHash,
|
|
52
|
+
OpenAI::Chat::ChatCompletionAssistantMessageParam::OrHash,
|
|
53
|
+
OpenAI::Chat::ChatCompletionToolMessageParam::OrHash,
|
|
54
|
+
OpenAI::Chat::ChatCompletionFunctionMessageParam::OrHash
|
|
55
|
+
)
|
|
56
|
+
],
|
|
57
|
+
tools: T::Array[
|
|
58
|
+
T.any(
|
|
59
|
+
OpenAI::StructuredOutput::JsonSchemaConverter,
|
|
60
|
+
OpenAI::Chat::ChatCompletionFunctionTool::OrHash
|
|
61
|
+
)
|
|
62
|
+
],
|
|
63
|
+
tool_handlers: T::Hash[String, OpenAI::Helpers::Chat::ToolRunner::Handler],
|
|
64
|
+
max_rounds: Integer,
|
|
65
|
+
params: T.untyped
|
|
66
|
+
)
|
|
67
|
+
.returns(OpenAI::Chat::ChatCompletion)
|
|
68
|
+
end
|
|
69
|
+
def run_tools(model:, messages:, tools:, tool_handlers:, max_rounds: 10, **params)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -232,8 +232,8 @@ module OpenAI
|
|
|
232
232
|
sig { returns(T.nilable(Integer)) }
|
|
233
233
|
attr_accessor :input_cache_write_30m_tokens
|
|
234
234
|
|
|
235
|
-
# The aggregated number of input tokens written to the cache
|
|
236
|
-
# retention
|
|
235
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
236
|
+
# 12-hour retention periods.
|
|
237
237
|
sig { returns(T.nilable(Integer)) }
|
|
238
238
|
attr_reader :input_cache_write_tokens
|
|
239
239
|
|
|
@@ -431,8 +431,8 @@ module OpenAI
|
|
|
431
431
|
# retention period. May be absent or null for older responses.
|
|
432
432
|
input_cache_write_30m_tokens: nil,
|
|
433
433
|
|
|
434
|
-
# The aggregated number of input tokens written to the cache
|
|
435
|
-
# retention
|
|
434
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
435
|
+
# 12-hour retention periods.
|
|
436
436
|
input_cache_write_tokens: nil,
|
|
437
437
|
|
|
438
438
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -234,8 +234,8 @@ module OpenAI
|
|
|
234
234
|
sig { returns(T.nilable(Integer)) }
|
|
235
235
|
attr_accessor :input_cache_write_30m_tokens
|
|
236
236
|
|
|
237
|
-
# The aggregated number of input tokens written to the cache
|
|
238
|
-
# retention
|
|
237
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
238
|
+
# 12-hour retention periods.
|
|
239
239
|
sig { returns(T.nilable(Integer)) }
|
|
240
240
|
attr_reader :input_cache_write_tokens
|
|
241
241
|
|
|
@@ -433,8 +433,8 @@ module OpenAI
|
|
|
433
433
|
# retention period. May be absent or null for older responses.
|
|
434
434
|
input_cache_write_30m_tokens: nil,
|
|
435
435
|
|
|
436
|
-
# The aggregated number of input tokens written to the cache
|
|
437
|
-
# retention
|
|
436
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
437
|
+
# 12-hour retention periods.
|
|
438
438
|
input_cache_write_tokens: nil,
|
|
439
439
|
|
|
440
440
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -236,8 +236,8 @@ module OpenAI
|
|
|
236
236
|
sig { returns(T.nilable(Integer)) }
|
|
237
237
|
attr_accessor :input_cache_write_30m_tokens
|
|
238
238
|
|
|
239
|
-
# The aggregated number of input tokens written to the cache
|
|
240
|
-
# retention
|
|
239
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
240
|
+
# 12-hour retention periods.
|
|
241
241
|
sig { returns(T.nilable(Integer)) }
|
|
242
242
|
attr_reader :input_cache_write_tokens
|
|
243
243
|
|
|
@@ -435,8 +435,8 @@ module OpenAI
|
|
|
435
435
|
# retention period. May be absent or null for older responses.
|
|
436
436
|
input_cache_write_30m_tokens: nil,
|
|
437
437
|
|
|
438
|
-
# The aggregated number of input tokens written to the cache
|
|
439
|
-
# retention
|
|
438
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
439
|
+
# 12-hour retention periods.
|
|
440
440
|
input_cache_write_tokens: nil,
|
|
441
441
|
|
|
442
442
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -232,8 +232,8 @@ module OpenAI
|
|
|
232
232
|
sig { returns(T.nilable(Integer)) }
|
|
233
233
|
attr_accessor :input_cache_write_30m_tokens
|
|
234
234
|
|
|
235
|
-
# The aggregated number of input tokens written to the cache
|
|
236
|
-
# retention
|
|
235
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
236
|
+
# 12-hour retention periods.
|
|
237
237
|
sig { returns(T.nilable(Integer)) }
|
|
238
238
|
attr_reader :input_cache_write_tokens
|
|
239
239
|
|
|
@@ -431,8 +431,8 @@ module OpenAI
|
|
|
431
431
|
# retention period. May be absent or null for older responses.
|
|
432
432
|
input_cache_write_30m_tokens: nil,
|
|
433
433
|
|
|
434
|
-
# The aggregated number of input tokens written to the cache
|
|
435
|
-
# retention
|
|
434
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
435
|
+
# 12-hour retention periods.
|
|
436
436
|
input_cache_write_tokens: nil,
|
|
437
437
|
|
|
438
438
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -228,8 +228,8 @@ module OpenAI
|
|
|
228
228
|
sig { returns(T.nilable(Integer)) }
|
|
229
229
|
attr_accessor :input_cache_write_30m_tokens
|
|
230
230
|
|
|
231
|
-
# The aggregated number of input tokens written to the cache
|
|
232
|
-
# retention
|
|
231
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
232
|
+
# 12-hour retention periods.
|
|
233
233
|
sig { returns(T.nilable(Integer)) }
|
|
234
234
|
attr_reader :input_cache_write_tokens
|
|
235
235
|
|
|
@@ -427,8 +427,8 @@ module OpenAI
|
|
|
427
427
|
# retention period. May be absent or null for older responses.
|
|
428
428
|
input_cache_write_30m_tokens: nil,
|
|
429
429
|
|
|
430
|
-
# The aggregated number of input tokens written to the cache
|
|
431
|
-
# retention
|
|
430
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
431
|
+
# 12-hour retention periods.
|
|
432
432
|
input_cache_write_tokens: nil,
|
|
433
433
|
|
|
434
434
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -188,8 +188,8 @@ module OpenAI
|
|
|
188
188
|
sig { returns(T.nilable(Integer)) }
|
|
189
189
|
attr_accessor :input_cache_write_30m_tokens
|
|
190
190
|
|
|
191
|
-
# The aggregated number of input tokens written to the cache
|
|
192
|
-
# retention
|
|
191
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
192
|
+
# 12-hour retention periods.
|
|
193
193
|
sig { returns(T.nilable(Integer)) }
|
|
194
194
|
attr_accessor :input_cache_write_tokens
|
|
195
195
|
|
|
@@ -354,8 +354,8 @@ module OpenAI
|
|
|
354
354
|
# retention period.
|
|
355
355
|
input_cache_write_30m_tokens: nil,
|
|
356
356
|
|
|
357
|
-
# The aggregated number of input tokens written to the cache
|
|
358
|
-
# retention
|
|
357
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
358
|
+
# 12-hour retention periods.
|
|
359
359
|
input_cache_write_tokens: nil,
|
|
360
360
|
|
|
361
361
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -232,8 +232,8 @@ module OpenAI
|
|
|
232
232
|
sig { returns(T.nilable(Integer)) }
|
|
233
233
|
attr_accessor :input_cache_write_30m_tokens
|
|
234
234
|
|
|
235
|
-
# The aggregated number of input tokens written to the cache
|
|
236
|
-
# retention
|
|
235
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
236
|
+
# 12-hour retention periods.
|
|
237
237
|
sig { returns(T.nilable(Integer)) }
|
|
238
238
|
attr_reader :input_cache_write_tokens
|
|
239
239
|
|
|
@@ -431,8 +431,8 @@ module OpenAI
|
|
|
431
431
|
# retention period. May be absent or null for older responses.
|
|
432
432
|
input_cache_write_30m_tokens: nil,
|
|
433
433
|
|
|
434
|
-
# The aggregated number of input tokens written to the cache
|
|
435
|
-
# retention
|
|
434
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
435
|
+
# 12-hour retention periods.
|
|
436
436
|
input_cache_write_tokens: nil,
|
|
437
437
|
|
|
438
438
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -234,8 +234,8 @@ module OpenAI
|
|
|
234
234
|
sig { returns(T.nilable(Integer)) }
|
|
235
235
|
attr_accessor :input_cache_write_30m_tokens
|
|
236
236
|
|
|
237
|
-
# The aggregated number of input tokens written to the cache
|
|
238
|
-
# retention
|
|
237
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
238
|
+
# 12-hour retention periods.
|
|
239
239
|
sig { returns(T.nilable(Integer)) }
|
|
240
240
|
attr_reader :input_cache_write_tokens
|
|
241
241
|
|
|
@@ -433,8 +433,8 @@ module OpenAI
|
|
|
433
433
|
# retention period. May be absent or null for older responses.
|
|
434
434
|
input_cache_write_30m_tokens: nil,
|
|
435
435
|
|
|
436
|
-
# The aggregated number of input tokens written to the cache
|
|
437
|
-
# retention
|
|
436
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
437
|
+
# 12-hour retention periods.
|
|
438
438
|
input_cache_write_tokens: nil,
|
|
439
439
|
|
|
440
440
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -228,8 +228,8 @@ module OpenAI
|
|
|
228
228
|
sig { returns(T.nilable(Integer)) }
|
|
229
229
|
attr_accessor :input_cache_write_30m_tokens
|
|
230
230
|
|
|
231
|
-
# The aggregated number of input tokens written to the cache
|
|
232
|
-
# retention
|
|
231
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
232
|
+
# 12-hour retention periods.
|
|
233
233
|
sig { returns(T.nilable(Integer)) }
|
|
234
234
|
attr_reader :input_cache_write_tokens
|
|
235
235
|
|
|
@@ -427,8 +427,8 @@ module OpenAI
|
|
|
427
427
|
# retention period. May be absent or null for older responses.
|
|
428
428
|
input_cache_write_30m_tokens: nil,
|
|
429
429
|
|
|
430
|
-
# The aggregated number of input tokens written to the cache
|
|
431
|
-
# retention
|
|
430
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
431
|
+
# 12-hour retention periods.
|
|
432
432
|
input_cache_write_tokens: nil,
|
|
433
433
|
|
|
434
434
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -232,8 +232,8 @@ module OpenAI
|
|
|
232
232
|
sig { returns(T.nilable(Integer)) }
|
|
233
233
|
attr_accessor :input_cache_write_30m_tokens
|
|
234
234
|
|
|
235
|
-
# The aggregated number of input tokens written to the cache
|
|
236
|
-
# retention
|
|
235
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
236
|
+
# 12-hour retention periods.
|
|
237
237
|
sig { returns(T.nilable(Integer)) }
|
|
238
238
|
attr_reader :input_cache_write_tokens
|
|
239
239
|
|
|
@@ -431,8 +431,8 @@ module OpenAI
|
|
|
431
431
|
# retention period. May be absent or null for older responses.
|
|
432
432
|
input_cache_write_30m_tokens: nil,
|
|
433
433
|
|
|
434
|
-
# The aggregated number of input tokens written to the cache
|
|
435
|
-
# retention
|
|
434
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
435
|
+
# 12-hour retention periods.
|
|
436
436
|
input_cache_write_tokens: nil,
|
|
437
437
|
|
|
438
438
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -232,8 +232,8 @@ module OpenAI
|
|
|
232
232
|
sig { returns(T.nilable(Integer)) }
|
|
233
233
|
attr_accessor :input_cache_write_30m_tokens
|
|
234
234
|
|
|
235
|
-
# The aggregated number of input tokens written to the cache
|
|
236
|
-
# retention
|
|
235
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
236
|
+
# 12-hour retention periods.
|
|
237
237
|
sig { returns(T.nilable(Integer)) }
|
|
238
238
|
attr_reader :input_cache_write_tokens
|
|
239
239
|
|
|
@@ -431,8 +431,8 @@ module OpenAI
|
|
|
431
431
|
# retention period. May be absent or null for older responses.
|
|
432
432
|
input_cache_write_30m_tokens: nil,
|
|
433
433
|
|
|
434
|
-
# The aggregated number of input tokens written to the cache
|
|
435
|
-
# retention
|
|
434
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
435
|
+
# 12-hour retention periods.
|
|
436
436
|
input_cache_write_tokens: nil,
|
|
437
437
|
|
|
438
438
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -234,8 +234,8 @@ module OpenAI
|
|
|
234
234
|
sig { returns(T.nilable(Integer)) }
|
|
235
235
|
attr_accessor :input_cache_write_30m_tokens
|
|
236
236
|
|
|
237
|
-
# The aggregated number of input tokens written to the cache
|
|
238
|
-
# retention
|
|
237
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
238
|
+
# 12-hour retention periods.
|
|
239
239
|
sig { returns(T.nilable(Integer)) }
|
|
240
240
|
attr_reader :input_cache_write_tokens
|
|
241
241
|
|
|
@@ -433,8 +433,8 @@ module OpenAI
|
|
|
433
433
|
# retention period. May be absent or null for older responses.
|
|
434
434
|
input_cache_write_30m_tokens: nil,
|
|
435
435
|
|
|
436
|
-
# The aggregated number of input tokens written to the cache
|
|
437
|
-
# retention
|
|
436
|
+
# The aggregated number of input tokens written to the cache across 30-minute and
|
|
437
|
+
# 12-hour retention periods.
|
|
438
438
|
input_cache_write_tokens: nil,
|
|
439
439
|
|
|
440
440
|
# The aggregated number of cached audio input tokens used.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Audio
|
|
7
|
+
|
|
8
|
+
class VoiceConsent < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Audio::VoiceConsent,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The consent recording identifier.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# The Unix timestamp (in seconds) for when the consent recording was created.
|
|
22
|
+
sig { returns(Integer) }
|
|
23
|
+
attr_accessor :created_at
|
|
24
|
+
|
|
25
|
+
# The BCP 47 language tag for the consent phrase (for example, `en-US`).
|
|
26
|
+
sig { returns(String) }
|
|
27
|
+
attr_accessor :language
|
|
28
|
+
|
|
29
|
+
# The label provided when the consent recording was uploaded.
|
|
30
|
+
sig { returns(String) }
|
|
31
|
+
attr_accessor :name
|
|
32
|
+
|
|
33
|
+
# The object type, which is always `audio.voice_consent`.
|
|
34
|
+
sig { returns(Symbol) }
|
|
35
|
+
attr_accessor :object
|
|
36
|
+
|
|
37
|
+
# A consent recording used to authorize creation of a custom voice.
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
|
|
41
|
+
id: String,
|
|
42
|
+
|
|
43
|
+
created_at: Integer,
|
|
44
|
+
|
|
45
|
+
language: String,
|
|
46
|
+
|
|
47
|
+
name: String,
|
|
48
|
+
|
|
49
|
+
object: Symbol
|
|
50
|
+
)
|
|
51
|
+
.returns(T.attached_class)
|
|
52
|
+
end
|
|
53
|
+
def self.new(
|
|
54
|
+
|
|
55
|
+
# The consent recording identifier.
|
|
56
|
+
id:,
|
|
57
|
+
|
|
58
|
+
# The Unix timestamp (in seconds) for when the consent recording was created.
|
|
59
|
+
created_at:,
|
|
60
|
+
|
|
61
|
+
# The BCP 47 language tag for the consent phrase (for example, `en-US`).
|
|
62
|
+
language:,
|
|
63
|
+
|
|
64
|
+
# The label provided when the consent recording was uploaded.
|
|
65
|
+
name:,
|
|
66
|
+
|
|
67
|
+
# The object type, which is always `audio.voice_consent`.
|
|
68
|
+
|
|
69
|
+
object: :"audio.voice_consent"
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
sig do
|
|
74
|
+
override.returns(
|
|
75
|
+
{id: String, created_at: Integer, language: String, name: String, object: Symbol}
|
|
76
|
+
)
|
|
77
|
+
end
|
|
78
|
+
def to_hash
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Audio
|
|
7
|
+
|
|
8
|
+
class VoiceConsentCreateParams < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
11
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
12
|
+
|
|
13
|
+
OrHash = T.type_alias do
|
|
14
|
+
T.any(
|
|
15
|
+
OpenAI::Audio::VoiceConsentCreateParams,
|
|
16
|
+
OpenAI::Internal::AnyHash
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# The BCP 47 language tag for the consent phrase (for example, `en-US`).
|
|
21
|
+
sig { returns(String) }
|
|
22
|
+
attr_accessor :language
|
|
23
|
+
|
|
24
|
+
# The label to use for this consent recording.
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
# The consent audio recording file. Maximum size is 10 MiB.
|
|
29
|
+
#
|
|
30
|
+
# Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
|
|
31
|
+
# `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
|
|
32
|
+
#
|
|
33
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
34
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
35
|
+
# content type.
|
|
36
|
+
sig { returns(OpenAI::Internal::FileInput) }
|
|
37
|
+
attr_accessor :recording
|
|
38
|
+
|
|
39
|
+
sig do
|
|
40
|
+
params(
|
|
41
|
+
|
|
42
|
+
language: String,
|
|
43
|
+
|
|
44
|
+
name: String,
|
|
45
|
+
|
|
46
|
+
recording: OpenAI::Internal::FileInput,
|
|
47
|
+
|
|
48
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
49
|
+
)
|
|
50
|
+
.returns(T.attached_class)
|
|
51
|
+
end
|
|
52
|
+
def self.new(
|
|
53
|
+
|
|
54
|
+
# The BCP 47 language tag for the consent phrase (for example, `en-US`).
|
|
55
|
+
language:,
|
|
56
|
+
|
|
57
|
+
# The label to use for this consent recording.
|
|
58
|
+
name:,
|
|
59
|
+
|
|
60
|
+
# The consent audio recording file. Maximum size is 10 MiB.
|
|
61
|
+
#
|
|
62
|
+
# Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
|
|
63
|
+
# `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
|
|
64
|
+
#
|
|
65
|
+
# `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
|
|
66
|
+
# metadata. Use `OpenAI::FilePart` when you need to override the filename or
|
|
67
|
+
# content type.
|
|
68
|
+
recording:,
|
|
69
|
+
|
|
70
|
+
request_options: {}
|
|
71
|
+
)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(
|
|
76
|
+
{
|
|
77
|
+
language: String,
|
|
78
|
+
name: String,
|
|
79
|
+
recording: OpenAI::Internal::FileInput,
|
|
80
|
+
request_options: OpenAI::RequestOptions
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Audio
|
|
7
|
+
|
|
8
|
+
class VoiceConsentDeleteParams < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
extend OpenAI::Internal::Type::RequestParameters::Converter
|
|
11
|
+
include OpenAI::Internal::Type::RequestParameters
|
|
12
|
+
|
|
13
|
+
OrHash = T.type_alias do
|
|
14
|
+
T.any(
|
|
15
|
+
OpenAI::Audio::VoiceConsentDeleteParams,
|
|
16
|
+
OpenAI::Internal::AnyHash
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :consent_id
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
|
|
26
|
+
consent_id: String,
|
|
27
|
+
|
|
28
|
+
request_options: OpenAI::RequestOptions::OrHash
|
|
29
|
+
)
|
|
30
|
+
.returns(T.attached_class)
|
|
31
|
+
end
|
|
32
|
+
def self.new(
|
|
33
|
+
|
|
34
|
+
consent_id:,
|
|
35
|
+
|
|
36
|
+
request_options: {}
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
override.returns(
|
|
42
|
+
{consent_id: String, request_options: OpenAI::RequestOptions}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
def to_hash
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
|
|
6
|
+
module Audio
|
|
7
|
+
|
|
8
|
+
class VoiceConsentDeleted < OpenAI::Internal::Type::BaseModel
|
|
9
|
+
|
|
10
|
+
OrHash = T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
OpenAI::Audio::VoiceConsentDeleted,
|
|
13
|
+
OpenAI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# The consent recording identifier.
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig { returns(T::Boolean) }
|
|
22
|
+
attr_accessor :deleted
|
|
23
|
+
|
|
24
|
+
sig { returns(Symbol) }
|
|
25
|
+
attr_accessor :object
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
|
|
30
|
+
id: String,
|
|
31
|
+
|
|
32
|
+
deleted: T::Boolean,
|
|
33
|
+
|
|
34
|
+
object: Symbol
|
|
35
|
+
)
|
|
36
|
+
.returns(T.attached_class)
|
|
37
|
+
end
|
|
38
|
+
def self.new(
|
|
39
|
+
|
|
40
|
+
# The consent recording identifier.
|
|
41
|
+
id:,
|
|
42
|
+
|
|
43
|
+
deleted:,
|
|
44
|
+
|
|
45
|
+
object: :"audio.voice_consent"
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
sig do
|
|
50
|
+
override.returns(
|
|
51
|
+
{id: String, deleted: T::Boolean, object: Symbol}
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
def to_hash
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
62
|
+
end
|