Class: Rubino::LLM::AuxiliaryClient

Inherits:
Object
  • Object
show all
Defined in:
lib/rubino/llm/auxiliary_client.rb

Overview

Routes per-task auxiliary LLM calls (vision, compression, approval, …) through AdapterFactory based on the ‘auxiliary.<task>` config block.

Pattern lifted from the reference ‘call_llm(task: …)`: instead of a single “secondary model” slot, each task has its own block with provider/model/base_url/timeout independently overridable. The `provider: “main”` sentinel reuses the primary’s provider so simple setups don’t repeat themselves.

Returns an AdapterResponse — the caller reads ‘.content` for text-only delegations (vision tool) or inspects `.tool_calls` if the aux model itself can use tools (compression doesn’t, but we don’t preclude it).

Instance Method Summary collapse

Constructor Details

#initialize(config: Rubino.configuration) ⇒ AuxiliaryClient

Returns a new instance of AuxiliaryClient.



20
21
22
# File 'lib/rubino/llm/auxiliary_client.rb', line 20

def initialize(config: Rubino.configuration)
  @config = config
end

Instance Method Details

#call(task:, messages:, **opts) ⇒ Object

Raises:

  • (ArgumentError)


24
25
26
27
28
29
30
# File 'lib/rubino/llm/auxiliary_client.rb', line 24

def call(task:, messages:, **opts)
  cfg = @config.auxiliary_config(task)
  raise ArgumentError, "No auxiliary config for task=#{task}" if cfg.empty?

  adapter = build_adapter(cfg)
  adapter.chat(messages: messages, **opts.slice(:tools, :response_format, :image_paths))
end