openai 0.72.0 → 0.74.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 (71) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/openai/models/audio/transcription.rb +10 -1
  5. data/lib/openai/models/audio/transcription_create_params.rb +24 -5
  6. data/lib/openai/models/audio/transcription_language.rb +20 -0
  7. data/lib/openai/models/audio/transcription_text_done_event.rb +10 -1
  8. data/lib/openai/models/audio_model.rb +1 -0
  9. data/lib/openai/models/beta/beta_response.rb +15 -6
  10. data/lib/openai/models/beta/beta_responses_client_event.rb +15 -6
  11. data/lib/openai/models/beta/response_create_params.rb +15 -6
  12. data/lib/openai/models/chat/chat_completion.rb +15 -6
  13. data/lib/openai/models/chat/chat_completion_chunk.rb +15 -6
  14. data/lib/openai/models/chat/completion_create_params.rb +15 -6
  15. data/lib/openai/models/realtime/audio_transcription.rb +35 -8
  16. data/lib/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rb +10 -1
  17. data/lib/openai/models/responses/response.rb +15 -6
  18. data/lib/openai/models/responses/response_create_params.rb +15 -6
  19. data/lib/openai/models/responses/responses_client_event.rb +15 -6
  20. data/lib/openai/models/webhooks/live_call_incoming_webhook_event.rb +121 -0
  21. data/lib/openai/models/webhooks/realtime_call_incoming_webhook_event.rb +6 -3
  22. data/lib/openai/models/webhooks/unwrap_webhook_event.rb +9 -2
  23. data/lib/openai/resources/audio/transcriptions.rb +12 -4
  24. data/lib/openai/resources/webhooks.rb +1 -1
  25. data/lib/openai/version.rb +1 -1
  26. data/lib/openai.rb +2 -0
  27. data/rbi/openai/models/audio/transcription.rbi +19 -0
  28. data/rbi/openai/models/audio/transcription_create_params.rbi +31 -3
  29. data/rbi/openai/models/audio/transcription_language.rbi +33 -0
  30. data/rbi/openai/models/audio/transcription_text_done_event.rbi +19 -0
  31. data/rbi/openai/models/audio_model.rbi +2 -0
  32. data/rbi/openai/models/beta/beta_response.rbi +23 -9
  33. data/rbi/openai/models/beta/beta_responses_client_event.rbi +26 -9
  34. data/rbi/openai/models/beta/response_create_params.rbi +26 -9
  35. data/rbi/openai/models/chat/chat_completion.rbi +26 -9
  36. data/rbi/openai/models/chat/chat_completion_chunk.rbi +26 -9
  37. data/rbi/openai/models/chat/completion_create_params.rbi +26 -9
  38. data/rbi/openai/models/realtime/audio_transcription.rbi +50 -9
  39. data/rbi/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbi +19 -0
  40. data/rbi/openai/models/responses/response.rbi +23 -9
  41. data/rbi/openai/models/responses/response_create_params.rbi +26 -9
  42. data/rbi/openai/models/responses/responses_client_event.rbi +26 -9
  43. data/rbi/openai/models/webhooks/live_call_incoming_webhook_event.rbi +222 -0
  44. data/rbi/openai/models/webhooks/realtime_call_incoming_webhook_event.rbi +7 -3
  45. data/rbi/openai/models/webhooks/unwrap_webhook_event.rbi +1 -0
  46. data/rbi/openai/resources/audio/transcriptions.rbi +20 -2
  47. data/rbi/openai/resources/beta/responses.rbi +14 -6
  48. data/rbi/openai/resources/chat/completions.rbi +14 -6
  49. data/rbi/openai/resources/responses.rbi +14 -6
  50. data/rbi/openai/resources/webhooks.rbi +1 -0
  51. data/sig/openai/models/audio/transcription.rbs +9 -0
  52. data/sig/openai/models/audio/transcription_create_params.rbs +14 -0
  53. data/sig/openai/models/audio/transcription_language.rbs +15 -0
  54. data/sig/openai/models/audio/transcription_text_done_event.rbs +9 -0
  55. data/sig/openai/models/audio_model.rbs +2 -0
  56. data/sig/openai/models/beta/beta_response.rbs +3 -1
  57. data/sig/openai/models/beta/beta_responses_client_event.rbs +3 -1
  58. data/sig/openai/models/beta/response_create_params.rbs +3 -1
  59. data/sig/openai/models/chat/chat_completion.rbs +3 -1
  60. data/sig/openai/models/chat/chat_completion_chunk.rbs +3 -1
  61. data/sig/openai/models/chat/completion_create_params.rbs +3 -1
  62. data/sig/openai/models/realtime/audio_transcription.rbs +18 -0
  63. data/sig/openai/models/realtime/conversation_item_input_audio_transcription_completed_event.rbs +9 -0
  64. data/sig/openai/models/responses/response.rbs +3 -1
  65. data/sig/openai/models/responses/response_create_params.rbs +3 -1
  66. data/sig/openai/models/responses/responses_client_event.rbs +3 -1
  67. data/sig/openai/models/webhooks/live_call_incoming_webhook_event.rbs +90 -0
  68. data/sig/openai/models/webhooks/unwrap_webhook_event.rbs +1 -0
  69. data/sig/openai/resources/audio/transcriptions.rbs +4 -0
  70. data/sig/openai/resources/webhooks.rbs +1 -0
  71. metadata +8 -2
