Class: OpenAI::Models::Realtime::RealtimeMcpToolCall

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/realtime/realtime_mcp_tool_call.rb,
sig/openai/models/realtime/realtime_mcp_tool_call.rbs

Defined Under Namespace

Modules: Error

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, arguments:, name:, server_label:, approval_request_id: nil, error: nil, output: nil, type: :mcp_call) ⇒ RealtimeMcpToolCall

Returns a new instance of RealtimeMcpToolCall.

Parameters:

  • id —

    The unique ID of the tool call.

  • arguments —

    A JSON string of the arguments passed to the tool.

  • name —

    The name of the tool that was run.

  • server_label —

    The label of the MCP server running the tool.

  • approval_request_id (defaults to: nil) —

    The ID of an associated approval request, if any.

  • error (defaults to: nil) —

    The error from the tool call, if any.

  • output (defaults to: nil) —

    The output from the tool call.

  • type (defaults to: :mcp_call) —

    The type of the item. Always mcp_call.

  • id: (String)
  • arguments: (String)
  • name: (String)
  • server_label: (String)
  • approval_request_id: (String, nil) (defaults to: nil)
  • error: (OpenAI::Models::Realtime::RealtimeMcpToolCall::error, nil) (defaults to: nil)
  • output: (String, nil) (defaults to: nil)
  • type: (:mcp_call) (defaults to: :mcp_call)


# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 55

Instance Attribute Details

#approval_request_id ⇒ String?

The ID of an associated approval request, if any.

Returns:

  • (String, nil)


41
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 41

optional :approval_request_id, String, nil?: true

#arguments ⇒ String

A JSON string of the arguments passed to the tool.

Returns:

  • (String)


17
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 17

required :arguments, String

#error ⇒ OpenAI::Models::Realtime::RealtimeMcpToolCall::error?

The error from the tool call, if any.

Returns:

  • (OpenAI::Models::Realtime::RealtimeMcpToolCall::error, nil)


47
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 47

optional :error, union: -> { OpenAI::Realtime::RealtimeMcpToolCall::Error }, nil?: true

#id ⇒ String

The unique ID of the tool call.

Returns:

  • (String)


11
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 11

required :id, String

#name ⇒ String

The name of the tool that was run.

Returns:

  • (String)


23
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 23

required :name, String

#output ⇒ String?

The output from the tool call.

Returns:

  • (String, nil)


53
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 53

optional :output, String, nil?: true

#server_label ⇒ String

The label of the MCP server running the tool.

Returns:

  • (String)


29
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 29

required :server_label, String

#type ⇒ :mcp_call

The type of the item. Always mcp_call.

Returns:

  • (:mcp_call)


35
# File 'lib/openai/models/realtime/realtime_mcp_tool_call.rb', line 35

required :type, const: :mcp_call

Instance Method Details

#to_hash ⇒ { id: String, arguments: String, name: String, server_label: String, ?type: :mcp_call, ?approval_request_id: String?, ?error: OpenAI::Models::Realtime::RealtimeMcpToolCall::error?, ?output: String? }

Returns:

  • ({ id: String, arguments: String, name: String, server_label: String, ?type: :mcp_call, ?approval_request_id: String?, ?error: OpenAI::Models::Realtime::RealtimeMcpToolCall::error?, ?output: String? })


68
69
70
71
72
73
74
75
76
77
# File 'sig/openai/models/realtime/realtime_mcp_tool_call.rbs', line 68

def to_hash: -> {
  id: String,
  arguments: String,
  name: String,
  server_label: String,
  ?type: :mcp_call,
  ?approval_request_id: String?,
  ?error: OpenAI::Models::Realtime::RealtimeMcpToolCall::error?,
  ?output: String?
}