Skip to content

Commit aa92110

Browse files
feat(api): add file_url, fix event ID
1 parent a2b99b0 commit aa92110

26 files changed

+137
-83
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 109
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a473967d1766dc155994d932fbc4a5bcbd1c140a37c20d0a4065e1bf0640536d.yml
3-
openapi_spec_hash: 67cdc62b0d6c8b1de29b7dc54b265749
4-
config_hash: 7b53f96f897ca1b3407a5341a6f820db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-2d116cda53321baa3479e628512def723207a81eb1cdaebb542bd0555e563bda.yml
3+
openapi_spec_hash: 809d958fec261a32004a4b026b718793
4+
config_hash: e74d6791681e3af1b548748ff47a22c2

lib/openai/models/audio/transcription.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,22 +149,22 @@ class InputTokenDetails < OpenAI::Internal::Type::BaseModel
149149
end
150150

151151
class Duration < OpenAI::Internal::Type::BaseModel
152-
# @!attribute duration
152+
# @!attribute seconds
153153
# Duration of the input audio in seconds.
154154
#
155155
# @return [Float]
156-
required :duration, Float
156+
required :seconds, Float
157157

158158
# @!attribute type
159159
# The type of the usage object. Always `duration` for this variant.
160160
#
161161
# @return [Symbol, :duration]
162162
required :type, const: :duration
163163

164-
# @!method initialize(duration:, type: :duration)
164+
# @!method initialize(seconds:, type: :duration)
165165
# Usage statistics for models billed by audio input duration.
166166
#
167-
# @param duration [Float] Duration of the input audio in seconds.
167+
# @param seconds [Float] Duration of the input audio in seconds.
168168
#
169169
# @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
170170
end

lib/openai/models/audio/transcription_verbose.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,22 @@ class TranscriptionVerbose < OpenAI::Internal::Type::BaseModel
5858

5959
# @see OpenAI::Models::Audio::TranscriptionVerbose#usage
6060
class Usage < OpenAI::Internal::Type::BaseModel
61-
# @!attribute duration
61+
# @!attribute seconds
6262
# Duration of the input audio in seconds.
6363
#
6464
# @return [Float]
65-
required :duration, Float
65+
required :seconds, Float
6666

6767
# @!attribute type
6868
# The type of the usage object. Always `duration` for this variant.
6969
#
7070
# @return [Symbol, :duration]
7171
required :type, const: :duration
7272

73-
# @!method initialize(duration:, type: :duration)
73+
# @!method initialize(seconds:, type: :duration)
7474
# Usage statistics for models billed by audio input duration.
7575
#
76-
# @param duration [Float] Duration of the input audio in seconds.
76+
# @param seconds [Float] Duration of the input audio in seconds.
7777
#
7878
# @param type [Symbol, :duration] The type of the usage object. Always `duration` for this variant.
7979
end

lib/openai/models/file_object.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class FileObject < OpenAI::Internal::Type::BaseModel
3636

3737
# @!attribute purpose
3838
# The intended purpose of the file. Supported values are `assistants`,
39-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`
40-
# and `vision`.
39+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
40+
# `vision`, and `user_data`.
4141
#
4242
# @return [Symbol, OpenAI::Models::FileObject::Purpose]
4343
required :purpose, enum: -> { OpenAI::FileObject::Purpose }
@@ -91,8 +91,8 @@ class FileObject < OpenAI::Internal::Type::BaseModel
9191
# @param object [Symbol, :file] The object type, which is always `file`.
9292

9393
# The intended purpose of the file. Supported values are `assistants`,
94-
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`
95-
# and `vision`.
94+
# `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`,
95+
# `vision`, and `user_data`.
9696
#
9797
# @see OpenAI::Models::FileObject#purpose
9898
module Purpose
@@ -105,6 +105,7 @@ module Purpose
105105
FINE_TUNE = :"fine-tune"
106106
FINE_TUNE_RESULTS = :"fine-tune-results"
107107
VISION = :vision
108+
USER_DATA = :user_data
108109

109110
# @!method self.values
110111
# @return [Array<Symbol>]

