Class: FlowEngine::LLM::AutoClient

Inherits:
Client
  • Object
show all
Defined in:
lib/flowengine/llm/auto_client.rb

Overview

Client that picks its adapter from the pre-loaded ADAPTERS registry. Requires load! to have been called first.

Instance Attribute Summary

Attributes inherited from Client

#adapter, #model

Instance Method Summary collapse

Methods inherited from Client

#parse_ai_intake, #parse_introduction, #to_s

Constructor Details

#initialize(qualifier: :default) ⇒ AutoClient

Returns a new instance of AutoClient.

Raises:



10
11
12
13
14
15
16
# File 'lib/flowengine/llm/auto_client.rb', line 10

def initialize(qualifier: :default)
  raise ::FlowEngine::Errors::LLMError, "No adapters loaded. Call FlowEngine::LLM.load! first." if ADAPTERS.empty?

  entry = ADAPTERS.values.first
  adapter = entry[qualifier.to_s]
  super(adapter: adapter, model: adapter.model)
end