@@ -267,9 +267,13 @@ module OpenAI
267
267
  # will use 'default'.
268
268
  # - If set to 'default', then the request will be processed with the standard
269
269
  # pricing and performance for the selected model.
270
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
271
- # '[priority](https://openai.com/api-priority-processing/)', then the request
272
- # will be processed with the corresponding service tier.
270
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
271
+ # then the request will be processed with the Flex Processing service tier.
272
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
273
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
274
+ # Responses or Chat Completions. The response will show `service_tier=priority`
275
+ # regardless of if you specify `service_tier=fast` or `priority` in your
276
+ # request.
273
277
  # - When not set, the default behavior is 'auto'.
274
278
  #
275
279
  # When the `service_tier` parameter is set, the response body will include the
@@ -904,9 +908,13 @@ module OpenAI
904
908
  # will use 'default'.
905
909
  # - If set to 'default', then the request will be processed with the standard
906
910
  # pricing and performance for the selected model.
907
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
908
- # '[priority](https://openai.com/api-priority-processing/)', then the request
909
- # will be processed with the corresponding service tier.
911
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
912
+ # then the request will be processed with the Flex Processing service tier.
913
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
914
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
915
+ # Responses or Chat Completions. The response will show `service_tier=priority`
916
+ # regardless of if you specify `service_tier=fast` or `priority` in your
917
+ # request.
910
918
  # - When not set, the default behavior is 'auto'.
911
919
  #
912
920
  # When the `service_tier` parameter is set, the response body will include the
@@ -923,6 +931,7 @@ module OpenAI
923
931
  FLEX = :flex
924
932
  SCALE = :scale
925
933
  PRIORITY = :priority
934
+ FAST = :fast
926
935
 
927
936
  # @!method self.values
928
937
  # @return [Array<Symbol>]
@@ -231,9 +231,13 @@ module OpenAI
231
231
  # will use 'default'.
232
232
  # - If set to 'default', then the request will be processed with the standard
233
233
  # pricing and performance for the selected model.
234
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
235
- # '[priority](https://openai.com/api-priority-processing/)', then the request
236
- # will be processed with the corresponding service tier.
234
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
235
+ # then the request will be processed with the Flex Processing service tier.
236
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
237
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
238
+ # Responses or Chat Completions. The response will show `service_tier=priority`
239
+ # regardless of if you specify `service_tier=fast` or `priority` in your
240
+ # request.
237
241
  # - When not set, the default behavior is 'auto'.
238
242
  #
239
243
  # When the `service_tier` parameter is set, the response body will include the
@@ -694,9 +698,13 @@ module OpenAI
694
698
  # will use 'default'.
695
699
  # - If set to 'default', then the request will be processed with the standard
696
700
  # pricing and performance for the selected model.
697
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
698
- # '[priority](https://openai.com/api-priority-processing/)', then the request
699
- # will be processed with the corresponding service tier.
701
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
702
+ # then the request will be processed with the Flex Processing service tier.
703
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
704
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
705
+ # Responses or Chat Completions. The response will show `service_tier=priority`
706
+ # regardless of if you specify `service_tier=fast` or `priority` in your
707
+ # request.
700
708
  # - When not set, the default behavior is 'auto'.
