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.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +49 -1
  4. data/examples/chat/tool_runner.rb +33 -0
  5. data/lib/openai/client.rb +2 -2
  6. data/lib/openai/helpers/chat/tool_runner.rb +259 -0
  7. data/lib/openai/helpers/realtime/recovery.rb +8 -2
  8. data/lib/openai/helpers/responses_websocket/incremental.rb +5 -1
  9. data/lib/openai/helpers/responses_websocket/session.rb +11 -4
  10. data/lib/openai/helpers/streaming/chat_completion_resource.rb +52 -0
  11. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +4 -4
  12. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +4 -4
  13. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +4 -4
  14. data/lib/openai/models/admin/organization/usage_completions_response.rb +4 -4
  15. data/lib/openai/models/admin/organization/usage_costs_response.rb +4 -4
  16. data/lib/openai/models/admin/organization/usage_decisions_response.rb +4 -4
  17. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +4 -4
  18. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +4 -4
  19. data/lib/openai/models/admin/organization/usage_images_response.rb +4 -4
  20. data/lib/openai/models/admin/organization/usage_moderations_response.rb +4 -4
  21. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +4 -4
  22. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +4 -4
  23. data/lib/openai/models/audio/voice_consent.rb +58 -0
  24. data/lib/openai/models/audio/voice_consent_create_params.rb +57 -0
  25. data/lib/openai/models/audio/voice_consent_delete_params.rb +22 -0
  26. data/lib/openai/models/audio/voice_consent_deleted.rb +34 -0
  27. data/lib/openai/models/audio/voice_consent_list_params.rb +42 -0
  28. data/lib/openai/models/audio/voice_consent_retrieve_params.rb +22 -0
  29. data/lib/openai/models/audio/voice_consent_update_params.rb +32 -0
  30. data/lib/openai/resources/audio/voice_consents.rb +163 -0
  31. data/lib/openai/resources/audio.rb +5 -0
  32. data/lib/openai/version.rb +1 -1
  33. data/lib/openai.rb +8 -0
  34. data/rbi/openai/helpers/chat/tool_runner.rbi +74 -0
  35. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +4 -4
  36. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +4 -4
  37. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +4 -4
  38. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +4 -4
  39. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +4 -4
  40. data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +4 -4
  41. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +4 -4
  42. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +4 -4
  43. data/rbi/openai/models/admin/organization/usage_images_response.rbi +4 -4
  44. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +4 -4
  45. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +4 -4
  46. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +4 -4
  47. data/rbi/openai/models/audio/voice_consent.rbi +86 -0
  48. data/rbi/openai/models/audio/voice_consent_create_params.rbi +92 -0
  49. data/rbi/openai/models/audio/voice_consent_delete_params.rbi +53 -0
  50. data/rbi/openai/models/audio/voice_consent_deleted.rbi +62 -0
  51. data/rbi/openai/models/audio/voice_consent_list_params.rbi +78 -0
  52. data/rbi/openai/models/audio/voice_consent_retrieve_params.rbi +53 -0
  53. data/rbi/openai/models/audio/voice_consent_update_params.rbi +62 -0
  54. data/rbi/openai/models/response_format_json_schema.rbi +13 -11
  55. data/rbi/openai/resources/audio/voice_consents.rbi +108 -0
  56. data/rbi/openai/resources/audio.rbi +4 -0
  57. data/sig/openai/helpers/chat/tool_runner.rbs +48 -0
  58. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +6 -6
  59. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +6 -6
  60. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +6 -6
  61. data/sig/openai/models/admin/organization/usage_completions_response.rbs +6 -6
  62. data/sig/openai/models/admin/organization/usage_costs_response.rbs +6 -6
  63. data/sig/openai/models/admin/organization/usage_decisions_response.rbs +4 -4
  64. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +6 -6
  65. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +6 -6
  66. data/sig/openai/models/admin/organization/usage_images_response.rbs +6 -6
  67. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +6 -6
  68. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +6 -6
  69. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +6 -6
  70. data/sig/openai/models/audio/voice_consent.rbs +57 -0
  71. data/sig/openai/models/audio/voice_consent_create_params.rbs +61 -0
  72. data/sig/openai/models/audio/voice_consent_delete_params.rbs +25 -0
  73. data/sig/openai/models/audio/voice_consent_deleted.rbs +31 -0
  74. data/sig/openai/models/audio/voice_consent_list_params.rbs +57 -0
  75. data/sig/openai/models/audio/voice_consent_retrieve_params.rbs +25 -0
  76. data/sig/openai/models/audio/voice_consent_update_params.rbs +36 -0
  77. data/sig/openai/resources/audio/voice_consents.rbs +38 -0
  78. data/sig/openai/resources/audio.rbs +2 -0
  79. metadata +29 -1
