openai 0.31.0 → 0.32.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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/openai/internal/util.rb +5 -5
  5. data/lib/openai/models/audio/transcription_create_params.rb +42 -11
  6. data/lib/openai/models/audio/transcription_create_response.rb +4 -1
  7. data/lib/openai/models/audio/transcription_diarized.rb +160 -0
  8. data/lib/openai/models/audio/transcription_diarized_segment.rb +65 -0
  9. data/lib/openai/models/audio/transcription_stream_event.rb +7 -4
  10. data/lib/openai/models/audio/transcription_text_delta_event.rb +10 -1
  11. data/lib/openai/models/audio/transcription_text_segment_event.rb +63 -0
  12. data/lib/openai/models/audio_model.rb +1 -0
  13. data/lib/openai/models/audio_response_format.rb +5 -2
  14. data/lib/openai/models/realtime/audio_transcription.rb +8 -6
  15. data/lib/openai/models/vector_store_create_params.rb +10 -1
  16. data/lib/openai/resources/audio/transcriptions.rb +12 -4
  17. data/lib/openai/resources/vector_stores.rb +3 -1
  18. data/lib/openai/version.rb +1 -1
  19. data/lib/openai.rb +3 -0
  20. data/rbi/openai/models/audio/transcription_create_params.rbi +66 -16
  21. data/rbi/openai/models/audio/transcription_create_response.rbi +1 -0
  22. data/rbi/openai/models/audio/transcription_diarized.rbi +281 -0
  23. data/rbi/openai/models/audio/transcription_diarized_segment.rbi +87 -0
  24. data/rbi/openai/models/audio/transcription_stream_event.rbi +4 -3
  25. data/rbi/openai/models/audio/transcription_text_delta_event.rbi +14 -1
  26. data/rbi/openai/models/audio/transcription_text_segment_event.rbi +86 -0
  27. data/rbi/openai/models/audio_model.rbi +2 -0
  28. data/rbi/openai/models/audio_response_format.rbi +6 -2
  29. data/rbi/openai/models/realtime/audio_transcription.rbi +15 -12
  30. data/rbi/openai/models/vector_store_create_params.rbi +13 -0
  31. data/rbi/openai/resources/audio/transcriptions.rbi +52 -14
  32. data/rbi/openai/resources/vector_stores.rbi +4 -0
  33. data/sig/openai/models/audio/transcription_create_params.rbs +14 -0
  34. data/sig/openai/models/audio/transcription_create_response.rbs +3 -1
  35. data/sig/openai/models/audio/transcription_diarized.rbs +129 -0
  36. data/sig/openai/models/audio/transcription_diarized_segment.rbs +47 -0
  37. data/sig/openai/models/audio/transcription_stream_event.rbs +2 -1
  38. data/sig/openai/models/audio/transcription_text_delta_event.rbs +9 -2
  39. data/sig/openai/models/audio/transcription_text_segment_event.rbs +47 -0
  40. data/sig/openai/models/audio_model.rbs +5 -1
  41. data/sig/openai/models/audio_response_format.rbs +3 -1
  42. data/sig/openai/models/realtime/audio_transcription.rbs +2 -2
  43. data/sig/openai/models/vector_store_create_params.rbs +7 -0
  44. data/sig/openai/resources/audio/transcriptions.rbs +4 -0
  45. data/sig/openai/resources/vector_stores.rbs +1 -0
  46. metadata +11 -2
