openai 0.107.0 → 0.109.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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/README.md +55 -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/client_runtime.rb +11 -0
  8. data/lib/openai/helpers/realtime/recovery.rb +8 -2
  9. data/lib/openai/helpers/responses_websocket/incremental.rb +5 -1
  10. data/lib/openai/helpers/responses_websocket/session.rb +11 -4
  11. data/lib/openai/helpers/streaming/chat_completion_resource.rb +52 -0
  12. data/lib/openai/internal/provider.rb +1 -0
  13. data/lib/openai/models/admin/organization/usage_audio_speeches_response.rb +4 -4
  14. data/lib/openai/models/admin/organization/usage_audio_transcriptions_response.rb +4 -4
  15. data/lib/openai/models/admin/organization/usage_code_interpreter_sessions_response.rb +4 -4
  16. data/lib/openai/models/admin/organization/usage_completions_response.rb +4 -4
  17. data/lib/openai/models/admin/organization/usage_costs_response.rb +4 -4
  18. data/lib/openai/models/admin/organization/usage_decisions_response.rb +4 -4
  19. data/lib/openai/models/admin/organization/usage_embeddings_response.rb +4 -4
  20. data/lib/openai/models/admin/organization/usage_file_search_calls_response.rb +4 -4
  21. data/lib/openai/models/admin/organization/usage_images_response.rb +4 -4
  22. data/lib/openai/models/admin/organization/usage_moderations_response.rb +4 -4
  23. data/lib/openai/models/admin/organization/usage_vector_stores_response.rb +4 -4
  24. data/lib/openai/models/admin/organization/usage_web_search_calls_response.rb +4 -4
  25. data/lib/openai/models/audio/voice_consent.rb +58 -0
  26. data/lib/openai/models/audio/voice_consent_create_params.rb +57 -0
  27. data/lib/openai/models/audio/voice_consent_delete_params.rb +22 -0
  28. data/lib/openai/models/audio/voice_consent_deleted.rb +34 -0
  29. data/lib/openai/models/audio/voice_consent_list_params.rb +42 -0
  30. data/lib/openai/models/audio/voice_consent_retrieve_params.rb +22 -0
  31. data/lib/openai/models/audio/voice_consent_update_params.rb +32 -0
  32. data/lib/openai/providers/vertex.rb +229 -0
  33. data/lib/openai/resources/audio/voice_consents.rb +163 -0
  34. data/lib/openai/resources/audio.rb +5 -0
  35. data/lib/openai/version.rb +1 -1
  36. data/lib/openai.rb +9 -0
  37. data/rbi/openai/helpers/chat/tool_runner.rbi +74 -0
  38. data/rbi/openai/internal/provider.rbi +3 -0
  39. data/rbi/openai/models/admin/organization/usage_audio_speeches_response.rbi +4 -4
  40. data/rbi/openai/models/admin/organization/usage_audio_transcriptions_response.rbi +4 -4
  41. data/rbi/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbi +4 -4
  42. data/rbi/openai/models/admin/organization/usage_completions_response.rbi +4 -4
  43. data/rbi/openai/models/admin/organization/usage_costs_response.rbi +4 -4
  44. data/rbi/openai/models/admin/organization/usage_decisions_response.rbi +4 -4
  45. data/rbi/openai/models/admin/organization/usage_embeddings_response.rbi +4 -4
  46. data/rbi/openai/models/admin/organization/usage_file_search_calls_response.rbi +4 -4
  47. data/rbi/openai/models/admin/organization/usage_images_response.rbi +4 -4
  48. data/rbi/openai/models/admin/organization/usage_moderations_response.rbi +4 -4
  49. data/rbi/openai/models/admin/organization/usage_vector_stores_response.rbi +4 -4
  50. data/rbi/openai/models/admin/organization/usage_web_search_calls_response.rbi +4 -4
  51. data/rbi/openai/models/audio/voice_consent.rbi +86 -0
  52. data/rbi/openai/models/audio/voice_consent_create_params.rbi +92 -0
  53. data/rbi/openai/models/audio/voice_consent_delete_params.rbi +53 -0
  54. data/rbi/openai/models/audio/voice_consent_deleted.rbi +62 -0
  55. data/rbi/openai/models/audio/voice_consent_list_params.rbi +78 -0
  56. data/rbi/openai/models/audio/voice_consent_retrieve_params.rbi +53 -0
  57. data/rbi/openai/models/audio/voice_consent_update_params.rbi +62 -0
  58. data/rbi/openai/models/response_format_json_schema.rbi +13 -11
  59. data/rbi/openai/providers.rbi +13 -0
  60. data/rbi/openai/resources/audio/voice_consents.rbi +108 -0
  61. data/rbi/openai/resources/audio.rbi +4 -0
  62. data/sig/openai/helpers/chat/tool_runner.rbs +48 -0
  63. data/sig/openai/internal/provider.rbs +3 -1
  64. data/sig/openai/models/admin/organization/usage_audio_speeches_response.rbs +6 -6
  65. data/sig/openai/models/admin/organization/usage_audio_transcriptions_response.rbs +6 -6
  66. data/sig/openai/models/admin/organization/usage_code_interpreter_sessions_response.rbs +6 -6
  67. data/sig/openai/models/admin/organization/usage_completions_response.rbs +6 -6
  68. data/sig/openai/models/admin/organization/usage_costs_response.rbs +6 -6
  69. data/sig/openai/models/admin/organization/usage_decisions_response.rbs +4 -4
  70. data/sig/openai/models/admin/organization/usage_embeddings_response.rbs +6 -6
  71. data/sig/openai/models/admin/organization/usage_file_search_calls_response.rbs +6 -6
  72. data/sig/openai/models/admin/organization/usage_images_response.rbs +6 -6
  73. data/sig/openai/models/admin/organization/usage_moderations_response.rbs +6 -6
  74. data/sig/openai/models/admin/organization/usage_vector_stores_response.rbs +6 -6
  75. data/sig/openai/models/admin/organization/usage_web_search_calls_response.rbs +6 -6
  76. data/sig/openai/models/audio/voice_consent.rbs +57 -0
  77. data/sig/openai/models/audio/voice_consent_create_params.rbs +61 -0
  78. data/sig/openai/models/audio/voice_consent_delete_params.rbs +25 -0
  79. data/sig/openai/models/audio/voice_consent_deleted.rbs +31 -0
  80. data/sig/openai/models/audio/voice_consent_list_params.rbs +57 -0
  81. data/sig/openai/models/audio/voice_consent_retrieve_params.rbs +25 -0
  82. data/sig/openai/models/audio/voice_consent_update_params.rbs +36 -0
  83. data/sig/openai/providers.rbs +8 -0
  84. data/sig/openai/resources/audio/voice_consents.rbs +38 -0
  85. data/sig/openai/resources/audio.rbs +2 -0
  86. data/vertex.md +29 -0
  87. metadata +32 -1
@@ -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 with a 30-minute
236
- # retention period.
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 with a 30-minute
435
- # retention period.
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 with a 30-minute
238
- # retention period.
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 with a 30-minute
437
- # retention period.
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 with a 30-minute
232
- # retention period.
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 with a 30-minute
431
- # retention period.
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 with a 30-minute
236
- # retention period.
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 with a 30-minute
435
- # retention period.
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 with a 30-minute
236
- # retention period.
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 with a 30-minute
435
- # retention period.
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 with a 30-minute
238
- # retention period.
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 with a 30-minute
437
- # retention period.
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
@@ -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)