openai 0.12.0 → 0.13.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 +8 -0
- data/README.md +1 -1
- data/lib/openai/models/audio/transcription.rb +4 -4
- data/lib/openai/models/audio/transcription_verbose.rb +4 -4
- data/lib/openai/models/file_object.rb +5 -4
- data/lib/openai/models/responses/response_input_file.rb +9 -1
- data/lib/openai/models/responses/response_mcp_call_arguments_delta_event.rb +5 -5
- data/lib/openai/models/responses/response_mcp_call_arguments_done_event.rb +5 -5
- data/lib/openai/models/responses/response_output_text_annotation_added_event.rb +5 -5
- data/lib/openai/models/responses/response_stream_event.rb +3 -3
- data/lib/openai/models/responses/tool.rb +9 -1
- data/lib/openai/version.rb +1 -1
- data/rbi/openai/models/audio/transcription.rbi +4 -4
- data/rbi/openai/models/audio/transcription_verbose.rbi +4 -6
- data/rbi/openai/models/file_object.rbi +7 -6
- data/rbi/openai/models/responses/response_input_file.rbi +11 -0
- data/rbi/openai/models/responses/response_mcp_call_arguments_delta_event.rbi +3 -3
- data/rbi/openai/models/responses/response_mcp_call_arguments_done_event.rbi +3 -3
- data/rbi/openai/models/responses/response_output_text_annotation_added_event.rbi +3 -3
- data/rbi/openai/models/responses/tool.rbi +12 -1
- data/sig/openai/models/audio/transcription.rbs +4 -4
- data/sig/openai/models/audio/transcription_verbose.rbs +4 -4
- data/sig/openai/models/file_object.rbs +2 -0
- data/sig/openai/models/responses/response_input_file.rbs +7 -0
- data/sig/openai/models/responses/response_mcp_call_arguments_delta_event.rbs +4 -4
- data/sig/openai/models/responses/response_mcp_call_arguments_done_event.rbs +4 -4
- data/sig/openai/models/responses/response_output_text_annotation_added_event.rbs +4 -4
- data/sig/openai/models/responses/tool.rbs +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c46771d67ac54a96ea533d6473403bd7357164093ad318367a59a9e4f8d526c4
|
4
|
+
data.tar.gz: c2c858697c822c515ebc105aeb69ecfabdfd515fdc2886ca308ffaa267c2c893
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efa25f9aab25791e58bd2a941953a37b54df6a01c98b0e4bbb0363f8739d7856e8e1b56804bc326315a7861ecfa5082a8b93eee7b429d9db09fe4c2b9b3455d5
|
7
|
+
data.tar.gz: 51b7aab418c9864b7375f457fdcd45380a437361ec72eabad9aca55050ff9ee6ca9f213d5cc037661ae56e75ed12a53160d7819dcbfc2f549b1c82f7b4ae6daa
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.13.0 (2025-07-10)
|
4
|
+
|
5
|
+
Full Changelog: [v0.12.0...v0.13.0](https://github.com/openai/openai-ruby/compare/v0.12.0...v0.13.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **api:** add file_url, fix event ID ([9b8919d](https://github.com/openai/openai-ruby/commit/9b8919d470b622035f13c455aa9aa783feb1f936))
|
10
|
+
|
3
11
|
## 0.12.0 (2025-07-03)
|
4
12
|
|
5
13
|
Full Changelog: [v0.11.0...v0.12.0](https://github.com/openai/openai-ruby/compare/v0.11.0...v0.12.0)
|
data/README.md
CHANGED
@@ -149,11 +149,11 @@ module OpenAI
|
|
149
149
|
end
|
150
150
|
|
151
151
|
class Duration < OpenAI::Internal::Type::BaseModel
|
152
|
-
# @!attribute
|
152
|
+
# @!attribute seconds
|
153
153
|
# Duration of the input audio in seconds.
|
154
154
|
#
|
155
155
|
# @return [Float]
|
156
|
-
required :
|
156
|
+
required :seconds, Float
|
157
157
|
|
158
158
|
# @!attribute type
|
159
159
|
# The type of the usage object. Always `duration` for this variant.
|
@@ -161,10 +161,10 @@ module OpenAI
|
|
161
161
|
# @return [Symbol, :duration]
|
162
162
|
required :type, const: :duration
|
163
163
|
|
164
|
-
# @!method initialize(
|
164
|
+
# @!method initialize(seconds:, type: :duration)
|
165
165
|
# Usage statistics for models billed by audio input duration.
|
166
166
|
#
|
167
|
-
# @param
|
167
|
+
# @param seconds [Float] Duration of the input audio in seconds.
|
168
168
|
#
|
169
169
|
# @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
|
170
170
|
end
|
@@ -58,11 +58,11 @@ module OpenAI
|
|
58
58
|
|
59
59
|
# @see OpenAI::Models::Audio::TranscriptionVerbose#usage
|
60
60
|
class Usage < OpenAI::Internal::Type::BaseModel
|
61
|
-
# @!attribute
|
61
|
+
# @!attribute seconds
|
62
62
|
# Duration of the input audio in seconds.
|
63
63
|
#
|
64
64
|
# @return [Float]
|
65
|
-
required :
|
65
|
+
required :seconds, Float
|
66
66
|
|
67
67
|
# @!attribute type
|
68
68
|
# The type of the usage object. Always `duration` for this variant.
|
@@ -70,10 +70,10 @@ module OpenAI
|
|
70
70
|
# @return [Symbol, :duration]
|
71
71
|
required :type, const: :duration
|
72
72
|
|
73
|
-
# @!method initialize(
|
73
|
+
# @!method initialize(seconds:, type: :duration)
|
74
74
|
# Usage statistics for models billed by audio input duration.
|
75
75
|
#
|
76
|
-
# @param
|
76
|
+
# @param seconds [Float] Duration of the input audio in seconds.
|
77
77
|
#
|
78
78
|
# @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
|
79
79
|
end
|
@@ -36,8 +36,8 @@ module OpenAI
|
|
36
36
|
|
37
37
|
# @!attribute purpose
|
38
38
|
# The intended purpose of the file. Supported values are `assistants`,
|
39
|
-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results
|
40
|
-
# and `
|
39
|
+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
|
40
|
+
# `vision`, and `user_data`.
|
41
41
|
#
|
42
42
|
# @return [Symbol, OpenAI::Models::FileObject::Purpose]
|
43
43
|
required :purpose, enum: -> { OpenAI::FileObject::Purpose }
|
@@ -91,8 +91,8 @@ module OpenAI
|
|
91
91
|
# @param object [Symbol, :file] The object type, which is always `file`.
|
92
92
|
|
93
93
|
# The intended purpose of the file. Supported values are `assistants`,
|
94
|
-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results
|
95
|
-
# and `
|
94
|
+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
|
95
|
+
# `vision`, and `user_data`.
|
96
96
|
#
|
97
97
|
# @see OpenAI::Models::FileObject#purpose
|
98
98
|
module Purpose
|
@@ -105,6 +105,7 @@ module OpenAI
|
|
105
105
|
FINE_TUNE = :"fine-tune"
|
106
106
|
FINE_TUNE_RESULTS = :"fine-tune-results"
|
107
107
|
VISION = :vision
|
108
|
+
USER_DATA = :user_data
|
108
109
|
|
109
110
|
# @!method self.values
|
110
111
|
# @return [Array<Symbol>]
|
@@ -22,13 +22,19 @@ module OpenAI
|
|
22
22
|
# @return [String, nil]
|
23
23
|
optional :file_id, String, nil?: true
|
24
24
|
|
25
|
+
# @!attribute file_url
|
26
|
+
# The URL of the file to be sent to the model.
|
27
|
+
#
|
28
|
+
# @return [String, nil]
|
29
|
+
optional :file_url, String
|
30
|
+
|
25
31
|
# @!attribute filename
|
26
32
|
# The name of the file to be sent to the model.
|
27
33
|
#
|
28
34
|
# @return [String, nil]
|
29
35
|
optional :filename, String
|
30
36
|
|
31
|
-
# @!method initialize(file_data: nil, file_id: nil, filename: nil, type: :input_file)
|
37
|
+
# @!method initialize(file_data: nil, file_id: nil, file_url: nil, filename: nil, type: :input_file)
|
32
38
|
# Some parameter documentations has been truncated, see
|
33
39
|
# {OpenAI::Models::Responses::ResponseInputFile} for more details.
|
34
40
|
#
|
@@ -38,6 +44,8 @@ module OpenAI
|
|
38
44
|
#
|
39
45
|
# @param file_id [String, nil] The ID of the file to be sent to the model.
|
40
46
|
#
|
47
|
+
# @param file_url [String] The URL of the file to be sent to the model.
|
48
|
+
#
|
41
49
|
# @param filename [String] The name of the file to be sent to the model.
|
42
50
|
#
|
43
51
|
# @param type [Symbol, :input_file] The type of the input item. Always `input_file`.
|
@@ -29,12 +29,12 @@ module OpenAI
|
|
29
29
|
required :sequence_number, Integer
|
30
30
|
|
31
31
|
# @!attribute type
|
32
|
-
# The type of the event. Always 'response.
|
32
|
+
# The type of the event. Always 'response.mcp_call_arguments.delta'.
|
33
33
|
#
|
34
|
-
# @return [Symbol, :"response.
|
35
|
-
required :type, const: :"response.
|
34
|
+
# @return [Symbol, :"response.mcp_call_arguments.delta"]
|
35
|
+
required :type, const: :"response.mcp_call_arguments.delta"
|
36
36
|
|
37
|
-
# @!method initialize(delta:, item_id:, output_index:, sequence_number:, type: :"response.
|
37
|
+
# @!method initialize(delta:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call_arguments.delta")
|
38
38
|
# Emitted when there is a delta (partial update) to the arguments of an MCP tool
|
39
39
|
# call.
|
40
40
|
#
|
@@ -46,7 +46,7 @@ module OpenAI
|
|
46
46
|
#
|
47
47
|
# @param sequence_number [Integer] The sequence number of this event.
|
48
48
|
#
|
49
|
-
# @param type [Symbol, :"response.
|
49
|
+
# @param type [Symbol, :"response.mcp_call_arguments.delta"] The type of the event. Always 'response.mcp_call_arguments.delta'.
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -29,12 +29,12 @@ module OpenAI
|
|
29
29
|
required :sequence_number, Integer
|
30
30
|
|
31
31
|
# @!attribute type
|
32
|
-
# The type of the event. Always 'response.
|
32
|
+
# The type of the event. Always 'response.mcp_call_arguments.done'.
|
33
33
|
#
|
34
|
-
# @return [Symbol, :"response.
|
35
|
-
required :type, const: :"response.
|
34
|
+
# @return [Symbol, :"response.mcp_call_arguments.done"]
|
35
|
+
required :type, const: :"response.mcp_call_arguments.done"
|
36
36
|
|
37
|
-
# @!method initialize(arguments:, item_id:, output_index:, sequence_number:, type: :"response.
|
37
|
+
# @!method initialize(arguments:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call_arguments.done")
|
38
38
|
# Emitted when the arguments for an MCP tool call are finalized.
|
39
39
|
#
|
40
40
|
# @param arguments [Object] The finalized arguments for the MCP tool call.
|
@@ -45,7 +45,7 @@ module OpenAI
|
|
45
45
|
#
|
46
46
|
# @param sequence_number [Integer] The sequence number of this event.
|
47
47
|
#
|
48
|
-
# @param type [Symbol, :"response.
|
48
|
+
# @param type [Symbol, :"response.mcp_call_arguments.done"] The type of the event. Always 'response.mcp_call_arguments.done'.
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -41,12 +41,12 @@ module OpenAI
|
|
41
41
|
required :sequence_number, Integer
|
42
42
|
|
43
43
|
# @!attribute type
|
44
|
-
# The type of the event. Always 'response.
|
44
|
+
# The type of the event. Always 'response.output_text.annotation.added'.
|
45
45
|
#
|
46
|
-
# @return [Symbol, :"response.
|
47
|
-
required :type, const: :"response.
|
46
|
+
# @return [Symbol, :"response.output_text.annotation.added"]
|
47
|
+
required :type, const: :"response.output_text.annotation.added"
|
48
48
|
|
49
|
-
# @!method initialize(annotation:, annotation_index:, content_index:, item_id:, output_index:, sequence_number:, type: :"response.
|
49
|
+
# @!method initialize(annotation:, annotation_index:, content_index:, item_id:, output_index:, sequence_number:, type: :"response.output_text.annotation.added")
|
50
50
|
# Emitted when an annotation is added to output text content.
|
51
51
|
#
|
52
52
|
# @param annotation [Object] The annotation object being added. (See annotation schema for details.)
|
@@ -61,7 +61,7 @@ module OpenAI
|
|
61
61
|
#
|
62
62
|
# @param sequence_number [Integer] The sequence number of this event.
|
63
63
|
#
|
64
|
-
# @param type [Symbol, :"response.
|
64
|
+
# @param type [Symbol, :"response.output_text.annotation.added"] The type of the event. Always 'response.output_text.annotation.added'.
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
@@ -151,13 +151,13 @@ module OpenAI
|
|
151
151
|
-> { OpenAI::Responses::ResponseImageGenCallPartialImageEvent }
|
152
152
|
|
153
153
|
# Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
|
154
|
-
variant :"response.
|
154
|
+
variant :"response.mcp_call_arguments.delta",
|
155
155
|
-> {
|
156
156
|
OpenAI::Responses::ResponseMcpCallArgumentsDeltaEvent
|
157
157
|
}
|
158
158
|
|
159
159
|
# Emitted when the arguments for an MCP tool call are finalized.
|
160
|
-
variant :"response.
|
160
|
+
variant :"response.mcp_call_arguments.done",
|
161
161
|
-> {
|
162
162
|
OpenAI::Responses::ResponseMcpCallArgumentsDoneEvent
|
163
163
|
}
|
@@ -185,7 +185,7 @@ module OpenAI
|
|
185
185
|
-> { OpenAI::Responses::ResponseMcpListToolsInProgressEvent }
|
186
186
|
|
187
187
|
# Emitted when an annotation is added to output text content.
|
188
|
-
variant :"response.
|
188
|
+
variant :"response.output_text.annotation.added",
|
189
189
|
-> { OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent }
|
190
190
|
|
191
191
|
# Emitted when a response is queued and waiting to be processed.
|
@@ -74,7 +74,13 @@ module OpenAI
|
|
74
74
|
# @return [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil]
|
75
75
|
optional :require_approval, union: -> { OpenAI::Responses::Tool::Mcp::RequireApproval }, nil?: true
|
76
76
|
|
77
|
-
# @!
|
77
|
+
# @!attribute server_description
|
78
|
+
# Optional description of the MCP server, used to provide more context.
|
79
|
+
#
|
80
|
+
# @return [String, nil]
|
81
|
+
optional :server_description, String
|
82
|
+
|
83
|
+
# @!method initialize(server_label:, server_url:, allowed_tools: nil, headers: nil, require_approval: nil, server_description: nil, type: :mcp)
|
78
84
|
# Some parameter documentations has been truncated, see
|
79
85
|
# {OpenAI::Models::Responses::Tool::Mcp} for more details.
|
80
86
|
#
|
@@ -92,6 +98,8 @@ module OpenAI
|
|
92
98
|
#
|
93
99
|
# @param require_approval [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil] Specify which of the MCP server's tools require approval.
|
94
100
|
#
|
101
|
+
# @param server_description [String] Optional description of the MCP server, used to provide more context.
|
102
|
+
#
|
95
103
|
# @param type [Symbol, :mcp] The type of the MCP tool. Always `mcp`.
|
96
104
|
|
97
105
|
# List of allowed tool names or a filter object.
|
data/lib/openai/version.rb
CHANGED
@@ -291,7 +291,7 @@ module OpenAI
|
|
291
291
|
|
292
292
|
# Duration of the input audio in seconds.
|
293
293
|
sig { returns(Float) }
|
294
|
-
attr_accessor :
|
294
|
+
attr_accessor :seconds
|
295
295
|
|
296
296
|
# The type of the usage object. Always `duration` for this variant.
|
297
297
|
sig { returns(Symbol) }
|
@@ -299,17 +299,17 @@ module OpenAI
|
|
299
299
|
|
300
300
|
# Usage statistics for models billed by audio input duration.
|
301
301
|
sig do
|
302
|
-
params(
|
302
|
+
params(seconds: Float, type: Symbol).returns(T.attached_class)
|
303
303
|
end
|
304
304
|
def self.new(
|
305
305
|
# Duration of the input audio in seconds.
|
306
|
-
|
306
|
+
seconds:,
|
307
307
|
# The type of the usage object. Always `duration` for this variant.
|
308
308
|
type: :duration
|
309
309
|
)
|
310
310
|
end
|
311
311
|
|
312
|
-
sig { override.returns({
|
312
|
+
sig { override.returns({ seconds: Float, type: Symbol }) }
|
313
313
|
def to_hash
|
314
314
|
end
|
315
315
|
end
|
@@ -109,25 +109,23 @@ module OpenAI
|
|
109
109
|
|
110
110
|
# Duration of the input audio in seconds.
|
111
111
|
sig { returns(Float) }
|
112
|
-
attr_accessor :
|
112
|
+
attr_accessor :seconds
|
113
113
|
|
114
114
|
# The type of the usage object. Always `duration` for this variant.
|
115
115
|
sig { returns(Symbol) }
|
116
116
|
attr_accessor :type
|
117
117
|
|
118
118
|
# Usage statistics for models billed by audio input duration.
|
119
|
-
sig
|
120
|
-
params(duration: Float, type: Symbol).returns(T.attached_class)
|
121
|
-
end
|
119
|
+
sig { params(seconds: Float, type: Symbol).returns(T.attached_class) }
|
122
120
|
def self.new(
|
123
121
|
# Duration of the input audio in seconds.
|
124
|
-
|
122
|
+
seconds:,
|
125
123
|
# The type of the usage object. Always `duration` for this variant.
|
126
124
|
type: :duration
|
127
125
|
)
|
128
126
|
end
|
129
127
|
|
130
|
-
sig { override.returns({
|
128
|
+
sig { override.returns({ seconds: Float, type: Symbol }) }
|
131
129
|
def to_hash
|
132
130
|
end
|
133
131
|
end
|
@@ -27,8 +27,8 @@ module OpenAI
|
|
27
27
|
attr_accessor :object
|
28
28
|
|
29
29
|
# The intended purpose of the file. Supported values are `assistants`,
|
30
|
-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results
|
31
|
-
# and `
|
30
|
+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
|
31
|
+
# `vision`, and `user_data`.
|
32
32
|
sig { returns(OpenAI::FileObject::Purpose::TaggedSymbol) }
|
33
33
|
attr_accessor :purpose
|
34
34
|
|
@@ -76,8 +76,8 @@ module OpenAI
|
|
76
76
|
# The name of the file.
|
77
77
|
filename:,
|
78
78
|
# The intended purpose of the file. Supported values are `assistants`,
|
79
|
-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results
|
80
|
-
# and `
|
79
|
+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
|
80
|
+
# `vision`, and `user_data`.
|
81
81
|
purpose:,
|
82
82
|
# Deprecated. The current status of the file, which can be either `uploaded`,
|
83
83
|
# `processed`, or `error`.
|
@@ -111,8 +111,8 @@ module OpenAI
|
|
111
111
|
end
|
112
112
|
|
113
113
|
# The intended purpose of the file. Supported values are `assistants`,
|
114
|
-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results
|
115
|
-
# and `
|
114
|
+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
|
115
|
+
# `vision`, and `user_data`.
|
116
116
|
module Purpose
|
117
117
|
extend OpenAI::Internal::Type::Enum
|
118
118
|
|
@@ -132,6 +132,7 @@ module OpenAI
|
|
132
132
|
FINE_TUNE_RESULTS =
|
133
133
|
T.let(:"fine-tune-results", OpenAI::FileObject::Purpose::TaggedSymbol)
|
134
134
|
VISION = T.let(:vision, OpenAI::FileObject::Purpose::TaggedSymbol)
|
135
|
+
USER_DATA = T.let(:user_data, OpenAI::FileObject::Purpose::TaggedSymbol)
|
135
136
|
|
136
137
|
sig do
|
137
138
|
override.returns(T::Array[OpenAI::FileObject::Purpose::TaggedSymbol])
|
@@ -27,6 +27,13 @@ module OpenAI
|
|
27
27
|
sig { returns(T.nilable(String)) }
|
28
28
|
attr_accessor :file_id
|
29
29
|
|
30
|
+
# The URL of the file to be sent to the model.
|
31
|
+
sig { returns(T.nilable(String)) }
|
32
|
+
attr_reader :file_url
|
33
|
+
|
34
|
+
sig { params(file_url: String).void }
|
35
|
+
attr_writer :file_url
|
36
|
+
|
30
37
|
# The name of the file to be sent to the model.
|
31
38
|
sig { returns(T.nilable(String)) }
|
32
39
|
attr_reader :filename
|
@@ -39,6 +46,7 @@ module OpenAI
|
|
39
46
|
params(
|
40
47
|
file_data: String,
|
41
48
|
file_id: T.nilable(String),
|
49
|
+
file_url: String,
|
42
50
|
filename: String,
|
43
51
|
type: Symbol
|
44
52
|
).returns(T.attached_class)
|
@@ -48,6 +56,8 @@ module OpenAI
|
|
48
56
|
file_data: nil,
|
49
57
|
# The ID of the file to be sent to the model.
|
50
58
|
file_id: nil,
|
59
|
+
# The URL of the file to be sent to the model.
|
60
|
+
file_url: nil,
|
51
61
|
# The name of the file to be sent to the model.
|
52
62
|
filename: nil,
|
53
63
|
# The type of the input item. Always `input_file`.
|
@@ -61,6 +71,7 @@ module OpenAI
|
|
61
71
|
type: Symbol,
|
62
72
|
file_data: String,
|
63
73
|
file_id: T.nilable(String),
|
74
|
+
file_url: String,
|
64
75
|
filename: String
|
65
76
|
}
|
66
77
|
)
|
@@ -28,7 +28,7 @@ module OpenAI
|
|
28
28
|
sig { returns(Integer) }
|
29
29
|
attr_accessor :sequence_number
|
30
30
|
|
31
|
-
# The type of the event. Always 'response.
|
31
|
+
# The type of the event. Always 'response.mcp_call_arguments.delta'.
|
32
32
|
sig { returns(Symbol) }
|
33
33
|
attr_accessor :type
|
34
34
|
|
@@ -52,8 +52,8 @@ module OpenAI
|
|
52
52
|
output_index:,
|
53
53
|
# The sequence number of this event.
|
54
54
|
sequence_number:,
|
55
|
-
# The type of the event. Always 'response.
|
56
|
-
type: :"response.
|
55
|
+
# The type of the event. Always 'response.mcp_call_arguments.delta'.
|
56
|
+
type: :"response.mcp_call_arguments.delta"
|
57
57
|
)
|
58
58
|
end
|
59
59
|
|
@@ -28,7 +28,7 @@ module OpenAI
|
|
28
28
|
sig { returns(Integer) }
|
29
29
|
attr_accessor :sequence_number
|
30
30
|
|
31
|
-
# The type of the event. Always 'response.
|
31
|
+
# The type of the event. Always 'response.mcp_call_arguments.done'.
|
32
32
|
sig { returns(Symbol) }
|
33
33
|
attr_accessor :type
|
34
34
|
|
@@ -51,8 +51,8 @@ module OpenAI
|
|
51
51
|
output_index:,
|
52
52
|
# The sequence number of this event.
|
53
53
|
sequence_number:,
|
54
|
-
# The type of the event. Always 'response.
|
55
|
-
type: :"response.
|
54
|
+
# The type of the event. Always 'response.mcp_call_arguments.done'.
|
55
|
+
type: :"response.mcp_call_arguments.done"
|
56
56
|
)
|
57
57
|
end
|
58
58
|
|
@@ -36,7 +36,7 @@ module OpenAI
|
|
36
36
|
sig { returns(Integer) }
|
37
37
|
attr_accessor :sequence_number
|
38
38
|
|
39
|
-
# The type of the event. Always 'response.
|
39
|
+
# The type of the event. Always 'response.output_text.annotation.added'.
|
40
40
|
sig { returns(Symbol) }
|
41
41
|
attr_accessor :type
|
42
42
|
|
@@ -65,8 +65,8 @@ module OpenAI
|
|
65
65
|
output_index:,
|
66
66
|
# The sequence number of this event.
|
67
67
|
sequence_number:,
|
68
|
-
# The type of the event. Always 'response.
|
69
|
-
type: :"response.
|
68
|
+
# The type of the event. Always 'response.output_text.annotation.added'.
|
69
|
+
type: :"response.output_text.annotation.added"
|
70
70
|
)
|
71
71
|
end
|
72
72
|
|
@@ -70,6 +70,13 @@ module OpenAI
|
|
70
70
|
end
|
71
71
|
attr_accessor :require_approval
|
72
72
|
|
73
|
+
# Optional description of the MCP server, used to provide more context.
|
74
|
+
sig { returns(T.nilable(String)) }
|
75
|
+
attr_reader :server_description
|
76
|
+
|
77
|
+
sig { params(server_description: String).void }
|
78
|
+
attr_writer :server_description
|
79
|
+
|
73
80
|
# Give the model access to additional tools via remote Model Context Protocol
|
74
81
|
# (MCP) servers.
|
75
82
|
# [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).
|
@@ -92,6 +99,7 @@ module OpenAI
|
|
92
99
|
OpenAI::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting::OrSymbol
|
93
100
|
)
|
94
101
|
),
|
102
|
+
server_description: String,
|
95
103
|
type: Symbol
|
96
104
|
).returns(T.attached_class)
|
97
105
|
end
|
@@ -107,6 +115,8 @@ module OpenAI
|
|
107
115
|
headers: nil,
|
108
116
|
# Specify which of the MCP server's tools require approval.
|
109
117
|
require_approval: nil,
|
118
|
+
# Optional description of the MCP server, used to provide more context.
|
119
|
+
server_description: nil,
|
110
120
|
# The type of the MCP tool. Always `mcp`.
|
111
121
|
type: :mcp
|
112
122
|
)
|
@@ -132,7 +142,8 @@ module OpenAI
|
|
132
142
|
OpenAI::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter,
|
133
143
|
OpenAI::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting::OrSymbol
|
134
144
|
)
|
135
|
-
)
|
145
|
+
),
|
146
|
+
server_description: String
|
136
147
|
}
|
137
148
|
)
|
138
149
|
end
|
@@ -131,16 +131,16 @@ module OpenAI
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
-
type duration = {
|
134
|
+
type duration = { seconds: Float, type: :duration }
|
135
135
|
|
136
136
|
class Duration < OpenAI::Internal::Type::BaseModel
|
137
|
-
attr_accessor
|
137
|
+
attr_accessor seconds: Float
|
138
138
|
|
139
139
|
attr_accessor type: :duration
|
140
140
|
|
141
|
-
def initialize: (
|
141
|
+
def initialize: (seconds: Float, ?type: :duration) -> void
|
142
142
|
|
143
|
-
def to_hash: -> {
|
143
|
+
def to_hash: -> { seconds: Float, type: :duration }
|
144
144
|
end
|
145
145
|
|
146
146
|
def self?.variants: -> ::Array[OpenAI::Models::Audio::Transcription::usage]
|
@@ -54,16 +54,16 @@ module OpenAI
|
|
54
54
|
words: ::Array[OpenAI::Audio::TranscriptionWord]
|
55
55
|
}
|
56
56
|
|
57
|
-
type usage = {
|
57
|
+
type usage = { seconds: Float, type: :duration }
|
58
58
|
|
59
59
|
class Usage < OpenAI::Internal::Type::BaseModel
|
60
|
-
attr_accessor
|
60
|
+
attr_accessor seconds: Float
|
61
61
|
|
62
62
|
attr_accessor type: :duration
|
63
63
|
|
64
|
-
def initialize: (
|
64
|
+
def initialize: (seconds: Float, ?type: :duration) -> void
|
65
65
|
|
66
|
-
def to_hash: -> {
|
66
|
+
def to_hash: -> { seconds: Float, type: :duration }
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -68,6 +68,7 @@ module OpenAI
|
|
68
68
|
| :"fine-tune"
|
69
69
|
| :"fine-tune-results"
|
70
70
|
| :vision
|
71
|
+
| :user_data
|
71
72
|
|
72
73
|
module Purpose
|
73
74
|
extend OpenAI::Internal::Type::Enum
|
@@ -79,6 +80,7 @@ module OpenAI
|
|
79
80
|
FINE_TUNE: :"fine-tune"
|
80
81
|
FINE_TUNE_RESULTS: :"fine-tune-results"
|
81
82
|
VISION: :vision
|
83
|
+
USER_DATA: :user_data
|
82
84
|
|
83
85
|
def self?.values: -> ::Array[OpenAI::Models::FileObject::purpose]
|
84
86
|
end
|
@@ -6,6 +6,7 @@ module OpenAI
|
|
6
6
|
type: :input_file,
|
7
7
|
file_data: String,
|
8
8
|
file_id: String?,
|
9
|
+
file_url: String,
|
9
10
|
filename: String
|
10
11
|
}
|
11
12
|
|
@@ -18,6 +19,10 @@ module OpenAI
|
|
18
19
|
|
19
20
|
attr_accessor file_id: String?
|
20
21
|
|
22
|
+
attr_reader file_url: String?
|
23
|
+
|
24
|
+
def file_url=: (String) -> String
|
25
|
+
|
21
26
|
attr_reader filename: String?
|
22
27
|
|
23
28
|
def filename=: (String) -> String
|
@@ -25,6 +30,7 @@ module OpenAI
|
|
25
30
|
def initialize: (
|
26
31
|
?file_data: String,
|
27
32
|
?file_id: String?,
|
33
|
+
?file_url: String,
|
28
34
|
?filename: String,
|
29
35
|
?type: :input_file
|
30
36
|
) -> void
|
@@ -33,6 +39,7 @@ module OpenAI
|
|
33
39
|
type: :input_file,
|
34
40
|
file_data: String,
|
35
41
|
file_id: String?,
|
42
|
+
file_url: String,
|
36
43
|
filename: String
|
37
44
|
}
|
38
45
|
end
|
@@ -7,7 +7,7 @@ module OpenAI
|
|
7
7
|
item_id: String,
|
8
8
|
output_index: Integer,
|
9
9
|
sequence_number: Integer,
|
10
|
-
type: :"response.
|
10
|
+
type: :"response.mcp_call_arguments.delta"
|
11
11
|
}
|
12
12
|
|
13
13
|
class ResponseMcpCallArgumentsDeltaEvent < OpenAI::Internal::Type::BaseModel
|
@@ -19,14 +19,14 @@ module OpenAI
|
|
19
19
|
|
20
20
|
attr_accessor sequence_number: Integer
|
21
21
|
|
22
|
-
attr_accessor type: :"response.
|
22
|
+
attr_accessor type: :"response.mcp_call_arguments.delta"
|
23
23
|
|
24
24
|
def initialize: (
|
25
25
|
delta: top,
|
26
26
|
item_id: String,
|
27
27
|
output_index: Integer,
|
28
28
|
sequence_number: Integer,
|
29
|
-
?type: :"response.
|
29
|
+
?type: :"response.mcp_call_arguments.delta"
|
30
30
|
) -> void
|
31
31
|
|
32
32
|
def to_hash: -> {
|
@@ -34,7 +34,7 @@ module OpenAI
|
|
34
34
|
item_id: String,
|
35
35
|
output_index: Integer,
|
36
36
|
sequence_number: Integer,
|
37
|
-
type: :"response.
|
37
|
+
type: :"response.mcp_call_arguments.delta"
|
38
38
|
}
|
39
39
|
end
|
40
40
|
end
|
@@ -7,7 +7,7 @@ module OpenAI
|
|
7
7
|
item_id: String,
|
8
8
|
output_index: Integer,
|
9
9
|
sequence_number: Integer,
|
10
|
-
type: :"response.
|
10
|
+
type: :"response.mcp_call_arguments.done"
|
11
11
|
}
|
12
12
|
|
13
13
|
class ResponseMcpCallArgumentsDoneEvent < OpenAI::Internal::Type::BaseModel
|
@@ -19,14 +19,14 @@ module OpenAI
|
|
19
19
|
|
20
20
|
attr_accessor sequence_number: Integer
|
21
21
|
|
22
|
-
attr_accessor type: :"response.
|
22
|
+
attr_accessor type: :"response.mcp_call_arguments.done"
|
23
23
|
|
24
24
|
def initialize: (
|
25
25
|
arguments: top,
|
26
26
|
item_id: String,
|
27
27
|
output_index: Integer,
|
28
28
|
sequence_number: Integer,
|
29
|
-
?type: :"response.
|
29
|
+
?type: :"response.mcp_call_arguments.done"
|
30
30
|
) -> void
|
31
31
|
|
32
32
|
def to_hash: -> {
|
@@ -34,7 +34,7 @@ module OpenAI
|
|
34
34
|
item_id: String,
|
35
35
|
output_index: Integer,
|
36
36
|
sequence_number: Integer,
|
37
|
-
type: :"response.
|
37
|
+
type: :"response.mcp_call_arguments.done"
|
38
38
|
}
|
39
39
|
end
|
40
40
|
end
|
@@ -9,7 +9,7 @@ module OpenAI
|
|
9
9
|
item_id: String,
|
10
10
|
output_index: Integer,
|
11
11
|
sequence_number: Integer,
|
12
|
-
type: :"response.
|
12
|
+
type: :"response.output_text.annotation.added"
|
13
13
|
}
|
14
14
|
|
15
15
|
class ResponseOutputTextAnnotationAddedEvent < OpenAI::Internal::Type::BaseModel
|
@@ -25,7 +25,7 @@ module OpenAI
|
|
25
25
|
|
26
26
|
attr_accessor sequence_number: Integer
|
27
27
|
|
28
|
-
attr_accessor type: :"response.
|
28
|
+
attr_accessor type: :"response.output_text.annotation.added"
|
29
29
|
|
30
30
|
def initialize: (
|
31
31
|
annotation: top,
|
@@ -34,7 +34,7 @@ module OpenAI
|
|
34
34
|
item_id: String,
|
35
35
|
output_index: Integer,
|
36
36
|
sequence_number: Integer,
|
37
|
-
?type: :"response.
|
37
|
+
?type: :"response.output_text.annotation.added"
|
38
38
|
) -> void
|
39
39
|
|
40
40
|
def to_hash: -> {
|
@@ -44,7 +44,7 @@ module OpenAI
|
|
44
44
|
item_id: String,
|
45
45
|
output_index: Integer,
|
46
46
|
sequence_number: Integer,
|
47
|
-
type: :"response.
|
47
|
+
type: :"response.output_text.annotation.added"
|
48
48
|
}
|
49
49
|
end
|
50
50
|
end
|
@@ -21,7 +21,8 @@ module OpenAI
|
|
21
21
|
type: :mcp,
|
22
22
|
allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
|
23
23
|
headers: ::Hash[Symbol, String]?,
|
24
|
-
require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval
|
24
|
+
require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
|
25
|
+
server_description: String
|
25
26
|
}
|
26
27
|
|
27
28
|
class Mcp < OpenAI::Internal::Type::BaseModel
|
@@ -37,12 +38,17 @@ module OpenAI
|
|
37
38
|
|
38
39
|
attr_accessor require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?
|
39
40
|
|
41
|
+
attr_reader server_description: String?
|
42
|
+
|
43
|
+
def server_description=: (String) -> String
|
44
|
+
|
40
45
|
def initialize: (
|
41
46
|
server_label: String,
|
42
47
|
server_url: String,
|
43
48
|
?allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
|
44
49
|
?headers: ::Hash[Symbol, String]?,
|
45
50
|
?require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
|
51
|
+
?server_description: String,
|
46
52
|
?type: :mcp
|
47
53
|
) -> void
|
48
54
|
|
@@ -52,7 +58,8 @@ module OpenAI
|
|
52
58
|
type: :mcp,
|
53
59
|
allowed_tools: OpenAI::Models::Responses::Tool::Mcp::allowed_tools?,
|
54
60
|
headers: ::Hash[Symbol, String]?,
|
55
|
-
require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval
|
61
|
+
require_approval: OpenAI::Models::Responses::Tool::Mcp::require_approval?,
|
62
|
+
server_description: String
|
56
63
|
}
|
57
64
|
|
58
65
|
type allowed_tools =
|
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.
|
4
|
+
version: 0.13.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-07-
|
11
|
+
date: 2025-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|