Class: DSPy::Tools::Tool

Inherits:
Object
  • Object
show all
Defined in:
lib/dspy/tools.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, description) ⇒ Tool

Returns a new instance of Tool.



12
13
14
15
# File 'lib/dspy/tools.rb', line 12

def initialize(name, description)
  @name = name
  @description = description
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



10
11
12
# File 'lib/dspy/tools.rb', line 10

def description
  @description
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/dspy/tools.rb', line 10

def name
  @name
end

Instance Method Details

#call(input) ⇒ Object

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/dspy/tools.rb', line 17

def call(input)
  raise NotImplementedError, "Subclasses must implement the call method"
end