openai 0.9.0 → 0.10.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 +20 -0
- data/README.md +1 -1
- data/lib/openai/errors.rb +22 -0
- data/lib/openai/internal/type/array_of.rb +6 -1
- data/lib/openai/internal/type/base_model.rb +76 -24
- data/lib/openai/internal/type/boolean.rb +7 -1
- data/lib/openai/internal/type/converter.rb +42 -34
- data/lib/openai/internal/type/enum.rb +10 -2
- data/lib/openai/internal/type/file_input.rb +6 -1
- data/lib/openai/internal/type/hash_of.rb +6 -1
- data/lib/openai/internal/type/union.rb +12 -7
- data/lib/openai/internal/type/unknown.rb +7 -1
- data/lib/openai/models/audio/speech_create_params.rb +23 -2
- data/lib/openai/models/audio/transcription.rb +118 -1
- data/lib/openai/models/audio/transcription_text_done_event.rb +80 -1
- data/lib/openai/models/audio/transcription_verbose.rb +31 -1
- data/lib/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rb +60 -25
- data/lib/openai/models/responses/response_code_interpreter_call_code_delta_event.rb +17 -8
- data/lib/openai/models/responses/response_code_interpreter_call_code_done_event.rb +14 -10
- data/lib/openai/models/responses/response_code_interpreter_call_completed_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_call_in_progress_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_call_interpreting_event.rb +11 -10
- data/lib/openai/models/responses/response_code_interpreter_tool_call.rb +49 -78
- data/lib/openai/models/responses/response_create_params.rb +29 -29
- data/lib/openai/models/responses/response_output_text.rb +18 -2
- data/lib/openai/models/responses/response_stream_event.rb +2 -2
- data/lib/openai/resources/audio/speech.rb +3 -1
- data/lib/openai/resources/chat/completions.rb +8 -0
- data/lib/openai/resources/fine_tuning/checkpoints/permissions.rb +1 -2
- data/lib/openai/resources/responses.rb +12 -12
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/errors.rbi +16 -0
- data/rbi/openai/internal/type/boolean.rbi +2 -0
- data/rbi/openai/internal/type/converter.rbi +15 -15
- data/rbi/openai/internal/type/union.rbi +5 -0
- data/rbi/openai/internal/type/unknown.rbi +2 -0
- data/rbi/openai/models/audio/speech_create_params.rbi +59 -2
- data/rbi/openai/models/audio/transcription.rbi +213 -3
- data/rbi/openai/models/audio/transcription_text_done_event.rbi +146 -1
- data/rbi/openai/models/audio/transcription_verbose.rbi +47 -0
- data/rbi/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbi +95 -26
- data/rbi/openai/models/responses/response_code_interpreter_call_code_delta_event.rbi +17 -7
- data/rbi/openai/models/responses/response_code_interpreter_call_code_done_event.rbi +13 -5
- data/rbi/openai/models/responses/response_code_interpreter_call_completed_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_call_in_progress_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_call_interpreting_event.rbi +13 -21
- data/rbi/openai/models/responses/response_code_interpreter_tool_call.rbi +83 -125
- data/rbi/openai/models/responses/response_create_params.rbi +83 -60
- data/rbi/openai/models/responses/response_output_text.rbi +26 -4
- data/rbi/openai/resources/audio/speech.rbi +6 -1
- data/rbi/openai/resources/fine_tuning/checkpoints/permissions.rbi +1 -3
- data/rbi/openai/resources/responses.rbi +46 -46
- data/sig/openai/errors.rbs +9 -0
- data/sig/openai/internal/type/converter.rbs +7 -1
- data/sig/openai/models/audio/speech_create_params.rbs +21 -1
- data/sig/openai/models/audio/transcription.rbs +95 -3
- data/sig/openai/models/audio/transcription_text_done_event.rbs +72 -2
- data/sig/openai/models/audio/transcription_verbose.rbs +21 -0
- data/sig/openai/models/fine_tuning/checkpoints/permission_retrieve_response.rbs +53 -16
- data/sig/openai/models/responses/response_code_interpreter_call_code_delta_event.rbs +5 -0
- data/sig/openai/models/responses/response_code_interpreter_call_code_done_event.rbs +5 -0
- data/sig/openai/models/responses/response_code_interpreter_call_completed_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_call_in_progress_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_call_interpreting_event.rbs +4 -4
- data/sig/openai/models/responses/response_code_interpreter_tool_call.rbs +31 -52
- data/sig/openai/models/responses/response_create_params.rbs +18 -10
- data/sig/openai/models/responses/response_output_text.rbs +15 -1
- data/sig/openai/resources/audio/speech.rbs +1 -0
- data/sig/openai/resources/fine_tuning/checkpoints/permissions.rbs +1 -1
- data/sig/openai/resources/responses.rbs +4 -4
- metadata +2 -2
@@ -13,56 +13,125 @@ module OpenAI
|
|
13
13
|
)
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
sig do
|
17
|
+
returns(
|
18
|
+
T::Array[
|
19
|
+
OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data
|
20
|
+
]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
attr_accessor :data
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
attr_accessor :created_at
|
25
|
+
sig { returns(T::Boolean) }
|
26
|
+
attr_accessor :has_more
|
23
27
|
|
24
|
-
# The object type, which is always "checkpoint.permission".
|
25
28
|
sig { returns(Symbol) }
|
26
29
|
attr_accessor :object
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
sig { returns(T.nilable(String)) }
|
32
|
+
attr_accessor :first_id
|
33
|
+
|
34
|
+
sig { returns(T.nilable(String)) }
|
35
|
+
attr_accessor :last_id
|
31
36
|
|
32
|
-
# The `checkpoint.permission` object represents a permission for a fine-tuned
|
33
|
-
# model checkpoint.
|
34
37
|
sig do
|
35
38
|
params(
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
data:
|
40
|
+
T::Array[
|
41
|
+
OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data::OrHash
|
42
|
+
],
|
43
|
+
has_more: T::Boolean,
|
44
|
+
first_id: T.nilable(String),
|
45
|
+
last_id: T.nilable(String),
|
39
46
|
object: Symbol
|
40
47
|
).returns(T.attached_class)
|
41
48
|
end
|
42
49
|
def self.new(
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
project_id:,
|
49
|
-
# The object type, which is always "checkpoint.permission".
|
50
|
-
object: :"checkpoint.permission"
|
50
|
+
data:,
|
51
|
+
has_more:,
|
52
|
+
first_id: nil,
|
53
|
+
last_id: nil,
|
54
|
+
object: :list
|
51
55
|
)
|
52
56
|
end
|
53
57
|
|
54
58
|
sig do
|
55
59
|
override.returns(
|
56
60
|
{
|
57
|
-
|
58
|
-
|
61
|
+
data:
|
62
|
+
T::Array[
|
63
|
+
OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data
|
64
|
+
],
|
65
|
+
has_more: T::Boolean,
|
59
66
|
object: Symbol,
|
60
|
-
|
67
|
+
first_id: T.nilable(String),
|
68
|
+
last_id: T.nilable(String)
|
61
69
|
}
|
62
70
|
)
|
63
71
|
end
|
64
72
|
def to_hash
|
65
73
|
end
|
74
|
+
|
75
|
+
class Data < OpenAI::Internal::Type::BaseModel
|
76
|
+
OrHash =
|
77
|
+
T.type_alias do
|
78
|
+
T.any(
|
79
|
+
OpenAI::Models::FineTuning::Checkpoints::PermissionRetrieveResponse::Data,
|
80
|
+
OpenAI::Internal::AnyHash
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
# The permission identifier, which can be referenced in the API endpoints.
|
85
|
+
sig { returns(String) }
|
86
|
+
attr_accessor :id
|
87
|
+
|
88
|
+
# The Unix timestamp (in seconds) for when the permission was created.
|
89
|
+
sig { returns(Integer) }
|
90
|
+
attr_accessor :created_at
|
91
|
+
|
92
|
+
# The object type, which is always "checkpoint.permission".
|
93
|
+
sig { returns(Symbol) }
|
94
|
+
attr_accessor :object
|
95
|
+
|
96
|
+
# The project identifier that the permission is for.
|
97
|
+
sig { returns(String) }
|
98
|
+
attr_accessor :project_id
|
99
|
+
|
100
|
+
# The `checkpoint.permission` object represents a permission for a fine-tuned
|
101
|
+
# model checkpoint.
|
102
|
+
sig do
|
103
|
+
params(
|
104
|
+
id: String,
|
105
|
+
created_at: Integer,
|
106
|
+
project_id: String,
|
107
|
+
object: Symbol
|
108
|
+
).returns(T.attached_class)
|
109
|
+
end
|
110
|
+
def self.new(
|
111
|
+
# The permission identifier, which can be referenced in the API endpoints.
|
112
|
+
id:,
|
113
|
+
# The Unix timestamp (in seconds) for when the permission was created.
|
114
|
+
created_at:,
|
115
|
+
# The project identifier that the permission is for.
|
116
|
+
project_id:,
|
117
|
+
# The object type, which is always "checkpoint.permission".
|
118
|
+
object: :"checkpoint.permission"
|
119
|
+
)
|
120
|
+
end
|
121
|
+
|
122
|
+
sig do
|
123
|
+
override.returns(
|
124
|
+
{
|
125
|
+
id: String,
|
126
|
+
created_at: Integer,
|
127
|
+
object: Symbol,
|
128
|
+
project_id: String
|
129
|
+
}
|
130
|
+
)
|
131
|
+
end
|
132
|
+
def to_hash
|
133
|
+
end
|
134
|
+
end
|
66
135
|
end
|
67
136
|
end
|
68
137
|
end
|
@@ -12,15 +12,20 @@ module OpenAI
|
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
15
|
-
# The partial code snippet
|
15
|
+
# The partial code snippet being streamed by the code interpreter.
|
16
16
|
sig { returns(String) }
|
17
17
|
attr_accessor :delta
|
18
18
|
|
19
|
-
# The
|
19
|
+
# The unique identifier of the code interpreter tool call item.
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :item_id
|
22
|
+
|
23
|
+
# The index of the output item in the response for which the code is being
|
24
|
+
# streamed.
|
20
25
|
sig { returns(Integer) }
|
21
26
|
attr_accessor :output_index
|
22
27
|
|
23
|
-
# The sequence number of this event.
|
28
|
+
# The sequence number of this event, used to order streaming events.
|
24
29
|
sig { returns(Integer) }
|
25
30
|
attr_accessor :sequence_number
|
26
31
|
|
@@ -28,21 +33,25 @@ module OpenAI
|
|
28
33
|
sig { returns(Symbol) }
|
29
34
|
attr_accessor :type
|
30
35
|
|
31
|
-
# Emitted when a partial code snippet is
|
36
|
+
# Emitted when a partial code snippet is streamed by the code interpreter.
|
32
37
|
sig do
|
33
38
|
params(
|
34
39
|
delta: String,
|
40
|
+
item_id: String,
|
35
41
|
output_index: Integer,
|
36
42
|
sequence_number: Integer,
|
37
43
|
type: Symbol
|
38
44
|
).returns(T.attached_class)
|
39
45
|
end
|
40
46
|
def self.new(
|
41
|
-
# The partial code snippet
|
47
|
+
# The partial code snippet being streamed by the code interpreter.
|
42
48
|
delta:,
|
43
|
-
# The
|
49
|
+
# The unique identifier of the code interpreter tool call item.
|
50
|
+
item_id:,
|
51
|
+
# The index of the output item in the response for which the code is being
|
52
|
+
# streamed.
|
44
53
|
output_index:,
|
45
|
-
# The sequence number of this event.
|
54
|
+
# The sequence number of this event, used to order streaming events.
|
46
55
|
sequence_number:,
|
47
56
|
# The type of the event. Always `response.code_interpreter_call_code.delta`.
|
48
57
|
type: :"response.code_interpreter_call_code.delta"
|
@@ -53,6 +62,7 @@ module OpenAI
|
|
53
62
|
override.returns(
|
54
63
|
{
|
55
64
|
delta: String,
|
65
|
+
item_id: String,
|
56
66
|
output_index: Integer,
|
57
67
|
sequence_number: Integer,
|
58
68
|
type: Symbol
|
@@ -16,11 +16,15 @@ module OpenAI
|
|
16
16
|
sig { returns(String) }
|
17
17
|
attr_accessor :code
|
18
18
|
|
19
|
-
# The
|
19
|
+
# The unique identifier of the code interpreter tool call item.
|
20
|
+
sig { returns(String) }
|
21
|
+
attr_accessor :item_id
|
22
|
+
|
23
|
+
# The index of the output item in the response for which the code is finalized.
|
20
24
|
sig { returns(Integer) }
|
21
25
|
attr_accessor :output_index
|
22
26
|
|
23
|
-
# The sequence number of this event.
|
27
|
+
# The sequence number of this event, used to order streaming events.
|
24
28
|
sig { returns(Integer) }
|
25
29
|
attr_accessor :sequence_number
|
26
30
|
|
@@ -28,10 +32,11 @@ module OpenAI
|
|
28
32
|
sig { returns(Symbol) }
|
29
33
|
attr_accessor :type
|
30
34
|
|
31
|
-
# Emitted when code snippet
|
35
|
+
# Emitted when the code snippet is finalized by the code interpreter.
|
32
36
|
sig do
|
33
37
|
params(
|
34
38
|
code: String,
|
39
|
+
item_id: String,
|
35
40
|
output_index: Integer,
|
36
41
|
sequence_number: Integer,
|
37
42
|
type: Symbol
|
@@ -40,9 +45,11 @@ module OpenAI
|
|
40
45
|
def self.new(
|
41
46
|
# The final code snippet output by the code interpreter.
|
42
47
|
code:,
|
43
|
-
# The
|
48
|
+
# The unique identifier of the code interpreter tool call item.
|
49
|
+
item_id:,
|
50
|
+
# The index of the output item in the response for which the code is finalized.
|
44
51
|
output_index:,
|
45
|
-
# The sequence number of this event.
|
52
|
+
# The sequence number of this event, used to order streaming events.
|
46
53
|
sequence_number:,
|
47
54
|
# The type of the event. Always `response.code_interpreter_call_code.done`.
|
48
55
|
type: :"response.code_interpreter_call_code.done"
|
@@ -53,6 +60,7 @@ module OpenAI
|
|
53
60
|
override.returns(
|
54
61
|
{
|
55
62
|
code: String,
|
63
|
+
item_id: String,
|
56
64
|
output_index: Integer,
|
57
65
|
sequence_number: Integer,
|
58
66
|
type: Symbol
|
@@ -12,23 +12,16 @@ module OpenAI
|
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
15
|
-
#
|
16
|
-
sig { returns(
|
17
|
-
|
15
|
+
# The unique identifier of the code interpreter tool call item.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :item_id
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
code_interpreter_call:
|
22
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash
|
23
|
-
).void
|
24
|
-
end
|
25
|
-
attr_writer :code_interpreter_call
|
26
|
-
|
27
|
-
# The index of the output item that the code interpreter call is in progress.
|
19
|
+
# The index of the output item in the response for which the code interpreter call
|
20
|
+
# is completed.
|
28
21
|
sig { returns(Integer) }
|
29
22
|
attr_accessor :output_index
|
30
23
|
|
31
|
-
# The sequence number of this event.
|
24
|
+
# The sequence number of this event, used to order streaming events.
|
32
25
|
sig { returns(Integer) }
|
33
26
|
attr_accessor :sequence_number
|
34
27
|
|
@@ -39,19 +32,19 @@ module OpenAI
|
|
39
32
|
# Emitted when the code interpreter call is completed.
|
40
33
|
sig do
|
41
34
|
params(
|
42
|
-
|
43
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
|
35
|
+
item_id: String,
|
44
36
|
output_index: Integer,
|
45
37
|
sequence_number: Integer,
|
46
38
|
type: Symbol
|
47
39
|
).returns(T.attached_class)
|
48
40
|
end
|
49
41
|
def self.new(
|
50
|
-
#
|
51
|
-
|
52
|
-
# The index of the output item
|
42
|
+
# The unique identifier of the code interpreter tool call item.
|
43
|
+
item_id:,
|
44
|
+
# The index of the output item in the response for which the code interpreter call
|
45
|
+
# is completed.
|
53
46
|
output_index:,
|
54
|
-
# The sequence number of this event.
|
47
|
+
# The sequence number of this event, used to order streaming events.
|
55
48
|
sequence_number:,
|
56
49
|
# The type of the event. Always `response.code_interpreter_call.completed`.
|
57
50
|
type: :"response.code_interpreter_call.completed"
|
@@ -61,8 +54,7 @@ module OpenAI
|
|
61
54
|
sig do
|
62
55
|
override.returns(
|
63
56
|
{
|
64
|
-
|
65
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall,
|
57
|
+
item_id: String,
|
66
58
|
output_index: Integer,
|
67
59
|
sequence_number: Integer,
|
68
60
|
type: Symbol
|
@@ -12,23 +12,16 @@ module OpenAI
|
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
15
|
-
#
|
16
|
-
sig { returns(
|
17
|
-
|
15
|
+
# The unique identifier of the code interpreter tool call item.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :item_id
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
code_interpreter_call:
|
22
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash
|
23
|
-
).void
|
24
|
-
end
|
25
|
-
attr_writer :code_interpreter_call
|
26
|
-
|
27
|
-
# The index of the output item that the code interpreter call is in progress.
|
19
|
+
# The index of the output item in the response for which the code interpreter call
|
20
|
+
# is in progress.
|
28
21
|
sig { returns(Integer) }
|
29
22
|
attr_accessor :output_index
|
30
23
|
|
31
|
-
# The sequence number of this event.
|
24
|
+
# The sequence number of this event, used to order streaming events.
|
32
25
|
sig { returns(Integer) }
|
33
26
|
attr_accessor :sequence_number
|
34
27
|
|
@@ -39,19 +32,19 @@ module OpenAI
|
|
39
32
|
# Emitted when a code interpreter call is in progress.
|
40
33
|
sig do
|
41
34
|
params(
|
42
|
-
|
43
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
|
35
|
+
item_id: String,
|
44
36
|
output_index: Integer,
|
45
37
|
sequence_number: Integer,
|
46
38
|
type: Symbol
|
47
39
|
).returns(T.attached_class)
|
48
40
|
end
|
49
41
|
def self.new(
|
50
|
-
#
|
51
|
-
|
52
|
-
# The index of the output item
|
42
|
+
# The unique identifier of the code interpreter tool call item.
|
43
|
+
item_id:,
|
44
|
+
# The index of the output item in the response for which the code interpreter call
|
45
|
+
# is in progress.
|
53
46
|
output_index:,
|
54
|
-
# The sequence number of this event.
|
47
|
+
# The sequence number of this event, used to order streaming events.
|
55
48
|
sequence_number:,
|
56
49
|
# The type of the event. Always `response.code_interpreter_call.in_progress`.
|
57
50
|
type: :"response.code_interpreter_call.in_progress"
|
@@ -61,8 +54,7 @@ module OpenAI
|
|
61
54
|
sig do
|
62
55
|
override.returns(
|
63
56
|
{
|
64
|
-
|
65
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall,
|
57
|
+
item_id: String,
|
66
58
|
output_index: Integer,
|
67
59
|
sequence_number: Integer,
|
68
60
|
type: Symbol
|
@@ -12,23 +12,16 @@ module OpenAI
|
|
12
12
|
)
|
13
13
|
end
|
14
14
|
|
15
|
-
#
|
16
|
-
sig { returns(
|
17
|
-
|
15
|
+
# The unique identifier of the code interpreter tool call item.
|
16
|
+
sig { returns(String) }
|
17
|
+
attr_accessor :item_id
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
code_interpreter_call:
|
22
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash
|
23
|
-
).void
|
24
|
-
end
|
25
|
-
attr_writer :code_interpreter_call
|
26
|
-
|
27
|
-
# The index of the output item that the code interpreter call is in progress.
|
19
|
+
# The index of the output item in the response for which the code interpreter is
|
20
|
+
# interpreting code.
|
28
21
|
sig { returns(Integer) }
|
29
22
|
attr_accessor :output_index
|
30
23
|
|
31
|
-
# The sequence number of this event.
|
24
|
+
# The sequence number of this event, used to order streaming events.
|
32
25
|
sig { returns(Integer) }
|
33
26
|
attr_accessor :sequence_number
|
34
27
|
|
@@ -39,19 +32,19 @@ module OpenAI
|
|
39
32
|
# Emitted when the code interpreter is actively interpreting the code snippet.
|
40
33
|
sig do
|
41
34
|
params(
|
42
|
-
|
43
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall::OrHash,
|
35
|
+
item_id: String,
|
44
36
|
output_index: Integer,
|
45
37
|
sequence_number: Integer,
|
46
38
|
type: Symbol
|
47
39
|
).returns(T.attached_class)
|
48
40
|
end
|
49
41
|
def self.new(
|
50
|
-
#
|
51
|
-
|
52
|
-
# The index of the output item
|
42
|
+
# The unique identifier of the code interpreter tool call item.
|
43
|
+
item_id:,
|
44
|
+
# The index of the output item in the response for which the code interpreter is
|
45
|
+
# interpreting code.
|
53
46
|
output_index:,
|
54
|
-
# The sequence number of this event.
|
47
|
+
# The sequence number of this event, used to order streaming events.
|
55
48
|
sequence_number:,
|
56
49
|
# The type of the event. Always `response.code_interpreter_call.interpreting`.
|
57
50
|
type: :"response.code_interpreter_call.interpreting"
|
@@ -61,8 +54,7 @@ module OpenAI
|
|
61
54
|
sig do
|
62
55
|
override.returns(
|
63
56
|
{
|
64
|
-
|
65
|
-
OpenAI::Responses::ResponseCodeInterpreterToolCall,
|
57
|
+
item_id: String,
|
66
58
|
output_index: Integer,
|
67
59
|
sequence_number: Integer,
|
68
60
|
type: Symbol
|