701
709
  #
702
710
  # When the `service_tier` parameter is set, the response body will include the
@@ -711,6 +719,7 @@ module OpenAI
711
719
  FLEX = :flex
712
720
  SCALE = :scale
713
721
  PRIORITY = :priority
722
+ FAST = :fast
714
723
 
715
724
  # @!method self.values
716
725
  # @return [Array<Symbol>]
@@ -231,9 +231,13 @@ module OpenAI
231
231
  # will use 'default'.
232
232
  # - If set to 'default', then the request will be processed with the standard
233
233
  # pricing and performance for the selected model.
234
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
235
- # '[priority](https://openai.com/api-priority-processing/)', then the request
236
- # will be processed with the corresponding service tier.
234
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
235
+ # then the request will be processed with the Flex Processing service tier.
236
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
237
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
238
+ # Responses or Chat Completions. The response will show `service_tier=priority`
239
+ # regardless of if you specify `service_tier=fast` or `priority` in your
240
+ # request.
237
241
  # - When not set, the default behavior is 'auto'.
238
242
  #
239
243
  # When the `service_tier` parameter is set, the response body will include the
@@ -709,9 +713,13 @@ module OpenAI
709
713
  # will use 'default'.
710
714
  # - If set to 'default', then the request will be processed with the standard
711
715
  # pricing and performance for the selected model.
712
- # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)' or
713
- # '[priority](https://openai.com/api-priority-processing/)', then the request
714
- # will be processed with the corresponding service tier.
716
+ # - If set to '[flex](https://platform.openai.com/docs/guides/flex-processing)',
717
+ # then the request will be processed with the Flex Processing service tier.
718
+ # - To opt-in to [Fast mode](/api/docs/guides/fast-mode) at the request level,
719
+ # include the `service_tier=fast` or `service_tier=priority` parameter for
720
+ # Responses or Chat Completions. The response will show `service_tier=priority`
721
+ # regardless of if you specify `service_tier=fast` or `priority` in your
722
+ # request.
715
723
  # - When not set, the default behavior is 'auto'.
716
724
  #
717
725
  # When the `service_tier` parameter is set, the response body will include the
@@ -728,6 +736,7 @@ module OpenAI
728
736
  FLEX = :flex
729
737
  SCALE = :scale
730
738
  PRIORITY = :priority
739
+ FAST = :fast
731
740
 
732
741
  # @!method self.values
733
742
  # @return [Array<Symbol>]
