Class: Silas::Adapters::RubyLLM::SchemaProxy
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- Silas::Adapters::RubyLLM::SchemaProxy
- 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
- #description ⇒ Object
-
#initialize(definition) ⇒ SchemaProxy
constructor
A new instance of SchemaProxy.
- #name ⇒ Object
- #parameters_schema ⇒ Object
-
#params_schema ⇒ Object
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).
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
#description ⇒ Object
209 |
# File 'lib/silas/adapters/ruby_llm.rb', line 209 def description = @definition["description"] |
#name ⇒ Object
208 |
# File 'lib/silas/adapters/ruby_llm.rb', line 208 def name = @definition["name"] |
#parameters_schema ⇒ Object
217 |
# File 'lib/silas/adapters/ruby_llm.rb', line 217 def parameters_schema = @definition["input_schema"] |
#params_schema ⇒ Object
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"] |