Class: Silas::Adapters::RubyLLM::SchemaProxy

Inherits:
RubyLLM::Tool
  • Object
show all
Defined in:
lib/silas/adapters/ruby_llm.rb

Overview

Carries a Silas tool's schema to the provider. Subclasses RubyLLM::Tool so it satisfies whatever the provider tool-renderers read (today: name, description, params_schema, parameters, provider_params) without Silas having to track that list.

It has no #execute on purpose. Nothing calls it — the ledger owns tool execution — and RubyLLM::Tool#execute raises NotImplementedError, so if anything ever did, it fails loudly instead of feeding the model a sentinel.

Instance Method Summary collapse

Constructor Details

#initialize(definition) ⇒ SchemaProxy

Returns a new instance of SchemaProxy.



203
204
205
206
# File 'lib/silas/adapters/ruby_llm.rb', line 203

def initialize(definition)
  super()
  @definition = definition
end

Instance Method Details

#descriptionObject



209
# File 'lib/silas/adapters/ruby_llm.rb', line 209

def description = @definition["description"]

#nameObject



208
# File 'lib/silas/adapters/ruby_llm.rb', line 208

def name = @definition["name"]

#parameters_schemaObject



217
# File 'lib/silas/adapters/ruby_llm.rb', line 217

def parameters_schema = @definition["input_schema"]

#params_schemaObject

RubyLLM 1.x reads params_schema; 2.0 renames it parameters_schema (alongside parameters -> declared_parameters and provider_params -> provider_options, which we inherit rather than override). Answering to both is two lines and makes the proxy version-agnostic — confirmed against ruby_llm edge by the CI canary.



216
# File 'lib/silas/adapters/ruby_llm.rb', line 216

def params_schema = @definition["input_schema"]