lib/openai/models/responses/response_input_file.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,19 @@ class ResponseInputFile < OpenAI::Internal::Type::BaseModel
2222
# @return [String, nil]
2323
optional :file_id, String, nil?: true
2424

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+
2531
# @!attribute filename
2632
# The name of the file to be sent to the model.
2733
#
2834
# @return [String, nil]
2935
optional :filename, String
3036

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)
3238
# Some parameter documentations has been truncated, see
3339
# {OpenAI::Models::Responses::ResponseInputFile} for more details.
3440
#
@@ -38,6 +44,8 @@ class ResponseInputFile < OpenAI::Internal::Type::BaseModel
3844
#
3945
# @param file_id [String, nil] The ID of the file to be sent to the model.
4046
#
47+
# @param file_url [String] The URL of the file to be sent to the model.
48+
#
4149
# @param filename [String] The name of the file to be sent to the model.
4250
#
4351
# @param type [Symbol, :input_file] The type of the input item. Always `input_file`.

lib/openai/models/responses/response_mcp_call_arguments_delta_event.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class ResponseMcpCallArgumentsDeltaEvent < OpenAI::Internal::Type::BaseModel
2929
required :sequence_number, Integer
3030

3131
# @!attribute type
32-
# The type of the event. Always 'response.mcp_call.arguments_delta'.
32+
# The type of the event. Always 'response.mcp_call_arguments.delta'.
3333
#
34-
# @return [Symbol, :"response.mcp_call.arguments_delta"]
35-
required :type, const: :"response.mcp_call.arguments_delta"
34+
# @return [Symbol, :"response.mcp_call_arguments.delta"]
35+
required :type, const: :"response.mcp_call_arguments.delta"
3636

37-
# @!method initialize(delta:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call.arguments_delta")
37+
# @!method initialize(delta:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call_arguments.delta")
3838
# Emitted when there is a delta (partial update) to the arguments of an MCP tool
3939
# call.
4040
#
@@ -46,7 +46,7 @@ class ResponseMcpCallArgumentsDeltaEvent < OpenAI::Internal::Type::BaseModel
4646
#
4747
# @param sequence_number [Integer] The sequence number of this event.
4848
#
49-
# @param type [Symbol, :"response.mcp_call.arguments_delta"] The type of the event. Always 'response.mcp_call.arguments_delta'.
49+
# @param type [Symbol, :"response.mcp_call_arguments.delta"] The type of the event. Always 'response.mcp_call_arguments.delta'.
5050
end
5151
end
5252
end

lib/openai/models/responses/response_mcp_call_arguments_done_event.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class ResponseMcpCallArgumentsDoneEvent < OpenAI::Internal::Type::BaseModel
2929
required :sequence_number, Integer
3030

3131
# @!attribute type
32-
# The type of the event. Always 'response.mcp_call.arguments_done'.
32+
# The type of the event. Always 'response.mcp_call_arguments.done'.
3333
#
34-
# @return [Symbol, :"response.mcp_call.arguments_done"]
35-
required :type, const: :"response.mcp_call.arguments_done"
34+
# @return [Symbol, :"response.mcp_call_arguments.done"]
35+
required :type, const: :"response.mcp_call_arguments.done"
3636

37-
# @!method initialize(arguments:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call.arguments_done")
37+
# @!method initialize(arguments:, item_id:, output_index:, sequence_number:, type: :"response.mcp_call_arguments.done")
3838
# Emitted when the arguments for an MCP tool call are finalized.
3939
#
4040
# @param arguments [Object] The finalized arguments for the MCP tool call.
@@ -45,7 +45,7 @@ class ResponseMcpCallArgumentsDoneEvent < OpenAI::Internal::Type::BaseModel
4545
#
4646
# @param sequence_number [Integer] The sequence number of this event.
4747
#
48-
# @param type [Symbol, :"response.mcp_call.arguments_done"] The type of the event. Always 'response.mcp_call.arguments_done'.
48+
# @param type [Symbol, :"response.mcp_call_arguments.done"] The type of the event. Always 'response.mcp_call_arguments.done'.
4949
end
5050
end
5151
end

