Class: Legion::LLM::Patches::ToolResultWrapper

Inherits:
Struct
  • Object
show all
Defined in:
lib/legion/llm/patches/ruby_llm_parallel_tools.rb

Overview

Wraps a raw tool result value so that the bridge-script’s serialize_tool_result can read both :tool_call_id/:id (for UI matching) and :result/:content (for the result payload) off a single object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



38
39
40
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 38

def content
  @content
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



38
39
40
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 38

def id
  @id
end

#resultObject

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



38
39
40
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 38

def result
  @result
end

#tool_call_idObject

Returns the value of attribute tool_call_id

Returns:

  • (Object)

    the current value of tool_call_id



38
39
40
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 38

def tool_call_id
  @tool_call_id
end

#tool_nameObject

Returns the value of attribute tool_name

Returns:

  • (Object)

    the current value of tool_name



38
39
40
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 38

def tool_name
  @tool_name
end

Instance Method Details

#is_a?(klass) ⇒ Boolean Also known as: kind_of?

Delegate is_a? checks for RubyLLM::Tool::Halt so the caller can still detect halt results transparently.

Returns:

  • (Boolean)


41
42
43
# File 'lib/legion/llm/patches/ruby_llm_parallel_tools.rb', line 41

def is_a?(klass)
  result.is_a?(klass) || super
end