Module: EasyTalk::Extensions::RubyLLMToolOverrides
- Defined in:
- lib/easy_talk/extensions/ruby_llm_compatibility.rb
Overview
Overrides for classes that inherit from RubyLLM::Tool. Only overrides schema-related methods, allowing all other RubyLLM::Tool functionality (halt, call, etc.) to work normally.
Usage: class WeatherTool < RubyLLM::Tool include EasyTalk::Model
define_schema do
description 'Gets current weather'
property :latitude, String
property :longitude, String
end
def execute(latitude:, longitude:)
# Can use halt() since we inherit from RubyLLM::Tool
halt "Weather at #{latitude}, #{longitude}"
end
end
Instance Method Summary collapse
-
#description ⇒ String
Override to use EasyTalk's schema description.
-
#params_schema ⇒ Hash
Override to use EasyTalk's JSON schema for parameters.
Instance Method Details
#description ⇒ String
Override to use EasyTalk's schema description.
45 46 47 48 |
# File 'lib/easy_talk/extensions/ruby_llm_compatibility.rb', line 45 def description schema_def = self.class.schema_definition schema_def.schema[:description] || "Tool: #{self.class.name}" end |
#params_schema ⇒ Hash
Override to use EasyTalk's JSON schema for parameters.
53 54 55 |
# File 'lib/easy_talk/extensions/ruby_llm_compatibility.rb', line 53 def params_schema self.class.json_schema end |