openai 0.31.0 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +1 -1
- data/lib/openai/internal/util.rb +5 -5
- data/lib/openai/models/audio/transcription_create_params.rb +42 -11
- data/lib/openai/models/audio/transcription_create_response.rb +4 -1
- data/lib/openai/models/audio/transcription_diarized.rb +160 -0
- data/lib/openai/models/audio/transcription_diarized_segment.rb +65 -0
- data/lib/openai/models/audio/transcription_stream_event.rb +7 -4
- data/lib/openai/models/audio/transcription_text_delta_event.rb +10 -1
- data/lib/openai/models/audio/transcription_text_segment_event.rb +63 -0
- data/lib/openai/models/audio_model.rb +1 -0
- data/lib/openai/models/audio_response_format.rb +5 -2
- data/lib/openai/models/realtime/audio_transcription.rb +8 -6
- data/lib/openai/models/vector_store_create_params.rb +10 -1
- data/lib/openai/resources/audio/transcriptions.rb +12 -4
- data/lib/openai/resources/beta/chatkit.rb +0 -26
- data/lib/openai/resources/vector_stores.rb +3 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +3 -4
- data/rbi/openai/models/audio/transcription_create_params.rbi +66 -16
- data/rbi/openai/models/audio/transcription_create_response.rbi +1 -0
- data/rbi/openai/models/audio/transcription_diarized.rbi +281 -0
- data/rbi/openai/models/audio/transcription_diarized_segment.rbi +87 -0
- data/rbi/openai/models/audio/transcription_stream_event.rbi +4 -3
- data/rbi/openai/models/audio/transcription_text_delta_event.rbi +14 -1
- data/rbi/openai/models/audio/transcription_text_segment_event.rbi +86 -0
- data/rbi/openai/models/audio_model.rbi +2 -0
- data/rbi/openai/models/audio_response_format.rbi +6 -2
- data/rbi/openai/models/realtime/audio_transcription.rbi +15 -12
- data/rbi/openai/models/vector_store_create_params.rbi +13 -0
- data/rbi/openai/resources/audio/transcriptions.rbi +52 -14
- data/rbi/openai/resources/beta/chatkit.rbi +0 -15
- data/rbi/openai/resources/vector_stores.rbi +4 -0
- data/sig/openai/models/audio/transcription_create_params.rbs +14 -0
- data/sig/openai/models/audio/transcription_create_response.rbs +3 -1
- data/sig/openai/models/audio/transcription_diarized.rbs +129 -0
- data/sig/openai/models/audio/transcription_diarized_segment.rbs +47 -0
- data/sig/openai/models/audio/transcription_stream_event.rbs +2 -1
- data/sig/openai/models/audio/transcription_text_delta_event.rbs +9 -2
- data/sig/openai/models/audio/transcription_text_segment_event.rbs +47 -0
- data/sig/openai/models/audio_model.rbs +5 -1
- data/sig/openai/models/audio_response_format.rbs +3 -1
- data/sig/openai/models/realtime/audio_transcription.rbs +2 -2
- data/sig/openai/models/vector_store_create_params.rbs +7 -0
- data/sig/openai/resources/audio/transcriptions.rbs +4 -0
- data/sig/openai/resources/beta/chatkit.rbs +0 -5
- data/sig/openai/resources/vector_stores.rbs +1 -0
- metadata +11 -14
- data/lib/openai/models/beta/chatkit_upload_file_params.rb +0 -28
- data/lib/openai/models/beta/chatkit_upload_file_response.rb +0 -25
- data/lib/openai/models/beta/file_part.rb +0 -56
- data/lib/openai/models/beta/image_part.rb +0 -64
- data/rbi/openai/models/beta/chatkit_upload_file_params.rbi +0 -50
- data/rbi/openai/models/beta/chatkit_upload_file_response.rbi +0 -25
- data/rbi/openai/models/beta/file_part.rbi +0 -74
- data/rbi/openai/models/beta/image_part.rbi +0 -82
- data/sig/openai/models/beta/chatkit_upload_file_params.rbs +0 -26
- data/sig/openai/models/beta/chatkit_upload_file_response.rbs +0 -14
- data/sig/openai/models/beta/file_part.rbs +0 -42
- data/sig/openai/models/beta/image_part.rbs +0 -47
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Beta
|
6
|
-
class ImagePart < OpenAI::Internal::Type::BaseModel
|
7
|
-
# @!attribute id
|
8
|
-
# Unique identifier for the uploaded image.
|
9
|
-
#
|
10
|
-
# @return [String]
|
11
|
-
required :id, String
|
12
|
-
|
13
|
-
# @!attribute mime_type
|
14
|
-
# MIME type of the uploaded image.
|
15
|
-
#
|
16
|
-
# @return [String]
|
17
|
-
required :mime_type, String
|
18
|
-
|
19
|
-
# @!attribute name
|
20
|
-
# Original filename for the uploaded image. Defaults to null when unnamed.
|
21
|
-
#
|
22
|
-
# @return [String, nil]
|
23
|
-
required :name, String, nil?: true
|
24
|
-
|
25
|
-
# @!attribute preview_url
|
26
|
-
# Preview URL that can be rendered inline for the image.
|
27
|
-
#
|
28
|
-
# @return [String]
|
29
|
-
required :preview_url, String
|
30
|
-
|
31
|
-
# @!attribute type
|
32
|
-
# Type discriminator that is always `image`.
|
33
|
-
#
|
34
|
-
# @return [Symbol, :image]
|
35
|
-
required :type, const: :image
|
36
|
-
|
37
|
-
# @!attribute upload_url
|
38
|
-
# Signed URL for downloading the uploaded image. Defaults to null when no download
|
39
|
-
# link is available.
|
40
|
-
#
|
41
|
-
# @return [String, nil]
|
42
|
-
required :upload_url, String, nil?: true
|
43
|
-
|
44
|
-
# @!method initialize(id:, mime_type:, name:, preview_url:, upload_url:, type: :image)
|
45
|
-
# Some parameter documentations has been truncated, see
|
46
|
-
# {OpenAI::Models::Beta::ImagePart} for more details.
|
47
|
-
#
|
48
|
-
# Metadata for an image uploaded through ChatKit.
|
49
|
-
#
|
50
|
-
# @param id [String] Unique identifier for the uploaded image.
|
51
|
-
#
|
52
|
-
# @param mime_type [String] MIME type of the uploaded image.
|
53
|
-
#
|
54
|
-
# @param name [String, nil] Original filename for the uploaded image. Defaults to null when unnamed.
|
55
|
-
#
|
56
|
-
# @param preview_url [String] Preview URL that can be rendered inline for the image.
|
57
|
-
#
|
58
|
-
# @param upload_url [String, nil] Signed URL for downloading the uploaded image. Defaults to null when no download
|
59
|
-
#
|
60
|
-
# @param type [Symbol, :image] Type discriminator that is always `image`.
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Beta
|
6
|
-
class ChatKitUploadFileParams < OpenAI::Internal::Type::BaseModel
|
7
|
-
extend OpenAI::Internal::Type::RequestParameters::Converter
|
8
|
-
include OpenAI::Internal::Type::RequestParameters
|
9
|
-
|
10
|
-
OrHash =
|
11
|
-
T.type_alias do
|
12
|
-
T.any(
|
13
|
-
OpenAI::Beta::ChatKitUploadFileParams,
|
14
|
-
OpenAI::Internal::AnyHash
|
15
|
-
)
|
16
|
-
end
|
17
|
-
|
18
|
-
# Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
|
19
|
-
# JPG, JPEG, GIF, or WEBP images.
|
20
|
-
sig { returns(OpenAI::Internal::FileInput) }
|
21
|
-
attr_accessor :file
|
22
|
-
|
23
|
-
sig do
|
24
|
-
params(
|
25
|
-
file: OpenAI::Internal::FileInput,
|
26
|
-
request_options: OpenAI::RequestOptions::OrHash
|
27
|
-
).returns(T.attached_class)
|
28
|
-
end
|
29
|
-
def self.new(
|
30
|
-
# Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
|
31
|
-
# JPG, JPEG, GIF, or WEBP images.
|
32
|
-
file:,
|
33
|
-
request_options: {}
|
34
|
-
)
|
35
|
-
end
|
36
|
-
|
37
|
-
sig do
|
38
|
-
override.returns(
|
39
|
-
{
|
40
|
-
file: OpenAI::Internal::FileInput,
|
41
|
-
request_options: OpenAI::RequestOptions
|
42
|
-
}
|
43
|
-
)
|
44
|
-
end
|
45
|
-
def to_hash
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Beta
|
6
|
-
# Represents either a file or image attachment.
|
7
|
-
module ChatKitUploadFileResponse
|
8
|
-
extend OpenAI::Internal::Type::Union
|
9
|
-
|
10
|
-
Variants =
|
11
|
-
T.type_alias do
|
12
|
-
T.any(OpenAI::Beta::FilePart, OpenAI::Beta::ImagePart)
|
13
|
-
end
|
14
|
-
|
15
|
-
sig do
|
16
|
-
override.returns(
|
17
|
-
T::Array[OpenAI::Models::Beta::ChatKitUploadFileResponse::Variants]
|
18
|
-
)
|
19
|
-
end
|
20
|
-
def self.variants
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,74 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Beta
|
6
|
-
class FilePart < OpenAI::Internal::Type::BaseModel
|
7
|
-
OrHash =
|
8
|
-
T.type_alias do
|
9
|
-
T.any(OpenAI::Beta::FilePart, OpenAI::Internal::AnyHash)
|
10
|
-
end
|
11
|
-
|
12
|
-
# Unique identifier for the uploaded file.
|
13
|
-
sig { returns(String) }
|
14
|
-
attr_accessor :id
|
15
|
-
|
16
|
-
# MIME type reported for the uploaded file. Defaults to null when unknown.
|
17
|
-
sig { returns(T.nilable(String)) }
|
18
|
-
attr_accessor :mime_type
|
19
|
-
|
20
|
-
# Original filename supplied by the uploader. Defaults to null when unnamed.
|
21
|
-
sig { returns(T.nilable(String)) }
|
22
|
-
attr_accessor :name
|
23
|
-
|
24
|
-
# Type discriminator that is always `file`.
|
25
|
-
sig { returns(Symbol) }
|
26
|
-
attr_accessor :type
|
27
|
-
|
28
|
-
# Signed URL for downloading the uploaded file. Defaults to null when no download
|
29
|
-
# link is available.
|
30
|
-
sig { returns(T.nilable(String)) }
|
31
|
-
attr_accessor :upload_url
|
32
|
-
|
33
|
-
# Metadata for a non-image file uploaded through ChatKit.
|
34
|
-
sig do
|
35
|
-
params(
|
36
|
-
id: String,
|
37
|
-
mime_type: T.nilable(String),
|
38
|
-
name: T.nilable(String),
|
39
|
-
upload_url: T.nilable(String),
|
40
|
-
type: Symbol
|
41
|
-
).returns(T.attached_class)
|
42
|
-
end
|
43
|
-
def self.new(
|
44
|
-
# Unique identifier for the uploaded file.
|
45
|
-
id:,
|
46
|
-
# MIME type reported for the uploaded file. Defaults to null when unknown.
|
47
|
-
mime_type:,
|
48
|
-
# Original filename supplied by the uploader. Defaults to null when unnamed.
|
49
|
-
name:,
|
50
|
-
# Signed URL for downloading the uploaded file. Defaults to null when no download
|
51
|
-
# link is available.
|
52
|
-
upload_url:,
|
53
|
-
# Type discriminator that is always `file`.
|
54
|
-
type: :file
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
sig do
|
59
|
-
override.returns(
|
60
|
-
{
|
61
|
-
id: String,
|
62
|
-
mime_type: T.nilable(String),
|
63
|
-
name: T.nilable(String),
|
64
|
-
type: Symbol,
|
65
|
-
upload_url: T.nilable(String)
|
66
|
-
}
|
67
|
-
)
|
68
|
-
end
|
69
|
-
def to_hash
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
|
3
|
-
module OpenAI
|
4
|
-
module Models
|
5
|
-
module Beta
|
6
|
-
class ImagePart < OpenAI::Internal::Type::BaseModel
|
7
|
-
OrHash =
|
8
|
-
T.type_alias do
|
9
|
-
T.any(OpenAI::Beta::ImagePart, OpenAI::Internal::AnyHash)
|
10
|
-
end
|
11
|
-
|
12
|
-
# Unique identifier for the uploaded image.
|
13
|
-
sig { returns(String) }
|
14
|
-
attr_accessor :id
|
15
|
-
|
16
|
-
# MIME type of the uploaded image.
|
17
|
-
sig { returns(String) }
|
18
|
-
attr_accessor :mime_type
|
19
|
-
|
20
|
-
# Original filename for the uploaded image. Defaults to null when unnamed.
|
21
|
-
sig { returns(T.nilable(String)) }
|
22
|
-
attr_accessor :name
|
23
|
-
|
24
|
-
# Preview URL that can be rendered inline for the image.
|
25
|
-
sig { returns(String) }
|
26
|
-
attr_accessor :preview_url
|
27
|
-
|
28
|
-
# Type discriminator that is always `image`.
|
29
|
-
sig { returns(Symbol) }
|
30
|
-
attr_accessor :type
|
31
|
-
|
32
|
-
# Signed URL for downloading the uploaded image. Defaults to null when no download
|
33
|
-
# link is available.
|
34
|
-
sig { returns(T.nilable(String)) }
|
35
|
-
attr_accessor :upload_url
|
36
|
-
|
37
|
-
# Metadata for an image uploaded through ChatKit.
|
38
|
-
sig do
|
39
|
-
params(
|
40
|
-
id: String,
|
41
|
-
mime_type: String,
|
42
|
-
name: T.nilable(String),
|
43
|
-
preview_url: String,
|
44
|
-
upload_url: T.nilable(String),
|
45
|
-
type: Symbol
|
46
|
-
).returns(T.attached_class)
|
47
|
-
end
|
48
|
-
def self.new(
|
49
|
-
# Unique identifier for the uploaded image.
|
50
|
-
id:,
|
51
|
-
# MIME type of the uploaded image.
|
52
|
-
mime_type:,
|
53
|
-
# Original filename for the uploaded image. Defaults to null when unnamed.
|
54
|
-
name:,
|
55
|
-
# Preview URL that can be rendered inline for the image.
|
56
|
-
preview_url:,
|
57
|
-
# Signed URL for downloading the uploaded image. Defaults to null when no download
|
58
|
-
# link is available.
|
59
|
-
upload_url:,
|
60
|
-
# Type discriminator that is always `image`.
|
61
|
-
type: :image
|
62
|
-
)
|
63
|
-
end
|
64
|
-
|
65
|
-
sig do
|
66
|
-
override.returns(
|
67
|
-
{
|
68
|
-
id: String,
|
69
|
-
mime_type: String,
|
70
|
-
name: T.nilable(String),
|
71
|
-
preview_url: String,
|
72
|
-
type: Symbol,
|
73
|
-
upload_url: T.nilable(String)
|
74
|
-
}
|
75
|
-
)
|
76
|
-
end
|
77
|
-
def to_hash
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
module OpenAI
|
2
|
-
module Models
|
3
|
-
module Beta
|
4
|
-
type chatkit_upload_file_params =
|
5
|
-
{ file: OpenAI::Internal::file_input }
|
6
|
-
& OpenAI::Internal::Type::request_parameters
|
7
|
-
|
8
|
-
class ChatKitUploadFileParams < OpenAI::Internal::Type::BaseModel
|
9
|
-
extend OpenAI::Internal::Type::RequestParameters::Converter
|
10
|
-
include OpenAI::Internal::Type::RequestParameters
|
11
|
-
|
12
|
-
attr_accessor file: OpenAI::Internal::file_input
|
13
|
-
|
14
|
-
def initialize: (
|
15
|
-
file: OpenAI::Internal::file_input,
|
16
|
-
?request_options: OpenAI::request_opts
|
17
|
-
) -> void
|
18
|
-
|
19
|
-
def to_hash: -> {
|
20
|
-
file: OpenAI::Internal::file_input,
|
21
|
-
request_options: OpenAI::RequestOptions
|
22
|
-
}
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module OpenAI
|
2
|
-
module Models
|
3
|
-
module Beta
|
4
|
-
type chatkit_upload_file_response =
|
5
|
-
OpenAI::Beta::FilePart | OpenAI::Beta::ImagePart
|
6
|
-
|
7
|
-
module ChatKitUploadFileResponse
|
8
|
-
extend OpenAI::Internal::Type::Union
|
9
|
-
|
10
|
-
def self?.variants: -> ::Array[OpenAI::Models::Beta::chatkit_upload_file_response]
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
module OpenAI
|
2
|
-
module Models
|
3
|
-
module Beta
|
4
|
-
type file_part =
|
5
|
-
{
|
6
|
-
id: String,
|
7
|
-
mime_type: String?,
|
8
|
-
name: String?,
|
9
|
-
type: :file,
|
10
|
-
upload_url: String?
|
11
|
-
}
|
12
|
-
|
13
|
-
class FilePart < OpenAI::Internal::Type::BaseModel
|
14
|
-
attr_accessor id: String
|
15
|
-
|
16
|
-
attr_accessor mime_type: String?
|
17
|
-
|
18
|
-
attr_accessor name: String?
|
19
|
-
|
20
|
-
attr_accessor type: :file
|
21
|
-
|
22
|
-
attr_accessor upload_url: String?
|
23
|
-
|
24
|
-
def initialize: (
|
25
|
-
id: String,
|
26
|
-
mime_type: String?,
|
27
|
-
name: String?,
|
28
|
-
upload_url: String?,
|
29
|
-
?type: :file
|
30
|
-
) -> void
|
31
|
-
|
32
|
-
def to_hash: -> {
|
33
|
-
id: String,
|
34
|
-
mime_type: String?,
|
35
|
-
name: String?,
|
36
|
-
type: :file,
|
37
|
-
upload_url: String?
|
38
|
-
}
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module OpenAI
|
2
|
-
module Models
|
3
|
-
module Beta
|
4
|
-
type image_part =
|
5
|
-
{
|
6
|
-
id: String,
|
7
|
-
mime_type: String,
|
8
|
-
name: String?,
|
9
|
-
preview_url: String,
|
10
|
-
type: :image,
|
11
|
-
upload_url: String?
|
12
|
-
}
|
13
|
-
|
14
|
-
class ImagePart < OpenAI::Internal::Type::BaseModel
|
15
|
-
attr_accessor id: String
|
16
|
-
|
17
|
-
attr_accessor mime_type: String
|
18
|
-
|
19
|
-
attr_accessor name: String?
|
20
|
-
|
21
|
-
attr_accessor preview_url: String
|
22
|
-
|
23
|
-
attr_accessor type: :image
|
24
|
-
|
25
|
-
attr_accessor upload_url: String?
|
26
|
-
|
27
|
-
def initialize: (
|
28
|
-
id: String,
|
29
|
-
mime_type: String,
|
30
|
-
name: String?,
|
31
|
-
preview_url: String,
|
32
|
-
upload_url: String?,
|
33
|
-
?type: :image
|
34
|
-
) -> void
|
35
|
-
|
36
|
-
def to_hash: -> {
|
37
|
-
id: String,
|
38
|
-
mime_type: String,
|
39
|
-
name: String?,
|
40
|
-
preview_url: String,
|
41
|
-
type: :image,
|
42
|
-
upload_url: String?
|
43
|
-
}
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|