diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8935e932..a6fc929e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.28.0" + ".": "0.28.1" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 10c939b2..27f2ffc6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 118 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-49233088b5e73dbb96bf7af27be3d4547632e3db1c2b00f14184900613325bbc.yml -openapi_spec_hash: b34f14b141d5019244112901c5c7c2d8 -config_hash: 94e9ba08201c3d1ca46e093e6a0138fa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-e205b1f2da6a1f2caa229efa9ede63f2d3d2fedeeb2dd6ed3d880bafdcb0ab88.yml +openapi_spec_hash: c8aee2469a749f6a838b40c57e4b7b06 +config_hash: 45dcba51451ba532959c020a0ddbf23c diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb9b9ff..d8174a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.28.1 (2025-10-01) + +Full Changelog: [v0.28.0...v0.28.1](https://github.com/openai/openai-ruby/compare/v0.28.0...v0.28.1) + +### Bug Fixes + +* **api:** add status, approval_request_id to MCP tool call ([51622d0](https://github.com/openai/openai-ruby/commit/51622d065828bec248fb765c5bc243a058f0044d)) + ## 0.28.0 (2025-09-30) Full Changelog: [v0.27.1...v0.28.0](https://github.com/openai/openai-ruby/compare/v0.27.1...v0.28.0) diff --git a/Gemfile.lock b/Gemfile.lock index 897fd805..a95bebcb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - openai (0.28.0) + openai (0.28.1) connection_pool GEM diff --git a/README.md b/README.md index c81e6ffe..070e52ad 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "openai", "~> 0.28.0" +gem "openai", "~> 0.28.1" ``` diff --git a/lib/openai/models/conversations/conversation_item.rb b/lib/openai/models/conversations/conversation_item.rb index 7f4a0f2e..d73bcdd2 100644 --- a/lib/openai/models/conversations/conversation_item.rb +++ b/lib/openai/models/conversations/conversation_item.rb @@ -526,6 +526,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :mcp_call] required :type, const: :mcp_call + # @!attribute approval_request_id + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + # + # @return [String, nil] + optional :approval_request_id, String, nil?: true + # @!attribute error # The error from the tool call, if any. # @@ -538,7 +546,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :output, String, nil?: true - # @!method initialize(id:, arguments:, name:, server_label:, error: nil, output: nil, type: :mcp_call) + # @!attribute status + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @return [Symbol, OpenAI::Models::Conversations::ConversationItem::McpCall::Status, nil] + optional :status, enum: -> { OpenAI::Conversations::ConversationItem::McpCall::Status } + + # @!method initialize(id:, arguments:, name:, server_label:, approval_request_id: nil, error: nil, output: nil, status: nil, type: :mcp_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Conversations::ConversationItem::McpCall} for more details. # @@ -552,11 +567,32 @@ class McpCall < OpenAI::Internal::Type::BaseModel # # @param server_label [String] The label of the MCP server running the tool. # + # @param approval_request_id [String, nil] Unique identifier for the MCP tool call approval request. + # # @param error [String, nil] The error from the tool call, if any. # # @param output [String, nil] The output from the tool call. # + # @param status [Symbol, OpenAI::Models::Conversations::ConversationItem::McpCall::Status] The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `c + # # @param type [Symbol, :mcp_call] The type of the item. Always `mcp_call`. + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @see OpenAI::Models::Conversations::ConversationItem::McpCall#status + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS = :in_progress + COMPLETED = :completed + INCOMPLETE = :incomplete + CALLING = :calling + FAILED = :failed + + # @!method self.values + # @return [Array] + end end # @!method self.variants diff --git a/lib/openai/models/responses/response_input_item.rb b/lib/openai/models/responses/response_input_item.rb index eba98f97..cc4c7bc9 100644 --- a/lib/openai/models/responses/response_input_item.rb +++ b/lib/openai/models/responses/response_input_item.rb @@ -818,6 +818,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :mcp_call] required :type, const: :mcp_call + # @!attribute approval_request_id + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + # + # @return [String, nil] + optional :approval_request_id, String, nil?: true + # @!attribute error # The error from the tool call, if any. # @@ -830,7 +838,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :output, String, nil?: true - # @!method initialize(id:, arguments:, name:, server_label:, error: nil, output: nil, type: :mcp_call) + # @!attribute status + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseInputItem::McpCall::Status, nil] + optional :status, enum: -> { OpenAI::Responses::ResponseInputItem::McpCall::Status } + + # @!method initialize(id:, arguments:, name:, server_label:, approval_request_id: nil, error: nil, output: nil, status: nil, type: :mcp_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseInputItem::McpCall} for more details. # @@ -844,11 +859,32 @@ class McpCall < OpenAI::Internal::Type::BaseModel # # @param server_label [String] The label of the MCP server running the tool. # + # @param approval_request_id [String, nil] Unique identifier for the MCP tool call approval request. + # # @param error [String, nil] The error from the tool call, if any. # # @param output [String, nil] The output from the tool call. # + # @param status [Symbol, OpenAI::Models::Responses::ResponseInputItem::McpCall::Status] The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `c + # # @param type [Symbol, :mcp_call] The type of the item. Always `mcp_call`. + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @see OpenAI::Models::Responses::ResponseInputItem::McpCall#status + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS = :in_progress + COMPLETED = :completed + INCOMPLETE = :incomplete + CALLING = :calling + FAILED = :failed + + # @!method self.values + # @return [Array] + end end class ItemReference < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/models/responses/response_item.rb b/lib/openai/models/responses/response_item.rb index 4b501f36..fa7aca0e 100644 --- a/lib/openai/models/responses/response_item.rb +++ b/lib/openai/models/responses/response_item.rb @@ -508,6 +508,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :mcp_call] required :type, const: :mcp_call + # @!attribute approval_request_id + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + # + # @return [String, nil] + optional :approval_request_id, String, nil?: true + # @!attribute error # The error from the tool call, if any. # @@ -520,7 +528,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :output, String, nil?: true - # @!method initialize(id:, arguments:, name:, server_label:, error: nil, output: nil, type: :mcp_call) + # @!attribute status + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseItem::McpCall::Status, nil] + optional :status, enum: -> { OpenAI::Responses::ResponseItem::McpCall::Status } + + # @!method initialize(id:, arguments:, name:, server_label:, approval_request_id: nil, error: nil, output: nil, status: nil, type: :mcp_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseItem::McpCall} for more details. # @@ -534,11 +549,32 @@ class McpCall < OpenAI::Internal::Type::BaseModel # # @param server_label [String] The label of the MCP server running the tool. # + # @param approval_request_id [String, nil] Unique identifier for the MCP tool call approval request. + # # @param error [String, nil] The error from the tool call, if any. # # @param output [String, nil] The output from the tool call. # + # @param status [Symbol, OpenAI::Models::Responses::ResponseItem::McpCall::Status] The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `c + # # @param type [Symbol, :mcp_call] The type of the item. Always `mcp_call`. + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @see OpenAI::Models::Responses::ResponseItem::McpCall#status + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS = :in_progress + COMPLETED = :completed + INCOMPLETE = :incomplete + CALLING = :calling + FAILED = :failed + + # @!method self.values + # @return [Array] + end end # @!method self.variants diff --git a/lib/openai/models/responses/response_output_item.rb b/lib/openai/models/responses/response_output_item.rb index 5e2bd164..34c8c3c0 100644 --- a/lib/openai/models/responses/response_output_item.rb +++ b/lib/openai/models/responses/response_output_item.rb @@ -263,6 +263,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [Symbol, :mcp_call] required :type, const: :mcp_call + # @!attribute approval_request_id + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + # + # @return [String, nil] + optional :approval_request_id, String, nil?: true + # @!attribute error # The error from the tool call, if any. # @@ -275,7 +283,14 @@ class McpCall < OpenAI::Internal::Type::BaseModel # @return [String, nil] optional :output, String, nil?: true - # @!method initialize(id:, arguments:, name:, server_label:, error: nil, output: nil, type: :mcp_call) + # @!attribute status + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @return [Symbol, OpenAI::Models::Responses::ResponseOutputItem::McpCall::Status, nil] + optional :status, enum: -> { OpenAI::Responses::ResponseOutputItem::McpCall::Status } + + # @!method initialize(id:, arguments:, name:, server_label:, approval_request_id: nil, error: nil, output: nil, status: nil, type: :mcp_call) # Some parameter documentations has been truncated, see # {OpenAI::Models::Responses::ResponseOutputItem::McpCall} for more details. # @@ -289,11 +304,32 @@ class McpCall < OpenAI::Internal::Type::BaseModel # # @param server_label [String] The label of the MCP server running the tool. # + # @param approval_request_id [String, nil] Unique identifier for the MCP tool call approval request. + # # @param error [String, nil] The error from the tool call, if any. # # @param output [String, nil] The output from the tool call. # + # @param status [Symbol, OpenAI::Models::Responses::ResponseOutputItem::McpCall::Status] The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `c + # # @param type [Symbol, :mcp_call] The type of the item. Always `mcp_call`. + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + # + # @see OpenAI::Models::Responses::ResponseOutputItem::McpCall#status + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS = :in_progress + COMPLETED = :completed + INCOMPLETE = :incomplete + CALLING = :calling + FAILED = :failed + + # @!method self.values + # @return [Array] + end end class McpListTools < OpenAI::Internal::Type::BaseModel diff --git a/lib/openai/version.rb b/lib/openai/version.rb index 307a12b6..ac17d046 100644 --- a/lib/openai/version.rb +++ b/lib/openai/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module OpenAI - VERSION = "0.28.0" + VERSION = "0.28.1" end diff --git a/rbi/openai/models/conversations/conversation_item.rbi b/rbi/openai/models/conversations/conversation_item.rbi index d4c14870..870922f8 100644 --- a/rbi/openai/models/conversations/conversation_item.rbi +++ b/rbi/openai/models/conversations/conversation_item.rbi @@ -767,6 +767,12 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + sig { returns(T.nilable(String)) } + attr_accessor :approval_request_id + # The error from the tool call, if any. sig { returns(T.nilable(String)) } attr_accessor :error @@ -775,6 +781,25 @@ module OpenAI sig { returns(T.nilable(String)) } attr_accessor :output + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + sig do + returns( + T.nilable( + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + OpenAI::Conversations::ConversationItem::McpCall::Status::OrSymbol + ).void + end + attr_writer :status + # An invocation of a tool on an MCP server. sig do params( @@ -782,8 +807,11 @@ module OpenAI arguments: String, name: String, server_label: String, + approval_request_id: T.nilable(String), error: T.nilable(String), output: T.nilable(String), + status: + OpenAI::Conversations::ConversationItem::McpCall::Status::OrSymbol, type: Symbol ).returns(T.attached_class) end @@ -796,10 +824,17 @@ module OpenAI name:, # The label of the MCP server running the tool. server_label:, + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + approval_request_id: nil, # The error from the tool call, if any. error: nil, # The output from the tool call. output: nil, + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + status: nil, # The type of the item. Always `mcp_call`. type: :mcp_call ) @@ -813,13 +848,67 @@ module OpenAI name: String, server_label: String, type: Symbol, + approval_request_id: T.nilable(String), error: T.nilable(String), - output: T.nilable(String) + output: T.nilable(String), + status: + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol } ) end def to_hash end + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Conversations::ConversationItem::McpCall::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_PROGRESS = + T.let( + :in_progress, + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + CALLING = + T.let( + :calling, + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Conversations::ConversationItem::McpCall::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end sig do diff --git a/rbi/openai/models/responses/response_input_item.rbi b/rbi/openai/models/responses/response_input_item.rbi index 041e57cc..359bc51c 100644 --- a/rbi/openai/models/responses/response_input_item.rbi +++ b/rbi/openai/models/responses/response_input_item.rbi @@ -1381,6 +1381,12 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + sig { returns(T.nilable(String)) } + attr_accessor :approval_request_id + # The error from the tool call, if any. sig { returns(T.nilable(String)) } attr_accessor :error @@ -1389,6 +1395,25 @@ module OpenAI sig { returns(T.nilable(String)) } attr_accessor :output + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + sig do + returns( + T.nilable( + OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol + ).void + end + attr_writer :status + # An invocation of a tool on an MCP server. sig do params( @@ -1396,8 +1421,11 @@ module OpenAI arguments: String, name: String, server_label: String, + approval_request_id: T.nilable(String), error: T.nilable(String), output: T.nilable(String), + status: + OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol, type: Symbol ).returns(T.attached_class) end @@ -1410,10 +1438,17 @@ module OpenAI name:, # The label of the MCP server running the tool. server_label:, + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + approval_request_id: nil, # The error from the tool call, if any. error: nil, # The output from the tool call. output: nil, + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + status: nil, # The type of the item. Always `mcp_call`. type: :mcp_call ) @@ -1427,13 +1462,67 @@ module OpenAI name: String, server_label: String, type: Symbol, + approval_request_id: T.nilable(String), error: T.nilable(String), - output: T.nilable(String) + output: T.nilable(String), + status: + OpenAI::Responses::ResponseInputItem::McpCall::Status::OrSymbol } ) end def to_hash end + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Responses::ResponseInputItem::McpCall::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_PROGRESS = + T.let( + :in_progress, + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ) + CALLING = + T.let( + :calling, + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Responses::ResponseInputItem::McpCall::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end class ItemReference < OpenAI::Internal::Type::BaseModel diff --git a/rbi/openai/models/responses/response_item.rbi b/rbi/openai/models/responses/response_item.rbi index 9566555a..1bf6eb1a 100644 --- a/rbi/openai/models/responses/response_item.rbi +++ b/rbi/openai/models/responses/response_item.rbi @@ -754,6 +754,12 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + sig { returns(T.nilable(String)) } + attr_accessor :approval_request_id + # The error from the tool call, if any. sig { returns(T.nilable(String)) } attr_accessor :error @@ -762,6 +768,24 @@ module OpenAI sig { returns(T.nilable(String)) } attr_accessor :output + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + sig do + returns( + T.nilable( + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: OpenAI::Responses::ResponseItem::McpCall::Status::OrSymbol + ).void + end + attr_writer :status + # An invocation of a tool on an MCP server. sig do params( @@ -769,8 +793,11 @@ module OpenAI arguments: String, name: String, server_label: String, + approval_request_id: T.nilable(String), error: T.nilable(String), output: T.nilable(String), + status: + OpenAI::Responses::ResponseItem::McpCall::Status::OrSymbol, type: Symbol ).returns(T.attached_class) end @@ -783,10 +810,17 @@ module OpenAI name:, # The label of the MCP server running the tool. server_label:, + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + approval_request_id: nil, # The error from the tool call, if any. error: nil, # The output from the tool call. output: nil, + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + status: nil, # The type of the item. Always `mcp_call`. type: :mcp_call ) @@ -800,13 +834,64 @@ module OpenAI name: String, server_label: String, type: Symbol, + approval_request_id: T.nilable(String), error: T.nilable(String), - output: T.nilable(String) + output: T.nilable(String), + status: + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol } ) end def to_hash end + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all(Symbol, OpenAI::Responses::ResponseItem::McpCall::Status) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_PROGRESS = + T.let( + :in_progress, + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + CALLING = + T.let( + :calling, + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Responses::ResponseItem::McpCall::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end sig do diff --git a/rbi/openai/models/responses/response_output_item.rbi b/rbi/openai/models/responses/response_output_item.rbi index 1f08b218..8f527828 100644 --- a/rbi/openai/models/responses/response_output_item.rbi +++ b/rbi/openai/models/responses/response_output_item.rbi @@ -370,6 +370,12 @@ module OpenAI sig { returns(Symbol) } attr_accessor :type + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + sig { returns(T.nilable(String)) } + attr_accessor :approval_request_id + # The error from the tool call, if any. sig { returns(T.nilable(String)) } attr_accessor :error @@ -378,6 +384,25 @@ module OpenAI sig { returns(T.nilable(String)) } attr_accessor :output + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + sig do + returns( + T.nilable( + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + ) + end + attr_reader :status + + sig do + params( + status: + OpenAI::Responses::ResponseOutputItem::McpCall::Status::OrSymbol + ).void + end + attr_writer :status + # An invocation of a tool on an MCP server. sig do params( @@ -385,8 +410,11 @@ module OpenAI arguments: String, name: String, server_label: String, + approval_request_id: T.nilable(String), error: T.nilable(String), output: T.nilable(String), + status: + OpenAI::Responses::ResponseOutputItem::McpCall::Status::OrSymbol, type: Symbol ).returns(T.attached_class) end @@ -399,10 +427,17 @@ module OpenAI name:, # The label of the MCP server running the tool. server_label:, + # Unique identifier for the MCP tool call approval request. Include this value in + # a subsequent `mcp_approval_response` input to approve or reject the + # corresponding tool call. + approval_request_id: nil, # The error from the tool call, if any. error: nil, # The output from the tool call. output: nil, + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + status: nil, # The type of the item. Always `mcp_call`. type: :mcp_call ) @@ -416,13 +451,67 @@ module OpenAI name: String, server_label: String, type: Symbol, + approval_request_id: T.nilable(String), error: T.nilable(String), - output: T.nilable(String) + output: T.nilable(String), + status: + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol } ) end def to_hash end + + # The status of the tool call. One of `in_progress`, `completed`, `incomplete`, + # `calling`, or `failed`. + module Status + extend OpenAI::Internal::Type::Enum + + TaggedSymbol = + T.type_alias do + T.all( + Symbol, + OpenAI::Responses::ResponseOutputItem::McpCall::Status + ) + end + OrSymbol = T.type_alias { T.any(Symbol, String) } + + IN_PROGRESS = + T.let( + :in_progress, + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + COMPLETED = + T.let( + :completed, + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + INCOMPLETE = + T.let( + :incomplete, + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + CALLING = + T.let( + :calling, + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + FAILED = + T.let( + :failed, + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ) + + sig do + override.returns( + T::Array[ + OpenAI::Responses::ResponseOutputItem::McpCall::Status::TaggedSymbol + ] + ) + end + def self.values + end + end end class McpListTools < OpenAI::Internal::Type::BaseModel diff --git a/sig/openai/models/conversations/conversation_item.rbs b/sig/openai/models/conversations/conversation_item.rbs index f4c07482..fbdce4fd 100644 --- a/sig/openai/models/conversations/conversation_item.rbs +++ b/sig/openai/models/conversations/conversation_item.rbs @@ -356,8 +356,10 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Conversations::ConversationItem::McpCall::status } class McpCall < OpenAI::Internal::Type::BaseModel @@ -371,17 +373,27 @@ module OpenAI attr_accessor type: :mcp_call + attr_accessor approval_request_id: String? + attr_accessor error: String? attr_accessor output: String? + attr_reader status: OpenAI::Models::Conversations::ConversationItem::McpCall::status? + + def status=: ( + OpenAI::Models::Conversations::ConversationItem::McpCall::status + ) -> OpenAI::Models::Conversations::ConversationItem::McpCall::status + def initialize: ( id: String, arguments: String, name: String, server_label: String, + ?approval_request_id: String?, ?error: String?, ?output: String?, + ?status: OpenAI::Models::Conversations::ConversationItem::McpCall::status, ?type: :mcp_call ) -> void @@ -391,9 +403,26 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Conversations::ConversationItem::McpCall::status } + + type status = + :in_progress | :completed | :incomplete | :calling | :failed + + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS: :in_progress + COMPLETED: :completed + INCOMPLETE: :incomplete + CALLING: :calling + FAILED: :failed + + def self?.values: -> ::Array[OpenAI::Models::Conversations::ConversationItem::McpCall::status] + end end def self?.variants: -> ::Array[OpenAI::Models::Conversations::conversation_item] diff --git a/sig/openai/models/responses/response_input_item.rbs b/sig/openai/models/responses/response_input_item.rbs index 484675bd..d99b7359 100644 --- a/sig/openai/models/responses/response_input_item.rbs +++ b/sig/openai/models/responses/response_input_item.rbs @@ -563,8 +563,10 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseInputItem::McpCall::status } class McpCall < OpenAI::Internal::Type::BaseModel @@ -578,17 +580,27 @@ module OpenAI attr_accessor type: :mcp_call + attr_accessor approval_request_id: String? + attr_accessor error: String? attr_accessor output: String? + attr_reader status: OpenAI::Models::Responses::ResponseInputItem::McpCall::status? + + def status=: ( + OpenAI::Models::Responses::ResponseInputItem::McpCall::status + ) -> OpenAI::Models::Responses::ResponseInputItem::McpCall::status + def initialize: ( id: String, arguments: String, name: String, server_label: String, + ?approval_request_id: String?, ?error: String?, ?output: String?, + ?status: OpenAI::Models::Responses::ResponseInputItem::McpCall::status, ?type: :mcp_call ) -> void @@ -598,9 +610,26 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseInputItem::McpCall::status } + + type status = + :in_progress | :completed | :incomplete | :calling | :failed + + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS: :in_progress + COMPLETED: :completed + INCOMPLETE: :incomplete + CALLING: :calling + FAILED: :failed + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseInputItem::McpCall::status] + end end type item_reference = diff --git a/sig/openai/models/responses/response_item.rbs b/sig/openai/models/responses/response_item.rbs index f8f79e06..9a154b36 100644 --- a/sig/openai/models/responses/response_item.rbs +++ b/sig/openai/models/responses/response_item.rbs @@ -352,8 +352,10 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseItem::McpCall::status } class McpCall < OpenAI::Internal::Type::BaseModel @@ -367,17 +369,27 @@ module OpenAI attr_accessor type: :mcp_call + attr_accessor approval_request_id: String? + attr_accessor error: String? attr_accessor output: String? + attr_reader status: OpenAI::Models::Responses::ResponseItem::McpCall::status? + + def status=: ( + OpenAI::Models::Responses::ResponseItem::McpCall::status + ) -> OpenAI::Models::Responses::ResponseItem::McpCall::status + def initialize: ( id: String, arguments: String, name: String, server_label: String, + ?approval_request_id: String?, ?error: String?, ?output: String?, + ?status: OpenAI::Models::Responses::ResponseItem::McpCall::status, ?type: :mcp_call ) -> void @@ -387,9 +399,26 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseItem::McpCall::status } + + type status = + :in_progress | :completed | :incomplete | :calling | :failed + + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS: :in_progress + COMPLETED: :completed + INCOMPLETE: :incomplete + CALLING: :calling + FAILED: :failed + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseItem::McpCall::status] + end end def self?.variants: -> ::Array[OpenAI::Models::Responses::response_item] diff --git a/sig/openai/models/responses/response_output_item.rbs b/sig/openai/models/responses/response_output_item.rbs index 13b7bedc..3c3a2838 100644 --- a/sig/openai/models/responses/response_output_item.rbs +++ b/sig/openai/models/responses/response_output_item.rbs @@ -162,8 +162,10 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseOutputItem::McpCall::status } class McpCall < OpenAI::Internal::Type::BaseModel @@ -177,17 +179,27 @@ module OpenAI attr_accessor type: :mcp_call + attr_accessor approval_request_id: String? + attr_accessor error: String? attr_accessor output: String? + attr_reader status: OpenAI::Models::Responses::ResponseOutputItem::McpCall::status? + + def status=: ( + OpenAI::Models::Responses::ResponseOutputItem::McpCall::status + ) -> OpenAI::Models::Responses::ResponseOutputItem::McpCall::status + def initialize: ( id: String, arguments: String, name: String, server_label: String, + ?approval_request_id: String?, ?error: String?, ?output: String?, + ?status: OpenAI::Models::Responses::ResponseOutputItem::McpCall::status, ?type: :mcp_call ) -> void @@ -197,9 +209,26 @@ module OpenAI name: String, server_label: String, type: :mcp_call, + approval_request_id: String?, error: String?, - output: String? + output: String?, + status: OpenAI::Models::Responses::ResponseOutputItem::McpCall::status } + + type status = + :in_progress | :completed | :incomplete | :calling | :failed + + module Status + extend OpenAI::Internal::Type::Enum + + IN_PROGRESS: :in_progress + COMPLETED: :completed + INCOMPLETE: :incomplete + CALLING: :calling + FAILED: :failed + + def self?.values: -> ::Array[OpenAI::Models::Responses::ResponseOutputItem::McpCall::status] + end end type mcp_list_tools = diff --git a/test/openai/resources/conversations/items_test.rb b/test/openai/resources/conversations/items_test.rb index 9bc1c90a..35270acb 100644 --- a/test/openai/resources/conversations/items_test.rb +++ b/test/openai/resources/conversations/items_test.rb @@ -156,8 +156,10 @@ def test_retrieve_required_params arguments: String, name: String, server_label: String, + approval_request_id: String | nil, error: String | nil, - output: String | nil + output: String | nil, + status: OpenAI::Conversations::ConversationItem::McpCall::Status | nil } in {type: :custom_tool_call, call_id: String, input: String, name: String, id: String | nil} in { @@ -308,8 +310,10 @@ def test_list arguments: String, name: String, server_label: String, + approval_request_id: String | nil, error: String | nil, - output: String | nil + output: String | nil, + status: OpenAI::Conversations::ConversationItem::McpCall::Status | nil } in {type: :custom_tool_call, call_id: String, input: String, name: String, id: String | nil} in { diff --git a/test/openai/resources/responses/input_items_test.rb b/test/openai/resources/responses/input_items_test.rb index 9341c54c..de0e1377 100644 --- a/test/openai/resources/responses/input_items_test.rb +++ b/test/openai/resources/responses/input_items_test.rb @@ -138,8 +138,10 @@ def test_list arguments: String, name: String, server_label: String, + approval_request_id: String | nil, error: String | nil, - output: String | nil + output: String | nil, + status: OpenAI::Responses::ResponseItem::McpCall::Status | nil } end end