lib/openai/models/responses/response_output_text_annotation_added_event.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ class ResponseOutputTextAnnotationAddedEvent < OpenAI::Internal::Type::BaseModel
4141
required :sequence_number, Integer
4242

4343
# @!attribute type
44-
# The type of the event. Always 'response.output_text_annotation.added'.
44+
# The type of the event. Always 'response.output_text.annotation.added'.
4545
#
46-
# @return [Symbol, :"response.output_text_annotation.added"]
47-
required :type, const: :"response.output_text_annotation.added"
46+
# @return [Symbol, :"response.output_text.annotation.added"]
47+
required :type, const: :"response.output_text.annotation.added"
4848

49-
# @!method initialize(annotation:, annotation_index:, content_index:, item_id:, output_index:, sequence_number:, type: :"response.output_text_annotation.added")
49+
# @!method initialize(annotation:, annotation_index:, content_index:, item_id:, output_index:, sequence_number:, type: :"response.output_text.annotation.added")
5050
# Emitted when an annotation is added to output text content.
5151
#
5252
# @param annotation [Object] The annotation object being added. (See annotation schema for details.)
@@ -61,7 +61,7 @@ class ResponseOutputTextAnnotationAddedEvent < OpenAI::Internal::Type::BaseModel
6161
#
6262
# @param sequence_number [Integer] The sequence number of this event.
6363
#
64-
# @param type [Symbol, :"response.output_text_annotation.added"] The type of the event. Always 'response.output_text_annotation.added'.
64+
# @param type [Symbol, :"response.output_text.annotation.added"] The type of the event. Always 'response.output_text.annotation.added'.
6565
end
6666
end
6767
end

lib/openai/models/responses/response_stream_event.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ module ResponseStreamEvent
151151
-> { OpenAI::Responses::ResponseImageGenCallPartialImageEvent }
152152

153153
# Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
154-
variant :"response.mcp_call.arguments_delta",
154+
variant :"response.mcp_call_arguments.delta",
155155
-> {
156156
OpenAI::Responses::ResponseMcpCallArgumentsDeltaEvent
157157
}
158158

159159
# Emitted when the arguments for an MCP tool call are finalized.
160-
variant :"response.mcp_call.arguments_done",
160+
variant :"response.mcp_call_arguments.done",
161161
-> {
162162
OpenAI::Responses::ResponseMcpCallArgumentsDoneEvent
163163
}
@@ -185,7 +185,7 @@ module ResponseStreamEvent
185185
-> { OpenAI::Responses::ResponseMcpListToolsInProgressEvent }
186186

187187
# Emitted when an annotation is added to output text content.
188-
variant :"response.output_text_annotation.added",
188+
variant :"response.output_text.annotation.added",
189189
-> { OpenAI::Responses::ResponseOutputTextAnnotationAddedEvent }
190190

191191
# Emitted when a response is queued and waiting to be processed.

lib/openai/models/responses/tool.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@ class Mcp < OpenAI::Internal::Type::BaseModel
7474
# @return [OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalFilter, Symbol, OpenAI::Models::Responses::Tool::Mcp::RequireApproval::McpToolApprovalSetting, nil]
7575
optional :require_approval, union: -> { OpenAI::Responses::Tool::Mcp::RequireApproval }, nil?: true
7676

77-
# @!method initialize(server_label:, server_url:, allowed_tools: nil, headers: nil, require_approval: nil, type: :mcp)
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)
7884
# Some parameter documentations has been truncated, see
7985
# {OpenAI::Models::Responses::Tool::Mcp} for more details.
8086
#
@@ -92,6 +98,8 @@ class Mcp < OpenAI::Internal::Type::BaseModel
9298
#
9399
# @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.
94100
#
101+
# @param server_description [String] Optional description of the MCP server, used to provide more context.
102+
#
95103
# @param type [Symbol, :mcp] The type of the MCP tool. Always `mcp`.
96104

97105
# List of allowed tool names or a filter object.

0 commit comments

Comments
 (0)