Class: RSmolagent::FinalAnswerTool

Inherits:
Tool
  • Object
show all
Defined in:
lib/rsmolagent/tool.rb

Instance Attribute Summary

Attributes inherited from Tool

#description, #input_schema, #name

Instance Method Summary collapse

Methods inherited from Tool

#call, #to_json_schema

Constructor Details

#initializeFinalAnswerTool

Returns a new instance of FinalAnswerTool.



56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/rsmolagent/tool.rb', line 56

def initialize
  super(
    name: "final_answer",
    description: "Use this to provide the final answer to the task",
    input_schema: {
      answer: {
        type: "string",
        description: "The final answer to the task"
      }
    }
  )
end

Instance Method Details

#execute(args) ⇒ Object



69
70
71
# File 'lib/rsmolagent/tool.rb', line 69

def execute(args)
  args[:answer].to_s
end