openai 0.57.0 → 0.59.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 +45 -0
- data/README.md +98 -1
- data/lib/openai/auth/subject_token_provider.rb +15 -0
- data/lib/openai/auth/subject_token_providers/azure_managed_identity_token_provider.rb +88 -0
- data/lib/openai/auth/subject_token_providers/gcp_id_token_provider.rb +66 -0
- data/lib/openai/auth/subject_token_providers/k8s_service_account_token_provider.rb +37 -0
- data/lib/openai/auth/token_type.rb +10 -0
- data/lib/openai/auth/workload_identity.rb +23 -0
- data/lib/openai/auth/workload_identity_auth.rb +176 -0
- data/lib/openai/client.rb +59 -4
- data/lib/openai/errors.rb +39 -0
- data/lib/openai/internal/util.rb +22 -7
- data/lib/openai/models/conversations/message.rb +28 -1
- data/lib/openai/models/oauth_error_code.rb +29 -0
- data/lib/openai/models/realtime/realtime_session_create_request.rb +4 -3
- data/lib/openai/models/realtime/realtime_session_create_response.rb +7 -5
- data/lib/openai/models/realtime/realtime_tracing_config.rb +3 -2
- data/lib/openai/models/responses/response_input_file.rb +26 -1
- data/lib/openai/models/responses/response_input_file_content.rb +29 -1
- data/lib/openai/models/vector_stores/file_batch_create_params.rb +9 -5
- data/lib/openai/models/vector_stores/file_create_params.rb +3 -1
- data/lib/openai/models.rb +2 -0
- data/lib/openai/resources/realtime/calls.rb +1 -1
- data/lib/openai/version.rb +1 -1
- data/lib/openai.rb +8 -0
- data/rbi/openai/auth.rbi +55 -0
- data/rbi/openai/internal/util.rbi +8 -0
- data/rbi/openai/models/conversations/message.rbi +53 -1
- data/rbi/openai/models/oauth_error_code.rbi +24 -0
- data/rbi/openai/models/realtime/realtime_session_create_request.rbi +6 -4
- data/rbi/openai/models/realtime/realtime_session_create_response.rbi +9 -6
- data/rbi/openai/models/realtime/realtime_tracing_config.rbi +3 -2
- data/rbi/openai/models/responses/response_input_file.rbi +57 -0
- data/rbi/openai/models/responses/response_input_file_content.rbi +62 -0
- data/rbi/openai/models/vector_stores/file_batch_create_params.rbi +18 -10
- data/rbi/openai/models/vector_stores/file_create_params.rbi +6 -2
- data/rbi/openai/models.rbi +2 -0
- data/rbi/openai/resources/realtime/calls.rbi +3 -2
- data/rbi/openai/resources/vector_stores/file_batches.rbi +6 -4
- data/rbi/openai/resources/vector_stores/files.rbi +3 -1
- data/sig/openai/internal/util.rbs +4 -0
- data/sig/openai/models/conversations/message.rbs +18 -2
- data/sig/openai/models/oauth_error_code.rbs +14 -0
- data/sig/openai/models/responses/response_input_file.rbs +20 -0
- data/sig/openai/models/responses/response_input_file_content.rbs +20 -0
- data/sig/openai/models.rbs +2 -0
- metadata +13 -2
|
@@ -33,6 +33,17 @@ module OpenAI
|
|
|
33
33
|
sig { returns(Symbol) }
|
|
34
34
|
attr_accessor :type
|
|
35
35
|
|
|
36
|
+
# Labels an `assistant` message as intermediate commentary (`commentary`) or the
|
|
37
|
+
# final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
|
|
38
|
+
# sending follow-up requests, preserve and resend phase on all assistant messages
|
|
39
|
+
# — dropping it can degrade performance. Not used for user messages.
|
|
40
|
+
sig do
|
|
41
|
+
returns(
|
|
42
|
+
T.nilable(OpenAI::Conversations::Message::Phase::TaggedSymbol)
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
attr_accessor :phase
|
|
46
|
+
|
|
36
47
|
# A message to or from the model.
|
|
37
48
|
sig do
|
|
38
49
|
params(
|
|
@@ -53,6 +64,7 @@ module OpenAI
|
|
|
53
64
|
],
|
|
54
65
|
role: OpenAI::Conversations::Message::Role::OrSymbol,
|
|
55
66
|
status: OpenAI::Conversations::Message::Status::OrSymbol,
|
|
67
|
+
phase: T.nilable(OpenAI::Conversations::Message::Phase::OrSymbol),
|
|
56
68
|
type: Symbol
|
|
57
69
|
).returns(T.attached_class)
|
|
58
70
|
end
|
|
@@ -67,6 +79,11 @@ module OpenAI
|
|
|
67
79
|
# The status of item. One of `in_progress`, `completed`, or `incomplete`.
|
|
68
80
|
# Populated when items are returned via API.
|
|
69
81
|
status:,
|
|
82
|
+
# Labels an `assistant` message as intermediate commentary (`commentary`) or the
|
|
83
|
+
# final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
|
|
84
|
+
# sending follow-up requests, preserve and resend phase on all assistant messages
|
|
85
|
+
# — dropping it can degrade performance. Not used for user messages.
|
|
86
|
+
phase: nil,
|
|
70
87
|
# The type of the message. Always set to `message`.
|
|
71
88
|
type: :message
|
|
72
89
|
)
|
|
@@ -80,7 +97,9 @@ module OpenAI
|
|
|
80
97
|
T::Array[OpenAI::Conversations::Message::Content::Variants],
|
|
81
98
|
role: OpenAI::Conversations::Message::Role::TaggedSymbol,
|
|
82
99
|
status: OpenAI::Conversations::Message::Status::TaggedSymbol,
|
|
83
|
-
type: Symbol
|
|
100
|
+
type: Symbol,
|
|
101
|
+
phase:
|
|
102
|
+
T.nilable(OpenAI::Conversations::Message::Phase::TaggedSymbol)
|
|
84
103
|
}
|
|
85
104
|
)
|
|
86
105
|
end
|
|
@@ -226,6 +245,39 @@ module OpenAI
|
|
|
226
245
|
def self.values
|
|
227
246
|
end
|
|
228
247
|
end
|
|
248
|
+
|
|
249
|
+
# Labels an `assistant` message as intermediate commentary (`commentary`) or the
|
|
250
|
+
# final answer (`final_answer`). For models like `gpt-5.3-codex` and beyond, when
|
|
251
|
+
# sending follow-up requests, preserve and resend phase on all assistant messages
|
|
252
|
+
# — dropping it can degrade performance. Not used for user messages.
|
|
253
|
+
module Phase
|
|
254
|
+
extend OpenAI::Internal::Type::Enum
|
|
255
|
+
|
|
256
|
+
TaggedSymbol =
|
|
257
|
+
T.type_alias do
|
|
258
|
+
T.all(Symbol, OpenAI::Conversations::Message::Phase)
|
|
259
|
+
end
|
|
260
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
261
|
+
|
|
262
|
+
COMMENTARY =
|
|
263
|
+
T.let(
|
|
264
|
+
:commentary,
|
|
265
|
+
OpenAI::Conversations::Message::Phase::TaggedSymbol
|
|
266
|
+
)
|
|
267
|
+
FINAL_ANSWER =
|
|
268
|
+
T.let(
|
|
269
|
+
:final_answer,
|
|
270
|
+
OpenAI::Conversations::Message::Phase::TaggedSymbol
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
sig do
|
|
274
|
+
override.returns(
|
|
275
|
+
T::Array[OpenAI::Conversations::Message::Phase::TaggedSymbol]
|
|
276
|
+
)
|
|
277
|
+
end
|
|
278
|
+
def self.values
|
|
279
|
+
end
|
|
280
|
+
end
|
|
229
281
|
end
|
|
230
282
|
end
|
|
231
283
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module OpenAI
|
|
4
|
+
module Models
|
|
5
|
+
module OAuthErrorCode
|
|
6
|
+
extend OpenAI::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
Variants =
|
|
9
|
+
T.type_alias { T.any(OpenAI::OAuthErrorCode::TaggedSymbol, String) }
|
|
10
|
+
|
|
11
|
+
sig { override.returns(T::Array[OpenAI::OAuthErrorCode::Variants]) }
|
|
12
|
+
def self.variants
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
TaggedSymbol = T.type_alias { T.all(Symbol, OpenAI::OAuthErrorCode) }
|
|
16
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
17
|
+
|
|
18
|
+
INVALID_GRANT =
|
|
19
|
+
T.let(:invalid_grant, OpenAI::OAuthErrorCode::TaggedSymbol)
|
|
20
|
+
INVALID_SUBJECT_TOKEN =
|
|
21
|
+
T.let(:invalid_subject_token, OpenAI::OAuthErrorCode::TaggedSymbol)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -193,8 +193,9 @@ module OpenAI
|
|
|
193
193
|
attr_writer :tools
|
|
194
194
|
|
|
195
195
|
# Realtime API can write session traces to the
|
|
196
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
197
|
-
# tracing is enabled for a session, the configuration cannot
|
|
196
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
197
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
198
|
+
# be modified.
|
|
198
199
|
#
|
|
199
200
|
# `auto` will create a trace for the session with default values for the workflow
|
|
200
201
|
# name, group id, and metadata.
|
|
@@ -339,8 +340,9 @@ module OpenAI
|
|
|
339
340
|
# Tools available to the model.
|
|
340
341
|
tools: nil,
|
|
341
342
|
# Realtime API can write session traces to the
|
|
342
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
343
|
-
# tracing is enabled for a session, the configuration cannot
|
|
343
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
344
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
345
|
+
# be modified.
|
|
344
346
|
#
|
|
345
347
|
# `auto` will create a trace for the session with default values for the workflow
|
|
346
348
|
# name, group id, and metadata.
|
|
@@ -209,8 +209,9 @@ module OpenAI
|
|
|
209
209
|
attr_writer :tools
|
|
210
210
|
|
|
211
211
|
# Realtime API can write session traces to the
|
|
212
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
213
|
-
# tracing is enabled for a session, the configuration cannot
|
|
212
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
213
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
214
|
+
# be modified.
|
|
214
215
|
#
|
|
215
216
|
# `auto` will create a trace for the session with default values for the workflow
|
|
216
217
|
# name, group id, and metadata.
|
|
@@ -351,8 +352,9 @@ module OpenAI
|
|
|
351
352
|
# Tools available to the model.
|
|
352
353
|
tools: nil,
|
|
353
354
|
# Realtime API can write session traces to the
|
|
354
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
355
|
-
# tracing is enabled for a session, the configuration cannot
|
|
355
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
356
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
357
|
+
# be modified.
|
|
356
358
|
#
|
|
357
359
|
# `auto` will create a trace for the session with default values for the workflow
|
|
358
360
|
# name, group id, and metadata.
|
|
@@ -2091,8 +2093,9 @@ module OpenAI
|
|
|
2091
2093
|
end
|
|
2092
2094
|
|
|
2093
2095
|
# Realtime API can write session traces to the
|
|
2094
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
2095
|
-
# tracing is enabled for a session, the configuration cannot
|
|
2096
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
2097
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
2098
|
+
# be modified.
|
|
2096
2099
|
#
|
|
2097
2100
|
# `auto` will create a trace for the session with default values for the workflow
|
|
2098
2101
|
# name, group id, and metadata.
|
|
@@ -4,8 +4,9 @@ module OpenAI
|
|
|
4
4
|
module Models
|
|
5
5
|
module Realtime
|
|
6
6
|
# Realtime API can write session traces to the
|
|
7
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
8
|
-
# tracing is enabled for a session, the configuration cannot
|
|
7
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
8
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
9
|
+
# be modified.
|
|
9
10
|
#
|
|
10
11
|
# `auto` will create a trace for the session with default values for the workflow
|
|
11
12
|
# name, group id, and metadata.
|
|
@@ -16,6 +16,23 @@ module OpenAI
|
|
|
16
16
|
sig { returns(Symbol) }
|
|
17
17
|
attr_accessor :type
|
|
18
18
|
|
|
19
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
20
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
21
|
+
# `low`.
|
|
22
|
+
sig do
|
|
23
|
+
returns(
|
|
24
|
+
T.nilable(OpenAI::Responses::ResponseInputFile::Detail::OrSymbol)
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
attr_reader :detail
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
params(
|
|
31
|
+
detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol
|
|
32
|
+
).void
|
|
33
|
+
end
|
|
34
|
+
attr_writer :detail
|
|
35
|
+
|
|
19
36
|
# The content of the file to be sent to the model.
|
|
20
37
|
sig { returns(T.nilable(String)) }
|
|
21
38
|
attr_reader :file_data
|
|
@@ -44,6 +61,7 @@ module OpenAI
|
|
|
44
61
|
# A file input to the model.
|
|
45
62
|
sig do
|
|
46
63
|
params(
|
|
64
|
+
detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
|
|
47
65
|
file_data: String,
|
|
48
66
|
file_id: T.nilable(String),
|
|
49
67
|
file_url: String,
|
|
@@ -52,6 +70,10 @@ module OpenAI
|
|
|
52
70
|
).returns(T.attached_class)
|
|
53
71
|
end
|
|
54
72
|
def self.new(
|
|
73
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
74
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
75
|
+
# `low`.
|
|
76
|
+
detail: nil,
|
|
55
77
|
# The content of the file to be sent to the model.
|
|
56
78
|
file_data: nil,
|
|
57
79
|
# The ID of the file to be sent to the model.
|
|
@@ -69,6 +91,7 @@ module OpenAI
|
|
|
69
91
|
override.returns(
|
|
70
92
|
{
|
|
71
93
|
type: Symbol,
|
|
94
|
+
detail: OpenAI::Responses::ResponseInputFile::Detail::OrSymbol,
|
|
72
95
|
file_data: String,
|
|
73
96
|
file_id: T.nilable(String),
|
|
74
97
|
file_url: String,
|
|
@@ -78,6 +101,40 @@ module OpenAI
|
|
|
78
101
|
end
|
|
79
102
|
def to_hash
|
|
80
103
|
end
|
|
104
|
+
|
|
105
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
106
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
107
|
+
# `low`.
|
|
108
|
+
module Detail
|
|
109
|
+
extend OpenAI::Internal::Type::Enum
|
|
110
|
+
|
|
111
|
+
TaggedSymbol =
|
|
112
|
+
T.type_alias do
|
|
113
|
+
T.all(Symbol, OpenAI::Responses::ResponseInputFile::Detail)
|
|
114
|
+
end
|
|
115
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
116
|
+
|
|
117
|
+
LOW =
|
|
118
|
+
T.let(
|
|
119
|
+
:low,
|
|
120
|
+
OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
|
|
121
|
+
)
|
|
122
|
+
HIGH =
|
|
123
|
+
T.let(
|
|
124
|
+
:high,
|
|
125
|
+
OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
sig do
|
|
129
|
+
override.returns(
|
|
130
|
+
T::Array[
|
|
131
|
+
OpenAI::Responses::ResponseInputFile::Detail::TaggedSymbol
|
|
132
|
+
]
|
|
133
|
+
)
|
|
134
|
+
end
|
|
135
|
+
def self.values
|
|
136
|
+
end
|
|
137
|
+
end
|
|
81
138
|
end
|
|
82
139
|
end
|
|
83
140
|
end
|
|
@@ -16,6 +16,26 @@ module OpenAI
|
|
|
16
16
|
sig { returns(Symbol) }
|
|
17
17
|
attr_accessor :type
|
|
18
18
|
|
|
19
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
20
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
21
|
+
# `low`.
|
|
22
|
+
sig do
|
|
23
|
+
returns(
|
|
24
|
+
T.nilable(
|
|
25
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
|
|
26
|
+
)
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
attr_reader :detail
|
|
30
|
+
|
|
31
|
+
sig do
|
|
32
|
+
params(
|
|
33
|
+
detail:
|
|
34
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol
|
|
35
|
+
).void
|
|
36
|
+
end
|
|
37
|
+
attr_writer :detail
|
|
38
|
+
|
|
19
39
|
# The base64-encoded data of the file to be sent to the model.
|
|
20
40
|
sig { returns(T.nilable(String)) }
|
|
21
41
|
attr_accessor :file_data
|
|
@@ -35,6 +55,8 @@ module OpenAI
|
|
|
35
55
|
# A file input to the model.
|
|
36
56
|
sig do
|
|
37
57
|
params(
|
|
58
|
+
detail:
|
|
59
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
|
|
38
60
|
file_data: T.nilable(String),
|
|
39
61
|
file_id: T.nilable(String),
|
|
40
62
|
file_url: T.nilable(String),
|
|
@@ -43,6 +65,10 @@ module OpenAI
|
|
|
43
65
|
).returns(T.attached_class)
|
|
44
66
|
end
|
|
45
67
|
def self.new(
|
|
68
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
69
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
70
|
+
# `low`.
|
|
71
|
+
detail: nil,
|
|
46
72
|
# The base64-encoded data of the file to be sent to the model.
|
|
47
73
|
file_data: nil,
|
|
48
74
|
# The ID of the file to be sent to the model.
|
|
@@ -60,6 +86,8 @@ module OpenAI
|
|
|
60
86
|
override.returns(
|
|
61
87
|
{
|
|
62
88
|
type: Symbol,
|
|
89
|
+
detail:
|
|
90
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::OrSymbol,
|
|
63
91
|
file_data: T.nilable(String),
|
|
64
92
|
file_id: T.nilable(String),
|
|
65
93
|
file_url: T.nilable(String),
|
|
@@ -69,6 +97,40 @@ module OpenAI
|
|
|
69
97
|
end
|
|
70
98
|
def to_hash
|
|
71
99
|
end
|
|
100
|
+
|
|
101
|
+
# The detail level of the file to be sent to the model. Use `low` for the default
|
|
102
|
+
# rendering behavior, or `high` to render the file at higher quality. Defaults to
|
|
103
|
+
# `low`.
|
|
104
|
+
module Detail
|
|
105
|
+
extend OpenAI::Internal::Type::Enum
|
|
106
|
+
|
|
107
|
+
TaggedSymbol =
|
|
108
|
+
T.type_alias do
|
|
109
|
+
T.all(Symbol, OpenAI::Responses::ResponseInputFileContent::Detail)
|
|
110
|
+
end
|
|
111
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
112
|
+
|
|
113
|
+
LOW =
|
|
114
|
+
T.let(
|
|
115
|
+
:low,
|
|
116
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
|
|
117
|
+
)
|
|
118
|
+
HIGH =
|
|
119
|
+
T.let(
|
|
120
|
+
:high,
|
|
121
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
sig do
|
|
125
|
+
override.returns(
|
|
126
|
+
T::Array[
|
|
127
|
+
OpenAI::Responses::ResponseInputFileContent::Detail::TaggedSymbol
|
|
128
|
+
]
|
|
129
|
+
)
|
|
130
|
+
end
|
|
131
|
+
def self.values
|
|
132
|
+
end
|
|
133
|
+
end
|
|
72
134
|
end
|
|
73
135
|
end
|
|
74
136
|
end
|
|
@@ -63,8 +63,9 @@ module OpenAI
|
|
|
63
63
|
# A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
|
|
64
64
|
# the vector store should use. Useful for tools like `file_search` that can access
|
|
65
65
|
# files. If `attributes` or `chunking_strategy` are provided, they will be applied
|
|
66
|
-
# to all files in the batch. The maximum batch size is 2000 files.
|
|
67
|
-
#
|
|
66
|
+
# to all files in the batch. The maximum batch size is 2000 files. This endpoint
|
|
67
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
68
|
+
# request pressure. Mutually exclusive with `files`.
|
|
68
69
|
sig { returns(T.nilable(T::Array[String])) }
|
|
69
70
|
attr_reader :file_ids
|
|
70
71
|
|
|
@@ -74,8 +75,9 @@ module OpenAI
|
|
|
74
75
|
# A list of objects that each include a `file_id` plus optional `attributes` or
|
|
75
76
|
# `chunking_strategy`. Use this when you need to override metadata for specific
|
|
76
77
|
# files. The global `attributes` or `chunking_strategy` will be ignored and must
|
|
77
|
-
# be specified for each file. The maximum batch size is 2000 files.
|
|
78
|
-
#
|
|
78
|
+
# be specified for each file. The maximum batch size is 2000 files. This endpoint
|
|
79
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
80
|
+
# request pressure. Mutually exclusive with `file_ids`.
|
|
79
81
|
sig do
|
|
80
82
|
returns(
|
|
81
83
|
T.nilable(
|
|
@@ -132,14 +134,16 @@ module OpenAI
|
|
|
132
134
|
# A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
|
|
133
135
|
# the vector store should use. Useful for tools like `file_search` that can access
|
|
134
136
|
# files. If `attributes` or `chunking_strategy` are provided, they will be applied
|
|
135
|
-
# to all files in the batch. The maximum batch size is 2000 files.
|
|
136
|
-
#
|
|
137
|
+
# to all files in the batch. The maximum batch size is 2000 files. This endpoint
|
|
138
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
139
|
+
# request pressure. Mutually exclusive with `files`.
|
|
137
140
|
file_ids: nil,
|
|
138
141
|
# A list of objects that each include a `file_id` plus optional `attributes` or
|
|
139
142
|
# `chunking_strategy`. Use this when you need to override metadata for specific
|
|
140
143
|
# files. The global `attributes` or `chunking_strategy` will be ignored and must
|
|
141
|
-
# be specified for each file. The maximum batch size is 2000 files.
|
|
142
|
-
#
|
|
144
|
+
# be specified for each file. The maximum batch size is 2000 files. This endpoint
|
|
145
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
146
|
+
# request pressure. Mutually exclusive with `file_ids`.
|
|
143
147
|
files: nil,
|
|
144
148
|
request_options: {}
|
|
145
149
|
)
|
|
@@ -198,7 +202,9 @@ module OpenAI
|
|
|
198
202
|
|
|
199
203
|
# A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
200
204
|
# vector store should use. Useful for tools like `file_search` that can access
|
|
201
|
-
# files.
|
|
205
|
+
# files. For multi-file ingestion, we recommend
|
|
206
|
+
# [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
207
|
+
# to minimize per-vector-store write requests.
|
|
202
208
|
sig { returns(String) }
|
|
203
209
|
attr_accessor :file_id
|
|
204
210
|
|
|
@@ -264,7 +270,9 @@ module OpenAI
|
|
|
264
270
|
def self.new(
|
|
265
271
|
# A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
266
272
|
# vector store should use. Useful for tools like `file_search` that can access
|
|
267
|
-
# files.
|
|
273
|
+
# files. For multi-file ingestion, we recommend
|
|
274
|
+
# [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
275
|
+
# to minimize per-vector-store write requests.
|
|
268
276
|
file_id:,
|
|
269
277
|
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
270
278
|
# for storing additional information about the object in a structured format, and
|
|
@@ -20,7 +20,9 @@ module OpenAI
|
|
|
20
20
|
|
|
21
21
|
# A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
22
22
|
# vector store should use. Useful for tools like `file_search` that can access
|
|
23
|
-
# files.
|
|
23
|
+
# files. For multi-file ingestion, we recommend
|
|
24
|
+
# [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
25
|
+
# to minimize per-vector-store write requests.
|
|
24
26
|
sig { returns(String) }
|
|
25
27
|
attr_accessor :file_id
|
|
26
28
|
|
|
@@ -89,7 +91,9 @@ module OpenAI
|
|
|
89
91
|
vector_store_id:,
|
|
90
92
|
# A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
91
93
|
# vector store should use. Useful for tools like `file_search` that can access
|
|
92
|
-
# files.
|
|
94
|
+
# files. For multi-file ingestion, we recommend
|
|
95
|
+
# [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
96
|
+
# to minimize per-vector-store write requests.
|
|
93
97
|
file_id:,
|
|
94
98
|
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
95
99
|
# for storing additional information about the object in a structured format, and
|
data/rbi/openai/models.rbi
CHANGED
|
@@ -99,8 +99,9 @@ module OpenAI
|
|
|
99
99
|
# Tools available to the model.
|
|
100
100
|
tools: nil,
|
|
101
101
|
# Realtime API can write session traces to the
|
|
102
|
-
# [Traces Dashboard](/logs?api=traces). Set to null to
|
|
103
|
-
# tracing is enabled for a session, the configuration cannot
|
|
102
|
+
# [Traces Dashboard](https://platform.openai.com/logs?api=traces). Set to null to
|
|
103
|
+
# disable tracing. Once tracing is enabled for a session, the configuration cannot
|
|
104
|
+
# be modified.
|
|
104
105
|
#
|
|
105
106
|
# `auto` will create a trace for the session with default values for the workflow
|
|
106
107
|
# name, group id, and metadata.
|
|
@@ -43,14 +43,16 @@ module OpenAI
|
|
|
43
43
|
# A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
|
|
44
44
|
# the vector store should use. Useful for tools like `file_search` that can access
|
|
45
45
|
# files. If `attributes` or `chunking_strategy` are provided, they will be applied
|
|
46
|
-
# to all files in the batch. The maximum batch size is 2000 files.
|
|
47
|
-
#
|
|
46
|
+
# to all files in the batch. The maximum batch size is 2000 files. This endpoint
|
|
47
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
48
|
+
# request pressure. Mutually exclusive with `files`.
|
|
48
49
|
file_ids: nil,
|
|
49
50
|
# A list of objects that each include a `file_id` plus optional `attributes` or
|
|
50
51
|
# `chunking_strategy`. Use this when you need to override metadata for specific
|
|
51
52
|
# files. The global `attributes` or `chunking_strategy` will be ignored and must
|
|
52
|
-
# be specified for each file. The maximum batch size is 2000 files.
|
|
53
|
-
#
|
|
53
|
+
# be specified for each file. The maximum batch size is 2000 files. This endpoint
|
|
54
|
+
# is recommended for multi-file ingestion and helps reduce per-vector-store write
|
|
55
|
+
# request pressure. Mutually exclusive with `file_ids`.
|
|
54
56
|
files: nil,
|
|
55
57
|
request_options: {}
|
|
56
58
|
)
|
|
@@ -31,7 +31,9 @@ module OpenAI
|
|
|
31
31
|
vector_store_id,
|
|
32
32
|
# A [File](https://platform.openai.com/docs/api-reference/files) ID that the
|
|
33
33
|
# vector store should use. Useful for tools like `file_search` that can access
|
|
34
|
-
# files.
|
|
34
|
+
# files. For multi-file ingestion, we recommend
|
|
35
|
+
# [`file_batches`](https://platform.openai.com/docs/api-reference/vector-stores-file-batches/createBatch)
|
|
36
|
+
# to minimize per-vector-store write requests.
|
|
35
37
|
file_id:,
|
|
36
38
|
# Set of 16 key-value pairs that can be attached to an object. This can be useful
|
|
37
39
|
# for storing additional information about the object in a structured format, and
|
|
@@ -45,8 +45,12 @@ module OpenAI
|
|
|
45
45
|
-> top?
|
|
46
46
|
} -> top?
|
|
47
47
|
|
|
48
|
+
RFC_3986_NOT_PCHARS: Regexp
|
|
49
|
+
|
|
48
50
|
def self?.uri_origin: (URI::Generic uri) -> String
|
|
49
51
|
|
|
52
|
+
def self?.encode_path: (String | Integer path) -> String
|
|
53
|
+
|
|
50
54
|
def self?.interpolate_path: (String | ::Array[String] path) -> String
|
|
51
55
|
|
|
52
56
|
def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
|
|
@@ -7,7 +7,8 @@ module OpenAI
|
|
|
7
7
|
content: ::Array[OpenAI::Models::Conversations::Message::content],
|
|
8
8
|
role: OpenAI::Models::Conversations::Message::role,
|
|
9
9
|
status: OpenAI::Models::Conversations::Message::status,
|
|
10
|
-
type: :message
|
|
10
|
+
type: :message,
|
|
11
|
+
phase: OpenAI::Models::Conversations::Message::phase?
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
class Message < OpenAI::Internal::Type::BaseModel
|
|
@@ -21,11 +22,14 @@ module OpenAI
|
|
|
21
22
|
|
|
22
23
|
attr_accessor type: :message
|
|
23
24
|
|
|
25
|
+
attr_accessor phase: OpenAI::Models::Conversations::Message::phase?
|
|
26
|
+
|
|
24
27
|
def initialize: (
|
|
25
28
|
id: String,
|
|
26
29
|
content: ::Array[OpenAI::Models::Conversations::Message::content],
|
|
27
30
|
role: OpenAI::Models::Conversations::Message::role,
|
|
28
31
|
status: OpenAI::Models::Conversations::Message::status,
|
|
32
|
+
?phase: OpenAI::Models::Conversations::Message::phase?,
|
|
29
33
|
?type: :message
|
|
30
34
|
) -> void
|
|
31
35
|
|
|
@@ -34,7 +38,8 @@ module OpenAI
|
|
|
34
38
|
content: ::Array[OpenAI::Models::Conversations::Message::content],
|
|
35
39
|
role: OpenAI::Models::Conversations::Message::role,
|
|
36
40
|
status: OpenAI::Models::Conversations::Message::status,
|
|
37
|
-
type: :message
|
|
41
|
+
type: :message,
|
|
42
|
+
phase: OpenAI::Models::Conversations::Message::phase?
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
type content =
|
|
@@ -102,6 +107,17 @@ module OpenAI
|
|
|
102
107
|
|
|
103
108
|
def self?.values: -> ::Array[OpenAI::Models::Conversations::Message::status]
|
|
104
109
|
end
|
|
110
|
+
|
|
111
|
+
type phase = :commentary | :final_answer
|
|
112
|
+
|
|
113
|
+
module Phase
|
|
114
|
+
extend OpenAI::Internal::Type::Enum
|
|
115
|
+
|
|
116
|
+
COMMENTARY: :commentary
|
|
117
|
+
FINAL_ANSWER: :final_answer
|
|
118
|
+
|
|
119
|
+
def self?.values: -> ::Array[OpenAI::Models::Conversations::Message::phase]
|
|
120
|
+
end
|
|
105
121
|
end
|
|
106
122
|
end
|
|
107
123
|
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module OpenAI
|
|
2
|
+
module Models
|
|
3
|
+
type oauth_error_code = :invalid_grant | :invalid_subject_token | String
|
|
4
|
+
|
|
5
|
+
module OAuthErrorCode
|
|
6
|
+
extend OpenAI::Internal::Type::Union
|
|
7
|
+
|
|
8
|
+
def self?.variants: -> ::Array[OpenAI::Models::oauth_error_code]
|
|
9
|
+
|
|
10
|
+
INVALID_GRANT: :invalid_grant
|
|
11
|
+
INVALID_SUBJECT_TOKEN: :invalid_subject_token
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -4,6 +4,7 @@ module OpenAI
|
|
|
4
4
|
type response_input_file =
|
|
5
5
|
{
|
|
6
6
|
type: :input_file,
|
|
7
|
+
detail: OpenAI::Models::Responses::ResponseInputFile::detail,
|
|
7
8
|
file_data: String,
|
|
8
9
|
file_id: String?,
|
|
9
10
|
file_url: String,
|
|
@@ -13,6 +14,12 @@ module OpenAI
|
|
|
13
14
|
class ResponseInputFile < OpenAI::Internal::Type::BaseModel
|
|
14
15
|
attr_accessor type: :input_file
|
|
15
16
|
|
|
17
|
+
attr_reader detail: OpenAI::Models::Responses::ResponseInputFile::detail?
|
|
18
|
+
|
|
19
|
+
def detail=: (
|
|
20
|
+
OpenAI::Models::Responses::ResponseInputFile::detail
|
|
21
|
+
) -> OpenAI::Models::Responses::ResponseInputFile::detail
|
|
22
|
+
|
|
16
23
|
attr_reader file_data: String?
|
|
17
24
|
|
|
18
25
|
def file_data=: (String) -> String
|
|
@@ -28,6 +35,7 @@ module OpenAI
|
|
|
28
35
|
def filename=: (String) -> String
|
|
29
36
|
|
|
30
37
|
def initialize: (
|
|
38
|
+
?detail: OpenAI::Models::Responses::ResponseInputFile::detail,
|
|
31
39
|
?file_data: String,
|
|
32
40
|
?file_id: String?,
|
|
33
41
|
?file_url: String,
|
|
@@ -37,11 +45,23 @@ module OpenAI
|
|
|
37
45
|
|
|
38
46
|
def to_hash: -> {
|
|
39
47
|
type: :input_file,
|
|
48
|
+
detail: OpenAI::Models::Responses::ResponseInputFile::detail,
|
|
40
49
|
file_data: String,
|
|
41
50
|
file_id: String?,
|
|
42
51
|
file_url: String,
|
|
43
52
|
filename: String
|
|
44
53
|
}
|
|
54
|
+
|
|
55
|
+
type detail = :low | :high
|
|
56
|
+
|
|
57
|
+
module Detail
|
|
58
|
+
extend OpenAI::Internal::Type::Enum
|
|
59
|
+
|
|
60
|
+
LOW: :low
|
|
61
|
+
HIGH: :high
|
|
62
|
+
|
|
63
|
+
def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputFile::detail]
|
|
64
|
+
end
|
|
45
65
|
end
|
|
46
66
|
end
|
|
47
67
|
end
|