Class: Silas::Engines::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/silas/engines/base.rb

Overview

The inference seam. An engine executes exactly ONE model call for a step and reports what came back; the framework owns the loop, the ledger owns tool execution.

Direct Known Subclasses

AgentSdk, RubyLLM, Silas::Eval::ScriptedEngine

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loop_ownershipObject

:framework — Silas's AgentLoopJob drives the loop (ruby_llm). :engine — the engine drives its own loop (agent_sdk, future).



15
# File 'lib/silas/engines/base.rb', line 15

def self.loop_ownership = :framework

Instance Method Details

#execute_step(context, &on_event) ⇒ Object

context: { turn:, index:, system:, messages:, tools:, model:, limits: } Yields Silas::Event objects as they stream; returns a Result.

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/silas/engines/base.rb', line 19

def execute_step(context, &on_event)
  raise NotImplementedError, "#{self.class} must implement #execute_step"
end