@@ -0,0 +1,121 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Webhooks
6
+ class LiveCallIncomingWebhookEvent < OpenAI::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ # The unique ID of the event.
9
+ #
10
+ # @return [String]
11
+ required :id, String
12
+
13
+ # @!attribute created_at
14
+ # The Unix timestamp (in seconds) of when the event was created.
15
+ #
16
+ # @return [Integer]
17
+ required :created_at, Integer
18
+
19
+ # @!attribute data
20
+ # Event data payload.
21
+ #
22
+ # @return [OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data]
23
+ required :data, -> { OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data }
24
+
25
+ # @!attribute type
26
+ # The type of the event. Always `live.call.incoming`.
27
+ #
28
+ # @return [Symbol, :"live.call.incoming"]
29
+ required :type, const: :"live.call.incoming"
30
+
31
+ # @!attribute object
32
+ # The object of the event. Always `event`.
33
+ #
34
+ # @return [Symbol, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Object, nil]
35
+ optional :object, enum: -> { OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Object }
36
+
37
+ # @!method initialize(id:, created_at:, data:, object: nil, type: :"live.call.incoming")
38
+ # Some parameter documentations has been truncated, see
39
+ # {OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent} for more details.
40
+ #
41
+ # Sent when an incoming API SIP session is available for Live acceptance. The same
42
+ # pending session can also emit `realtime.call.incoming`; the first successful
43
+ # Realtime or Live accept endpoint selects the runtime surface.
44
+ #
45
+ # @param id [String] The unique ID of the event.
46
+ #
47
+ # @param created_at [Integer] The Unix timestamp (in seconds) of when the event was created.
48
+ #
49
+ # @param data [OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data] Event data payload.
50
+ #
51
+ # @param object [Symbol, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Object] The object of the event. Always `event`.
52
+ #
53
+ # @param type [Symbol, :"live.call.incoming"] The type of the event. Always `live.call.incoming`.
54
+
55
+ # @see OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent#data
56
+ class Data < OpenAI::Internal::Type::BaseModel
57
+ # @!attribute session_id
58
+ # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
59
+ # as `call_id` in `realtime.call.incoming`.
60
+ #
61
+ # @return [String]
62
+ required :session_id, String
63
+
64
+ # @!attribute sip_headers
65
+ # Headers from the SIP Invite.
66
+ #
67
+ # @return [Array<OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader>]
68
+ required :sip_headers,
69
+ -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader] }
70
+
71
+ # @!method initialize(session_id:, sip_headers:)
72
+ # Some parameter documentations has been truncated, see
73
+ # {OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data} for more details.
74
+ #
75
+ # Event data payload.
76
+ #
77
+ # @param session_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The same
78
+ #
79
+ # @param sip_headers [Array<OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader>] Headers from the SIP Invite.
80
+
81
+ class SipHeader < OpenAI::Internal::Type::BaseModel
82
+ # @!attribute name
83
+ # Name of the SIP Header.
84
+ #
85
+ # @return [String]
86
+ required :name, String
87
+
88
+ # @!attribute value
89
+ # Value of the SIP Header.
90
+ #
91
+ # @return [String]
92
+ required :value, String
93
+
94
+ # @!method initialize(name:, value:)
95
+ # Some parameter documentations has been truncated, see
96
+ # {OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent::Data::SipHeader} for
97
+ # more details.
98
+ #
99
+ # A header from the SIP Invite.
100
+ #
101
+ # @param name [String] Name of the SIP Header.
102
+ #
103
+ # @param value [String] Value of the SIP Header.
104
+ end
105
+ end
106
+
107
+ # The object of the event. Always `event`.
108
+ #
109
+ # @see OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent#object
110
+ module Object
111
+ extend OpenAI::Internal::Type::Enum
112
+
113
+ EVENT = :event
114
+
115
+ # @!method self.values
116
+ # @return [Array<Symbol>]
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
@@ -38,7 +38,9 @@ module OpenAI
38
38
  # Some parameter documentations has been truncated, see
39
39
  # {OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent} for more details.
40
40
  #
41
- # Sent when Realtime API Receives a incoming SIP call.
41
+ # Sent when an incoming API SIP session is available for Realtime acceptance. The
42
+ # same pending session can also emit `live.call.incoming`; the first successful
43
+ # Realtime or Live accept endpoint selects the runtime surface.
42
44
  #
43
45
  # @param id [String] The unique ID of the event.
44
46
  #
@@ -53,7 +55,8 @@ module OpenAI
53
55
  # @see OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent#data
54
56
  class Data < OpenAI::Internal::Type::BaseModel
55
57
  # @!attribute call_id
56
- # The unique ID of this call.
58
+ # The Transceiver `rtc_...` ID of the pending SIP session. The same value appears
59
+ # as `session_id` in `live.call.incoming`.
57
60
  #
58
61
  # @return [String]
59
62
  required :call_id, String
@@ -72,7 +75,7 @@ module OpenAI
72
75
  #
73
76
  # Event data payload.
74
77
  #
75
- # @param call_id [String] The unique ID of this call.
78
+ # @param call_id [String] The Transceiver `rtc_...` ID of the pending SIP session. The same
76
79
  #
77
80
  # @param sip_headers [Array<OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent::Data::SipHeader>] Headers from the SIP Invite.
78
81
 
@@ -39,7 +39,14 @@ module OpenAI
39
39
  # Sent when a fine-tuning job has succeeded.
40
40
  variant :"fine_tuning.job.succeeded", -> { OpenAI::Webhooks::FineTuningJobSucceededWebhookEvent }
41
41
 
42
- # Sent when Realtime API Receives a incoming SIP call.
42
+ # Sent when an incoming API SIP session is available for Live acceptance. The
43
+ # same pending session can also emit `realtime.call.incoming`; the first
44
+ # successful Realtime or Live accept endpoint selects the runtime surface.
45
+ variant :"live.call.incoming", -> { OpenAI::Webhooks::LiveCallIncomingWebhookEvent }
46
+
47
+ # Sent when an incoming API SIP session is available for Realtime acceptance.
48
+ # The same pending session can also emit `live.call.incoming`; the first
49
+ # successful Realtime or Live accept endpoint selects the runtime surface.
43
50
  variant :"realtime.call.incoming", -> { OpenAI::Webhooks::RealtimeCallIncomingWebhookEvent }