@@ -0,0 +1,78 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Audio
7
+
8
+ class VoiceConsentListParams < 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::VoiceConsentListParams,
16
+ OpenAI::Internal::AnyHash
17
+ )
18
+ end
19
+
20
+ # A cursor for use in pagination. `after` is an object ID that defines your place
21
+ # in the list. For instance, if you make a list request and receive 100 objects,
22
+ # ending with obj_foo, your subsequent call can include after=obj_foo in order to
23
+ # fetch the next page of the list.
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :after
26
+
27
+ sig { params(after: String).void }
28
+ attr_writer :after
29
+
30
+ # A limit on the number of objects to be returned. Limit can range between 1 and
31
+ # 100, and the default is 20.
32
+ sig { returns(T.nilable(Integer)) }
33
+ attr_reader :limit
34
+
35
+ sig { params(limit: Integer).void }
36
+ attr_writer :limit
37
+
38
+ sig do
39
+ params(
40
+
41
+ after: String,
42
+
43
+ limit: Integer,
44
+
45
+ request_options: OpenAI::RequestOptions::OrHash
46
+ )
47
+ .returns(T.attached_class)
48
+ end
49
+ def self.new(
50
+
51
+ # A cursor for use in pagination. `after` is an object ID that defines your place
52
+ # in the list. For instance, if you make a list request and receive 100 objects,
53
+ # ending with obj_foo, your subsequent call can include after=obj_foo in order to
54
+ # fetch the next page of the list.
55
+ after: nil,
56
+
57
+ # A limit on the number of objects to be returned. Limit can range between 1 and
58
+ # 100, and the default is 20.
59
+ limit: nil,
60
+
61
+ request_options: {}
62
+ )
63
+ end
64
+
65
+ sig do
66
+ override.returns(
67
+ {after: String, limit: Integer, request_options: OpenAI::RequestOptions}
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+
73
+ end
74
+
75
+ end
76
+
77
+ end
78
+ end
@@ -0,0 +1,53 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+
6
+ module Audio
7
+
8
+ class VoiceConsentRetrieveParams < 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::VoiceConsentRetrieveParams,
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 VoiceConsentUpdateParams < 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::VoiceConsentUpdateParams,
16
+ OpenAI::Internal::AnyHash
17
+ )
18
+ end
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :consent_id
22
+
23
+ # The updated label for this consent recording.
24
+ sig { returns(String) }
25
+ attr_accessor :name
26
+
27
+ sig do
28
+ params(
29
+
30
+ consent_id: String,
31
+
32
+ name: String,
33
+
34
+ request_options: OpenAI::RequestOptions::OrHash
35
+ )
36
+ .returns(T.attached_class)
37
+ end
38
+ def self.new(
39
+
40
+ consent_id:,
41
+
42
+ # The updated label for this consent recording.
43
+ name:,
44
+
45
+ request_options: {}
46
+ )
47
+ end
48
+
49
+ sig do
50
+ override.returns(
51
+ {consent_id: String, name: String, request_options: OpenAI::RequestOptions}
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+
61
+ end
62
+ end
@@ -2,24 +2,25 @@
2
2
 
3
3
  module OpenAI
4
4
  module Models
5
+
5
6
  class ResponseFormatJSONSchema < OpenAI::Internal::Type::BaseModel
7
+
6
8
  OrHash = T.type_alias do
7
- T.any(OpenAI::ResponseFormatJSONSchema, OpenAI::Internal::AnyHash)
9
+ T.any(
10
+ OpenAI::ResponseFormatJSONSchema,
11
+ OpenAI::Internal::AnyHash
12
+ )
8
13
  end
9
14
 
10
15
  # Structured Outputs configuration options, including a JSON Schema.
11
- sig do
16
+ sig {
12
17
  returns(
13
- T.any(
14
- OpenAI::ResponseFormatJSONSchema::JSONSchema::OrHash,
15
- OpenAI::StructuredOutput::JsonSchemaConverter
16
- )
18
+ T.any(OpenAI::ResponseFormatJSONSchema::JSONSchema::OrHash, OpenAI::StructuredOutput::JsonSchemaConverter)
17
19
  )
18
- end
19
-
20
+ }
20
21
  attr_reader :json_schema
21
22
 
22
- sig do
23
+ sig {
23
24
  params(
24
25
  json_schema: T.any(
25
26
  OpenAI::ResponseFormatJSONSchema::JSONSchema::OrHash,
@@ -27,8 +28,7 @@ module OpenAI
27
28
  )
28
29
  )
29
30
  .void
30
- end
31
-
31
+ }
32
32
  attr_writer :json_schema
33
33
 
34
34
  # The type of response format being defined. Always `json_schema`.
@@ -40,10 +40,12 @@ module OpenAI
40
40
  # [Structured Outputs](https://developers.openai.com/api/docs/guides/structured-outputs).
41
41
  sig do
42
42
  params(
43
+
43
44
  json_schema: T.any(
44
45
  OpenAI::ResponseFormatJSONSchema::JSONSchema::OrHash,
45
46
  OpenAI::StructuredOutput::JsonSchemaConverter
46
47
  ),
48
+
47
49
  type: Symbol
48
50
  )
49
51
  .returns(T.attached_class)
@@ -0,0 +1,108 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Resources
5
+
6
+ class Audio
7
+
8
+ # Turn audio into text or text into audio.
9
+ class VoiceConsents
10
+
11
+ # Upload a voice consent recording.
12
+ sig {
13
+ params(
14
+ language: String,
15
+ name: String,
16
+ recording: OpenAI::Internal::FileInput,
17
+ request_options: OpenAI::RequestOptions::OrHash
18
+ )
19
+ .returns(OpenAI::Audio::VoiceConsent)
20
+ }
21
+ def create(
22
+ # The BCP 47 language tag for the consent phrase (for example, `en-US`).
23
+ language:,
24
+ # The label to use for this consent recording.
25
+ name:,
26
+ # The consent audio recording file. Maximum size is 10 MiB.
27
+ #
28
+ # Supported MIME types: `audio/mpeg`, `audio/wav`, `audio/x-wav`, `audio/ogg`,
29
+ # `audio/aac`, `audio/flac`, `audio/webm`, `audio/mp4`.
30
+ #
31
+ # `String`, `StringIO`, and pathless `IO` inputs are sent with generic upload
32
+ # metadata. Use `OpenAI::FilePart` when you need to override the filename or
33
+ # content type.
34
+ recording:,
35
+ request_options: {}
36
+ )
37
+ end
38
+
39
+ # Retrieves a voice consent recording.
40
+ sig {
41
+ params(consent_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
42
+ OpenAI::Audio::VoiceConsent
43
+ )
44
+ }
45
+ def retrieve(
46
+ # The ID of the consent recording to retrieve.
47
+ consent_id,
48
+ request_options: {}
49
+ )
50
+ end
51
+
52
+ # Updates a voice consent recording (metadata only).
53
+ sig {
54
+ params(consent_id: String, name: String, request_options: OpenAI::RequestOptions::OrHash).returns(
55
+ OpenAI::Audio::VoiceConsent
56
+ )
57
+ }
58
+ def update(
59
+ # The ID of the consent recording to update.
60
+ consent_id,
61
+ # The updated label for this consent recording.
62
+ name:,
63
+ request_options: {}
64
+ )
65
+ end
66
+
67
+ # Returns a list of voice consent recordings.
68
+ sig {
69
+ params(after: String, limit: Integer, request_options: OpenAI::RequestOptions::OrHash).returns(
70
+ OpenAI::Internal::CursorPage[OpenAI::Audio::VoiceConsent]
71
+ )
72
+ }
73
+ def list(
74
+ # A cursor for use in pagination. `after` is an object ID that defines your place
75
+ # in the list. For instance, if you make a list request and receive 100 objects,
76
+ # ending with obj_foo, your subsequent call can include after=obj_foo in order to
77
+ # fetch the next page of the list.
78
+ after: nil,
79
+ # A limit on the number of objects to be returned. Limit can range between 1 and
80
+ # 100, and the default is 20.
81
+ limit: nil,
82
+ request_options: {}
83
+ )
84
+ end
85
+
86
+ # Deletes a voice consent recording.
87
+ sig {
88
+ params(consent_id: String, request_options: OpenAI::RequestOptions::OrHash).returns(
89
+ OpenAI::Audio::VoiceConsentDeleted
90
+ )
91
+ }
92
+ def delete(
93
+ # The ID of the consent recording to delete.
94
+ consent_id,
95
+ request_options: {}
96
+ )
97
+ end
98
+
99
+ # @api private
100
+ sig { params(client: OpenAI::Client).returns(T.attached_class) }
101
+ def self.new(client:)
102
+ end
103
+ end
104
+
105
+ end
106
+
107
+ end
108
+ end
@@ -21,6 +21,10 @@ module OpenAI
21
21
  sig { returns(OpenAI::Resources::Audio::Voices) }
22
22
  attr_reader :voices
23
23
 
24
+ # Turn audio into text or text into audio.
25
+ sig { returns(OpenAI::Resources::Audio::VoiceConsents) }
26
+ attr_reader :voice_consents
27
+
24
28
  # @api private
25
29
  sig { params(client: OpenAI::Client).returns(T.attached_class) }
26
30
  def self.new(client:)
@@ -0,0 +1,48 @@
1
+ module OpenAI
2
+ module Helpers
3
+ module Chat
4
+ class ToolRunner
5
+ type handler = ^(Hash[String, untyped]) -> untyped
6
+
7
+ class Error < StandardError
8
+ end
9
+
10
+ class MaxRoundsError < Error
11
+ end
12
+
13
+ # @api private
14
+ def initialize: (
15
+ completions: OpenAI::Resources::Chat::Completions,
16
+ params: Hash[Symbol, untyped],
17
+ tool_handlers: Hash[String, handler],
18
+ max_rounds: Integer
19
+ ) -> void
20
+
21
+ # @api private
22
+ def run: -> OpenAI::Chat::ChatCompletion
23
+ end
24
+ end
25
+ end
26
+
27
+ module Resources
28
+ class Chat
29
+ class Completions
30
+ # @api private
31
+ def create_for_tool_runner: (
32
+ Hash[Symbol, untyped] params
33
+ ) -> OpenAI::Chat::ChatCompletion
34
+
35
+ def run_tools: (
36
+ model: String | Symbol,
37
+ messages: Array[untyped],
38
+ tools: Array[Class
39
+ | OpenAI::Chat::ChatCompletionFunctionTool
40
+ | Hash[Symbol, untyped]],
41
+ tool_handlers: Hash[String, OpenAI::Helpers::Chat::ToolRunner::handler],
42
+ ?max_rounds: Integer,
43
+ **untyped
44
+ ) -> OpenAI::Chat::ChatCompletion
45
+ end
46
+ end
47
+ end
48
+ end
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -134,8 +134,8 @@ module OpenAI
134
134
  # retention period.
135
135
  attr_accessor input_cache_write_30m_tokens: Integer?
136
136
 
137
- # The aggregated number of input tokens written to the cache with a 30-minute
138
- # retention period.
137
+ # The aggregated number of input tokens written to the cache across 30-minute and
138
+ # 12-hour retention periods.
139
139
  attr_accessor input_cache_write_tokens: Integer?
140
140
 
141
141
  # The aggregated number of cached audio input tokens used.
@@ -217,8 +217,8 @@ module OpenAI
217
217
  # The aggregated number of input tokens written to the cache with a 30-minute
218
218
  # retention period.
219
219
  # @param input_cache_write_tokens
220
- # The aggregated number of input tokens written to the cache with a 30-minute
221
- # retention period.
220
+ # The aggregated number of input tokens written to the cache across 30-minute and
221
+ # 12-hour retention periods.
222
222
  # @param input_cached_audio_tokens
223
223
  # The aggregated number of cached audio input tokens used.
224
224
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens
@@ -157,12 +157,12 @@ module OpenAI
157
157
  # retention period. May be absent or null for older responses.
158
158
  attr_accessor input_cache_write_30m_tokens: Integer?
159
159
 
160
- # The aggregated number of input tokens written to the cache with a 30-minute
161
- # retention period.
160
+ # The aggregated number of input tokens written to the cache across 30-minute and
161
+ # 12-hour retention periods.
162
162
  attr_reader input_cache_write_tokens: Integer?
163
163
 
164
- # The aggregated number of input tokens written to the cache with a 30-minute
165
- # retention period.
164
+ # The aggregated number of input tokens written to the cache across 30-minute and
165
+ # 12-hour retention periods.
166
166
  def input_cache_write_tokens=: (Integer) -> Integer
167
167
 
168
168
  # The aggregated number of cached audio input tokens used.
@@ -277,8 +277,8 @@ module OpenAI
277
277
  # The aggregated number of input tokens written to the cache with a 30-minute
278
278
  # retention period. May be absent or null for older responses.
279
279
  # @param input_cache_write_tokens
280
- # The aggregated number of input tokens written to the cache with a 30-minute
281
- # retention period.
280
+ # The aggregated number of input tokens written to the cache across 30-minute and
281
+ # 12-hour retention periods.
282
282
  # @param input_cached_audio_tokens
283
283
  # The aggregated number of cached audio input tokens used.
284
284
  # @param input_cached_image_tokens