@@ -0,0 +1,129 @@
1
+ module OpenAI
2
+ module Models
3
+ module Audio
4
+ type transcription_diarized =
5
+ {
6
+ duration: Float,
7
+ segments: ::Array[OpenAI::Audio::TranscriptionDiarizedSegment],
8
+ task: :transcribe,
9
+ text: String,
10
+ usage: OpenAI::Models::Audio::TranscriptionDiarized::usage
11
+ }
12
+
13
+ class TranscriptionDiarized < OpenAI::Internal::Type::BaseModel
14
+ attr_accessor duration: Float
15
+
16
+ attr_accessor segments: ::Array[OpenAI::Audio::TranscriptionDiarizedSegment]
17
+
18
+ attr_accessor task: :transcribe
19
+
20
+ attr_accessor text: String
21
+
22
+ attr_reader usage: OpenAI::Models::Audio::TranscriptionDiarized::usage?
23
+
24
+ def usage=: (
25
+ OpenAI::Models::Audio::TranscriptionDiarized::usage
26
+ ) -> OpenAI::Models::Audio::TranscriptionDiarized::usage
27
+
28
+ def initialize: (
29
+ duration: Float,
30
+ segments: ::Array[OpenAI::Audio::TranscriptionDiarizedSegment],
31
+ text: String,
32
+ ?usage: OpenAI::Models::Audio::TranscriptionDiarized::usage,
33
+ ?task: :transcribe
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ duration: Float,
38
+ segments: ::Array[OpenAI::Audio::TranscriptionDiarizedSegment],
39
+ task: :transcribe,
40
+ text: String,
41
+ usage: OpenAI::Models::Audio::TranscriptionDiarized::usage
42
+ }
43
+
44
+ type usage =
45
+ OpenAI::Audio::TranscriptionDiarized::Usage::Tokens
46
+ | OpenAI::Audio::TranscriptionDiarized::Usage::Duration
47
+
48
+ module Usage
49
+ extend OpenAI::Internal::Type::Union
50
+
51
+ type tokens =
52
+ {
53
+ input_tokens: Integer,
54
+ output_tokens: Integer,
55
+ total_tokens: Integer,
56
+ type: :tokens,
57
+ input_token_details: OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails
58
+ }
59
+
60
+ class Tokens < OpenAI::Internal::Type::BaseModel
61
+ attr_accessor input_tokens: Integer
62
+
63
+ attr_accessor output_tokens: Integer
64
+
65
+ attr_accessor total_tokens: Integer
66
+
67
+ attr_accessor type: :tokens
68
+
69
+ attr_reader input_token_details: OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails?
70
+
71
+ def input_token_details=: (
72
+ OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails
73
+ ) -> OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails
74
+
75
+ def initialize: (
76
+ input_tokens: Integer,
77
+ output_tokens: Integer,
78
+ total_tokens: Integer,
79
+ ?input_token_details: OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails,
80
+ ?type: :tokens
81
+ ) -> void
82
+
83
+ def to_hash: -> {
84
+ input_tokens: Integer,
85
+ output_tokens: Integer,
86
+ total_tokens: Integer,
87
+ type: :tokens,
88
+ input_token_details: OpenAI::Audio::TranscriptionDiarized::Usage::Tokens::InputTokenDetails
89
+ }
90
+
91
+ type input_token_details =
92
+ { audio_tokens: Integer, text_tokens: Integer }
93
+
94
+ class InputTokenDetails < OpenAI::Internal::Type::BaseModel
95
+ attr_reader audio_tokens: Integer?
96
+
97
+ def audio_tokens=: (Integer) -> Integer
98
+
99
+ attr_reader text_tokens: Integer?
100
+
101
+ def text_tokens=: (Integer) -> Integer
102
+
103
+ def initialize: (
104
+ ?audio_tokens: Integer,
105
+ ?text_tokens: Integer
106
+ ) -> void
107
+
108
+ def to_hash: -> { audio_tokens: Integer, text_tokens: Integer }
109
+ end
110
+ end
111
+
112
+ type duration = { seconds: Float, type: :duration }
113
+
114
+ class Duration < OpenAI::Internal::Type::BaseModel
115
+ attr_accessor seconds: Float
116
+
117
+ attr_accessor type: :duration
118
+
119
+ def initialize: (seconds: Float, ?type: :duration) -> void
120
+
121
+ def to_hash: -> { seconds: Float, type: :duration }
122
+ end
123
+
124
+ def self?.variants: -> ::Array[OpenAI::Models::Audio::TranscriptionDiarized::usage]
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -0,0 +1,47 @@
1
+ module OpenAI
2
+ module Models
3
+ module Audio
4
+ type transcription_diarized_segment =
5
+ {
6
+ id: String,
7
+ end_: Float,
8
+ speaker: String,
9
+ start: Float,
10
+ text: String,
11
+ type: :"transcript.text.segment"
12
+ }
13
+
14
+ class TranscriptionDiarizedSegment < OpenAI::Internal::Type::BaseModel
15
+ attr_accessor id: String
16
+
17
+ attr_accessor end_: Float
18
+
19
+ attr_accessor speaker: String
20
+
21
+ attr_accessor start: Float
22
+
23
+ attr_accessor text: String
24
+
25
+ attr_accessor type: :"transcript.text.segment"
26
+
27
+ def initialize: (
28
+ id: String,
29
+ end_: Float,
30
+ speaker: String,
31
+ start: Float,
32
+ text: String,
33
+ ?type: :"transcript.text.segment"
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ id: String,
38
+ end_: Float,
39
+ speaker: String,
40
+ start: Float,
41
+ text: String,
42
+ type: :"transcript.text.segment"
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -2,7 +2,8 @@ module OpenAI
2
2
  module Models
3
3
  module Audio
4
4
  type transcription_stream_event =
5
- OpenAI::Audio::TranscriptionTextDeltaEvent
5
+ OpenAI::Audio::TranscriptionTextSegmentEvent
6
+ | OpenAI::Audio::TranscriptionTextDeltaEvent
6
7
  | OpenAI::Audio::TranscriptionTextDoneEvent
7
8
 
8
9
  module TranscriptionStreamEvent
@@ -5,7 +5,8 @@ module OpenAI
5
5
  {
6
6
  delta: String,
7
7
  type: :"transcript.text.delta",
8
- logprobs: ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob]
8
+ logprobs: ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob],
9
+ segment_id: String
9
10
  }