44
51
 
45
52
  # Sent when a background response has been cancelled.
@@ -55,7 +62,7 @@ module OpenAI
55
62
  variant :"response.incomplete", -> { OpenAI::Webhooks::ResponseIncompleteWebhookEvent }
56
63
 
57
64
  # @!method self.variants
58
- # @return [Array(OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent)]
65
+ # @return [Array(OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent)]
59
66
  end
60
67
  end
61
68
  end
@@ -16,22 +16,26 @@ module OpenAI
16
16
  # Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
17
17
  # format, or a stream of transcript events.
18
18
  #
19
- # @overload create(file:, model:, chunking_strategy: nil, include: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
19
+ # @overload create(file:, model:, chunking_strategy: nil, include: nil, keywords: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, languages: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
20
20
  #
21
21
  # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The audio file object (not file name) to transcribe, in one of these formats: fl
22
22
  #
23
- # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc
23
+ # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `
24
24
  #
25
25
  # @param chunking_strategy [Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig, nil] Controls how the audio is cut into chunks. When set to `"auto"`, the server firs
26
26
  #
27
27
  # @param include [Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>] Additional information to include in the transcription response.
28
28
  #
29
+ # @param keywords [Array<String>] Words or phrases to guide transcription of the input audio. Supported by `gpt-tr
30
+ #
29
31
  # @param known_speaker_names [Array<String>] Optional list of speaker names that correspond to the audio samples provided in
30
32
  #
31
33
  # @param known_speaker_references [Array<String>] Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-
32
34
  #
33
35
  # @param language [String] The language of the input audio. Supplying the input language in [ISO-639-1](htt
34
36
  #
37
+ # @param languages [Array<String>] Possible languages of the input audio, in [ISO-639-1](https://en.wikipedia.org/w
38
+ #
35
39
  # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment
36
40
  #
37
41
  # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo
@@ -73,22 +77,26 @@ module OpenAI
73
77
  # Returns a transcription object in `json`, `diarized_json`, or `verbose_json`
74
78
  # format, or a stream of transcript events.
75
79
  #
76
- # @overload create_streaming(file:, model:, chunking_strategy: nil, include: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
80
+ # @overload create_streaming(file:, model:, chunking_strategy: nil, include: nil, keywords: nil, known_speaker_names: nil, known_speaker_references: nil, language: nil, languages: nil, prompt: nil, response_format: nil, temperature: nil, timestamp_granularities: nil, request_options: {})
77
81
  #
78
82
  # @param file [Pathname, StringIO, IO, String, OpenAI::FilePart] The audio file object (not file name) to transcribe, in one of these formats: fl
79
83
  #
80
- # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transc
84
+ # @param model [String, Symbol, OpenAI::Models::AudioModel] ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`, `
81
85
  #
82
86
  # @param chunking_strategy [Symbol, :auto, OpenAI::Models::Audio::TranscriptionCreateParams::ChunkingStrategy::VadConfig, nil] Controls how the audio is cut into chunks. When set to `"auto"`, the server firs
83
87
  #
84
88
  # @param include [Array<Symbol, OpenAI::Models::Audio::TranscriptionInclude>] Additional information to include in the transcription response.
85
89
  #
90
+ # @param keywords [Array<String>] Words or phrases to guide transcription of the input audio. Supported by `gpt-tr
91
+ #
86
92
  # @param known_speaker_names [Array<String>] Optional list of speaker names that correspond to the audio samples provided in
87
93
  #
88
94
  # @param known_speaker_references [Array<String>] Optional list of audio samples (as [data URLs](https://developer.mozilla.org/en-
89
95
  #
90
96
  # @param language [String] The language of the input audio. Supplying the input language in [ISO-639-1](htt
91
97
  #
98
+ # @param languages [Array<String>] Possible languages of the input audio, in [ISO-639-1](https://en.wikipedia.org/w
99
+ #
92
100
  # @param prompt [String] An optional text to guide the model's style or continue a previous audio segment
93
101
  #
