Module: EasyTalk::Extensions::RubyLLMCompatibility

Defined in:
lib/easy_talk/extensions/ruby_llm_compatibility.rb

Overview

Class methods for RubyLLM compatibility. These are added to the model class via extend.

Instance Method Summary collapse

Instance Method Details

#to_json_schemaHash

Returns a Hash representing the schema in a format compatible with RubyLLM. RubyLLM expects an object that responds to #to_json_schema and returns a hash with :name, :description, and :schema keys.

Returns:

  • (Hash)

    The RubyLLM-compatible schema representation



13
14
15
16
17
18
19
# File 'lib/easy_talk/extensions/ruby_llm_compatibility.rb', line 13

def to_json_schema
  {
    name: name,
    description: schema_definition.schema[:description] || "Schema for #{name}",
    schema: json_schema
  }
end