10
11
 
11
12
  class TranscriptionTextDeltaEvent < OpenAI::Internal::Type::BaseModel
@@ -19,16 +20,22 @@ module OpenAI
19
20
  ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob]
20
21
  ) -> ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob]
21
22
 
23
+ attr_reader segment_id: String?
24
+
25
+ def segment_id=: (String) -> String
26
+
22
27
  def initialize: (
23
28
  delta: String,
24
29
  ?logprobs: ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob],
30
+ ?segment_id: String,
25
31
  ?type: :"transcript.text.delta"
26
32
  ) -> void
27
33
 
28
34
  def to_hash: -> {
29
35
  delta: String,
30
36
  type: :"transcript.text.delta",
31
- logprobs: ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob]
37
+ logprobs: ::Array[OpenAI::Audio::TranscriptionTextDeltaEvent::Logprob],
38
+ segment_id: String
32
39
  }
33
40
 
34
41
  type logprob =
@@ -0,0 +1,47 @@
1
+ module OpenAI
2
+ module Models
3
+ module Audio
4
+ type transcription_text_segment_event =
5
+ {
6
+ id: String,
7
+ end_: Float,
8
+ speaker: String,
9
+ start: Float,
10
+ text: String,
11
+ type: :"transcript.text.segment"
12
+ }
13
+
14
+ class TranscriptionTextSegmentEvent < OpenAI::Internal::Type::BaseModel
15
+ attr_accessor id: String
16
+
17
+ attr_accessor end_: Float
18
+
19
+ attr_accessor speaker: String
20
+
21
+ attr_accessor start: Float
22
+
23
+ attr_accessor text: String
24
+
25
+ attr_accessor type: :"transcript.text.segment"
26
+
27
+ def initialize: (
28
+ id: String,
29
+ end_: Float,
30
+ speaker: String,
31
+ start: Float,
32
+ text: String,
33
+ ?type: :"transcript.text.segment"
34
+ ) -> void
35
+
36
+ def to_hash: -> {
37
+ id: String,
38
+ end_: Float,
39
+ speaker: String,
40
+ start: Float,
41
+ text: String,
42
+ type: :"transcript.text.segment"
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -1,7 +1,10 @@
1
1
  module OpenAI
2
2
  module Models
3
3
  type audio_model =
4
- :"whisper-1" | :"gpt-4o-transcribe" | :"gpt-4o-mini-transcribe"
4
+ :"whisper-1"
5
+ | :"gpt-4o-transcribe"
6
+ | :"gpt-4o-mini-transcribe"
7
+ | :"gpt-4o-transcribe-diarize"
5
8
 
6
9
  module AudioModel
7
10
  extend OpenAI::Internal::Type::Enum
@@ -9,6 +12,7 @@ module OpenAI
9
12
  WHISPER_1: :"whisper-1"
10
13
  GPT_4O_TRANSCRIBE: :"gpt-4o-transcribe"
11
14
  GPT_4O_MINI_TRANSCRIBE: :"gpt-4o-mini-transcribe"
15
+ GPT_4O_TRANSCRIBE_DIARIZE: :"gpt-4o-transcribe-diarize"
12
16
 
13
17
  def self?.values: -> ::Array[OpenAI::Models::audio_model]
14
18
  end
@@ -1,6 +1,7 @@
1
1
  module OpenAI
2
2
  module Models
3
- type audio_response_format = :json | :text | :srt | :verbose_json | :vtt
3
+ type audio_response_format =
4
+ :json | :text | :srt | :verbose_json | :vtt | :diarized_json
4
5
 
5
6
  module AudioResponseFormat
6
7
  extend OpenAI::Internal::Type::Enum
@@ -10,6 +11,7 @@ module OpenAI
10
11
  SRT: :srt
11
12
  VERBOSE_JSON: :verbose_json
12
13
  VTT: :vtt
14
+ DIARIZED_JSON: :diarized_json
13
15
 
14
16
  def self?.values: -> ::Array[OpenAI::Models::audio_response_format]
15
17
  end
@@ -37,17 +37,17 @@ module OpenAI
37
37
 
38
38
  type model =
39
39
  :"whisper-1"
40
- | :"gpt-4o-transcribe-latest"
41
40
  | :"gpt-4o-mini-transcribe"
42
41
  | :"gpt-4o-transcribe"
42
+ | :"gpt-4o-transcribe-diarize"
43
43
 
44
44
  module Model
45
45
  extend OpenAI::Internal::Type::Enum
46
46
 
47
47
  WHISPER_1: :"whisper-1"
48
- GPT_4O_TRANSCRIBE_LATEST: :"gpt-4o-transcribe-latest"
49
48
  GPT_4O_MINI_TRANSCRIBE: :"gpt-4o-mini-transcribe"
50
49
  GPT_4O_TRANSCRIBE: :"gpt-4o-transcribe"
50
+ GPT_4O_TRANSCRIBE_DIARIZE: :"gpt-4o-transcribe-diarize"
51
51
 
52
52
  def self?.values: -> ::Array[OpenAI::Models::Realtime::AudioTranscription::model]
53
53
  end
@@ -3,6 +3,7 @@ module OpenAI
3
3
  type vector_store_create_params =
4
4
  {
5
5
  chunking_strategy: OpenAI::Models::file_chunking_strategy_param,
6
+ description: String,
6
7
  expires_after: OpenAI::VectorStoreCreateParams::ExpiresAfter,
7
8
  file_ids: ::Array[String],
8
9
  metadata: OpenAI::Models::metadata?,
@@ -20,6 +21,10 @@ module OpenAI
20
21
  OpenAI::Models::file_chunking_strategy_param
21
22
  ) -> OpenAI::Models::file_chunking_strategy_param
22
23
 
24
+ attr_reader description: String?
25
+
26
+ def description=: (String) -> String
27
+
23
28
  attr_reader expires_after: OpenAI::VectorStoreCreateParams::ExpiresAfter?
24
29
 
25
30
  def expires_after=: (
@@ -38,6 +43,7 @@ module OpenAI
38
43
 
39
44
  def initialize: (
40
45
  ?chunking_strategy: OpenAI::Models::file_chunking_strategy_param,
46
+ ?description: String,
41
47
  ?expires_after: OpenAI::VectorStoreCreateParams::ExpiresAfter,
42
48
  ?file_ids: ::Array[String],
43
49
  ?metadata: OpenAI::Models::metadata?,
@@ -47,6 +53,7 @@ module OpenAI
47
53
 
48
54
  def to_hash: -> {
49
55
  chunking_strategy: OpenAI::Models::file_chunking_strategy_param,
56
+ description: String,
50
57
  expires_after: OpenAI::VectorStoreCreateParams::ExpiresAfter,
51
58
  file_ids: ::Array[String],
52
59
  metadata: OpenAI::Models::metadata?,
@@ -7,6 +7,8 @@ module OpenAI
7
7
  model: OpenAI::Models::Audio::TranscriptionCreateParams::model,
8
8
  ?chunking_strategy: OpenAI::Models::Audio::TranscriptionCreateParams::chunking_strategy?,
9
9
  ?include: ::Array[OpenAI::Models::Audio::transcription_include],
10
+ ?known_speaker_names: ::Array[String],
11
+ ?known_speaker_references: ::Array[String],
10
12
  ?language: String,
11
13
  ?prompt: String,
12
14
  ?response_format: OpenAI::Models::audio_response_format,
@@ -20,6 +22,8 @@ module OpenAI
20
22
  model: OpenAI::Models::Audio::TranscriptionCreateParams::model,
21
23
  ?chunking_strategy: OpenAI::Models::Audio::TranscriptionCreateParams::chunking_strategy?,
22
24
  ?include: ::Array[OpenAI::Models::Audio::transcription_include],
25
+ ?known_speaker_names: ::Array[String],
26
+ ?known_speaker_references: ::Array[String],
23
27
  ?language: String,
24
28
  ?prompt: String,
25
29
  ?response_format: OpenAI::Models::audio_response_format,
@@ -7,6 +7,7 @@ module OpenAI
7
7
 
8
8
  def create: (
9
9
  ?chunking_strategy: OpenAI::Models::file_chunking_strategy_param,
10
+ ?description: String,
10
11
  ?expires_after: OpenAI::VectorStoreCreateParams::ExpiresAfter,
11
12
  ?file_ids: ::Array[String],
12
13
  ?metadata: OpenAI::Models::metadata?,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.0
4
+ version: 0.32.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenAI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-10 00:00:00.000000000 Z
11
+ date: 2025-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool
@@ -79,11 +79,14 @@ files:
79
79
  - lib/openai/models/audio/transcription.rb
80
80
  - lib/openai/models/audio/transcription_create_params.rb
81
81
  - lib/openai/models/audio/transcription_create_response.rb
82
+ - lib/openai/models/audio/transcription_diarized.rb
83
+ - lib/openai/models/audio/transcription_diarized_segment.rb
82
84
  - lib/openai/models/audio/transcription_include.rb
83
85
  - lib/openai/models/audio/transcription_segment.rb
84
86
  - lib/openai/models/audio/transcription_stream_event.rb
85
87
  - lib/openai/models/audio/transcription_text_delta_event.rb
86
88
  - lib/openai/models/audio/transcription_text_done_event.rb
89
+ - lib/openai/models/audio/transcription_text_segment_event.rb
87
90
  - lib/openai/models/audio/transcription_verbose.rb
88
91
  - lib/openai/models/audio/transcription_word.rb
89
92
  - lib/openai/models/audio/translation.rb
@@ -811,11 +814,14 @@ files:
811
814
  - rbi/openai/models/audio/transcription.rbi
812
815
  - rbi/openai/models/audio/transcription_create_params.rbi
813
816
  - rbi/openai/models/audio/transcription_create_response.rbi
817
+ - rbi/openai/models/audio/transcription_diarized.rbi
818
+ - rbi/openai/models/audio/transcription_diarized_segment.rbi
814
819
  - rbi/openai/models/audio/transcription_include.rbi
815
820
  - rbi/openai/models/audio/transcription_segment.rbi
816
821
  - rbi/openai/models/audio/transcription_stream_event.rbi
817
822
  - rbi/openai/models/audio/transcription_text_delta_event.rbi
818
823
  - rbi/openai/models/audio/transcription_text_done_event.rbi
824
+ - rbi/openai/models/audio/transcription_text_segment_event.rbi
819
825
  - rbi/openai/models/audio/transcription_verbose.rbi
820
826
  - rbi/openai/models/audio/transcription_word.rbi
821
827
  - rbi/openai/models/audio/translation.rbi
@@ -1532,11 +1538,14 @@ files:
1532
1538
  - sig/openai/models/audio/transcription.rbs
1533
1539
  - sig/openai/models/audio/transcription_create_params.rbs
1534
1540
  - sig/openai/models/audio/transcription_create_response.rbs
1541
+ - sig/openai/models/audio/transcription_diarized.rbs
1542
+ - sig/openai/models/audio/transcription_diarized_segment.rbs
1535
1543
  - sig/openai/models/audio/transcription_include.rbs
1536
1544
  - sig/openai/models/audio/transcription_segment.rbs
1537
1545
  - sig/openai/models/audio/transcription_stream_event.rbs
1538
1546
  - sig/openai/models/audio/transcription_text_delta_event.rbs
1539
1547
  - sig/openai/models/audio/transcription_text_done_event.rbs
1548
+ - sig/openai/models/audio/transcription_text_segment_event.rbs
1540
1549
  - sig/openai/models/audio/transcription_verbose.rbs
1541
1550
  - sig/openai/models/audio/transcription_word.rbs
1542
1551
  - sig/openai/models/audio/translation.rbs