94
102
  # @param response_format [Symbol, OpenAI::Models::AudioResponseFormat] The format of the output, in one of these options: `json`, `text`, `srt`, `verbo
@@ -9,7 +9,7 @@ module OpenAI
9
9
  # @param headers [Hash] The webhook headers
10
10
  # @param webhook_secret [String, nil] The webhook secret (optional, will use client webhook secret or ENV["OPENAI_WEBHOOK_SECRET"] if not provided)
11
11
  #
12
- # @return [OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent]
12
+ # @return [OpenAI::Models::Webhooks::BatchCancelledWebhookEvent, OpenAI::Models::Webhooks::BatchCompletedWebhookEvent, OpenAI::Models::Webhooks::BatchExpiredWebhookEvent, OpenAI::Models::Webhooks::BatchFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunCanceledWebhookEvent, OpenAI::Models::Webhooks::EvalRunFailedWebhookEvent, OpenAI::Models::Webhooks::EvalRunSucceededWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobCancelledWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobFailedWebhookEvent, OpenAI::Models::Webhooks::FineTuningJobSucceededWebhookEvent, OpenAI::Models::Webhooks::LiveCallIncomingWebhookEvent, OpenAI::Models::Webhooks::RealtimeCallIncomingWebhookEvent, OpenAI::Models::Webhooks::ResponseCancelledWebhookEvent, OpenAI::Models::Webhooks::ResponseCompletedWebhookEvent, OpenAI::Models::Webhooks::ResponseFailedWebhookEvent, OpenAI::Models::Webhooks::ResponseIncompleteWebhookEvent]
13
13
  #
14
14
  # @raise [ArgumentError] if signature verification fails
15
15
  def unwrap(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenAI
4
- VERSION = "0.72.0"
4
+ VERSION = "0.74.0"
5
5
  end
data/lib/openai.rb CHANGED
@@ -297,6 +297,7 @@ require_relative "openai/models/audio/transcription_create_response"
297
297
  require_relative "openai/models/audio/transcription_diarized"
298
298
  require_relative "openai/models/audio/transcription_diarized_segment"
299
299
  require_relative "openai/models/audio/transcription_include"
300
+ require_relative "openai/models/audio/transcription_language"
300
301
  require_relative "openai/models/audio/transcription_segment"
301
302
  require_relative "openai/models/audio/transcription_stream_event"
302
303
  require_relative "openai/models/audio/transcription_text_delta_event"
@@ -1148,6 +1149,7 @@ require_relative "openai/models/webhooks/eval_run_succeeded_webhook_event"
1148
1149
  require_relative "openai/models/webhooks/fine_tuning_job_cancelled_webhook_event"
1149
1150
  require_relative "openai/models/webhooks/fine_tuning_job_failed_webhook_event"
1150
1151
  require_relative "openai/models/webhooks/fine_tuning_job_succeeded_webhook_event"
1152
+ require_relative "openai/models/webhooks/live_call_incoming_webhook_event"
1151
1153
  require_relative "openai/models/webhooks/realtime_call_incoming_webhook_event"
1152
1154
  require_relative "openai/models/webhooks/response_cancelled_webhook_event"
1153
1155
  require_relative "openai/models/webhooks/response_completed_webhook_event"
@@ -13,6 +13,20 @@ module OpenAI
13
13
  sig { returns(String) }
14
14
  attr_accessor :text
15
15
 
16
+ # The languages detected in the audio. Returned by `gpt-transcribe`. An empty
17
+ # array indicates that no language could be reliably detected.
18
+ sig do
19
+ returns(T.nilable(T::Array[OpenAI::Audio::TranscriptionLanguage]))
20
+ end
21
+ attr_reader :languages
22
+
23
+ sig do
24
+ params(
25
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash]
26
+ ).void
27
+ end
28
+ attr_writer :languages
29
+
16
30
  # The log probabilities of the tokens in the transcription. Only returned with the
17
31
  # models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added
18
32
  # to the `include` array.
@@ -50,6 +64,7 @@ module OpenAI
50
64
  sig do
51
65
  params(
52
66
  text: String,
67
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash],
53
68
  logprobs: T::Array[OpenAI::Audio::Transcription::Logprob::OrHash],
54
69
  usage:
55
70
  T.any(
@@ -61,6 +76,9 @@ module OpenAI
61
76
  def self.new(
62
77
  # The transcribed text.
63
78
  text:,
79
+ # The languages detected in the audio. Returned by `gpt-transcribe`. An empty
80
+ # array indicates that no language could be reliably detected.
81
+ languages: nil,
64
82
  # The log probabilities of the tokens in the transcription. Only returned with the
65
83
  # models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added
66
84
  # to the `include` array.
@@ -74,6 +92,7 @@ module OpenAI
74
92
  override.returns(
75
93
  {
76
94
  text: String,
95
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage],
77
96
  logprobs: T::Array[OpenAI::Audio::Transcription::Logprob],
78
97
  usage: OpenAI::Audio::Transcription::Usage::Variants
79
98
  }
@@ -20,7 +20,7 @@ module OpenAI
20
20
  sig { returns(OpenAI::Internal::FileInput) }
21
21
  attr_accessor :file
22
22
 
23
- # ID of the model to use. The options are `gpt-4o-transcribe`,
23
+ # ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
24
24
  # `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
25
25
  # (which is powered by our open source Whisper V2 model), and
26
26
  # `gpt-4o-transcribe-diarize`.
@@ -65,6 +65,14 @@ module OpenAI
65
65
  end
66
66
  attr_writer :include
67
67
 
68
+ # Words or phrases to guide transcription of the input audio. Supported by
69
+ # `gpt-transcribe`.
70
+ sig { returns(T.nilable(T::Array[String])) }
71
+ attr_reader :keywords
72
+
73
+ sig { params(keywords: T::Array[String]).void }
74
+ attr_writer :keywords
75
+
68
76
  # Optional list of speaker names that correspond to the audio samples provided in
69
77
  # `known_speaker_references[]`. Each entry should be a short identifier (for
70
78
  # example `customer` or `agent`). Up to 4 speakers are supported.
@@ -94,6 +102,15 @@ module OpenAI
94
102
  sig { params(language: String).void }
95
103
  attr_writer :language
96
104
 
105
+ # Possible languages of the input audio, in
106
+ # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
107
+ # Supported by `gpt-transcribe`.
108
+ sig { returns(T.nilable(T::Array[String])) }
109
+ attr_reader :languages
110
+
111
+ sig { params(languages: T::Array[String]).void }
112
+ attr_writer :languages
113
+
97
114
  # An optional text to guide the model's style or continue a previous audio
98
115
  # segment. The
99
116
  # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
@@ -168,9 +185,11 @@ module OpenAI
168
185
  )
169
186
  ),
170
187
  include: T::Array[OpenAI::Audio::TranscriptionInclude::OrSymbol],
188
+ keywords: T::Array[String],
171
189
  known_speaker_names: T::Array[String],
172
190
  known_speaker_references: T::Array[String],
173
191
  language: String,
192
+ languages: T::Array[String],
174
193
  prompt: String,
175
194
  response_format: OpenAI::AudioResponseFormat::OrSymbol,
176
195
  temperature: Float,
@@ -185,7 +204,7 @@ module OpenAI
185
204
  # The audio file object (not file name) to transcribe, in one of these formats:
186
205
  # flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.
187
206
  file:,
188
- # ID of the model to use. The options are `gpt-4o-transcribe`,
207
+ # ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
189
208
  # `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
190
209
  # (which is powered by our open source Whisper V2 model), and
191
210
  # `gpt-4o-transcribe-diarize`.
@@ -204,6 +223,9 @@ module OpenAI
204
223
  # `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is
205
224
  # not supported when using `gpt-4o-transcribe-diarize`.
206
225
  include: nil,
226
+ # Words or phrases to guide transcription of the input audio. Supported by
227
+ # `gpt-transcribe`.
228
+ keywords: nil,
207
229
  # Optional list of speaker names that correspond to the audio samples provided in
208
230
  # `known_speaker_references[]`. Each entry should be a short identifier (for
209
231
  # example `customer` or `agent`). Up to 4 speakers are supported.
@@ -218,6 +240,10 @@ module OpenAI
218
240
  # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`)
219
241
  # format will improve accuracy and latency.
220
242
  language: nil,
243
+ # Possible languages of the input audio, in
244
+ # [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format.
245
+ # Supported by `gpt-transcribe`.
246
+ languages: nil,
221
247
  # An optional text to guide the model's style or continue a previous audio
222
248
  # segment. The
223
249
  # [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting)
@@ -260,9 +286,11 @@ module OpenAI
260
286
  )
261
287
  ),
262
288
  include: T::Array[OpenAI::Audio::TranscriptionInclude::OrSymbol],
289
+ keywords: T::Array[String],
263
290
  known_speaker_names: T::Array[String],
264
291
  known_speaker_references: T::Array[String],
265
292
  language: String,
293
+ languages: T::Array[String],
266
294
  prompt: String,
267
295
  response_format: OpenAI::AudioResponseFormat::OrSymbol,
268
296
  temperature: Float,
@@ -277,7 +305,7 @@ module OpenAI
277
305
  def to_hash
278
306
  end
279
307
 
280
- # ID of the model to use. The options are `gpt-4o-transcribe`,
308
+ # ID of the model to use. The options are `gpt-transcribe`, `gpt-4o-transcribe`,
281
309
  # `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `whisper-1`
282
310
  # (which is powered by our open source Whisper V2 model), and
283
311
  # `gpt-4o-transcribe-diarize`.
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module OpenAI
4
+ module Models
5
+ module Audio
6
+ class TranscriptionLanguage < OpenAI::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ OpenAI::Audio::TranscriptionLanguage,
11
+ OpenAI::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ # The code of a language detected in the audio.
16
+ sig { returns(String) }
17
+ attr_accessor :code
18
+
19
+ # A language detected in transcribed audio.
20
+ sig { params(code: String).returns(T.attached_class) }
21
+ def self.new(
22
+ # The code of a language detected in the audio.
23
+ code:
24
+ )
25
+ end
26
+
27
+ sig { override.returns({ code: String }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -20,6 +20,20 @@ module OpenAI
20
20
  sig { returns(Symbol) }
21
21
  attr_accessor :type
22
22
 
23
+ # The languages detected in the audio. Returned by `gpt-transcribe`. An empty
24
+ # array indicates that no language could be reliably detected.
25
+ sig do
26
+ returns(T.nilable(T::Array[OpenAI::Audio::TranscriptionLanguage]))
27
+ end
28
+ attr_reader :languages
29
+
30
+ sig do
31
+ params(
32
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash]
33
+ ).void
34
+ end
35
+ attr_writer :languages
36
+
23
37
  # The log probabilities of the individual tokens in the transcription. Only
24
38
  # included if you
25
39
  # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription)
@@ -63,6 +77,7 @@ module OpenAI
63
77
  sig do
64
78
  params(
65
79
  text: String,
80
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage::OrHash],
66
81
  logprobs:
67
82
  T::Array[
68
83
  OpenAI::Audio::TranscriptionTextDoneEvent::Logprob::OrHash
@@ -74,6 +89,9 @@ module OpenAI
74
89
  def self.new(
75
90
  # The text that was transcribed.
76
91
  text:,
92
+ # The languages detected in the audio. Returned by `gpt-transcribe`. An empty
93
+ # array indicates that no language could be reliably detected.
94
+ languages: nil,
77
95
  # The log probabilities of the individual tokens in the transcription. Only
78
96
  # included if you
79
97
  # [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription)
@@ -91,6 +109,7 @@ module OpenAI
91
109
  {
92
110
  text: String,
93
111
  type: Symbol,
112
+ languages: T::Array[OpenAI::Audio::TranscriptionLanguage],
94
113
  logprobs:
95
114
  T::Array[OpenAI::Audio::TranscriptionTextDoneEvent::Logprob],
96
115
  usage: OpenAI::Audio::TranscriptionTextDoneEvent::Usage
@@ -9,6 +9,8 @@ module OpenAI
9
9
  OrSymbol = T.type_alias { T.any(Symbol, String) }
10
10
 
11
11
  WHISPER_1 = T.let(:"whisper-1", OpenAI::AudioModel::TaggedSymbol)
12
+ GPT_TRANSCRIBE =
13
+ T.let(:"gpt-transcribe", OpenAI::AudioModel::TaggedSymbol)
12
14
  GPT_4O_TRANSCRIBE =
13
15
  T.let(:"gpt-4o-transcribe", OpenAI::AudioModel::TaggedSymbol)
14
16
  GPT_4O_MINI_TRANSCRIBE =