Module: LlmConductor

Defined in:
lib/llm_conductor.rb,
lib/llm_conductor/prompts.rb,
lib/llm_conductor/version.rb,
lib/llm_conductor/response.rb,
lib/llm_conductor/data_builder.rb,
lib/llm_conductor/configuration.rb,
lib/llm_conductor/client_factory.rb,
lib/llm_conductor/prompt_manager.rb,
lib/llm_conductor/clients/gpt_client.rb,
lib/llm_conductor/clients/zai_client.rb,
lib/llm_conductor/clients/base_client.rb,
lib/llm_conductor/clients/groq_client.rb,
lib/llm_conductor/prompts/base_prompt.rb,
lib/llm_conductor/clients/gemini_client.rb,
lib/llm_conductor/clients/ollama_client.rb,
lib/llm_conductor/clients/anthropic_client.rb,
lib/llm_conductor/clients/openrouter_client.rb,
lib/llm_conductor/clients/concerns/vision_support.rb

Overview

LLM Conductor provides a unified interface for multiple Language Model providers

Defined Under Namespace

Modules: Clients, Prompts Classes: ClientFactory, Configuration, DataBuilder, Error, PromptManager, Response

Constant Summary collapse

SUPPORTED_VENDORS =

List of supported vendors

i[anthropic openai openrouter ollama gemini groq zai].freeze
SUPPORTED_PROMPT_TYPES =

List of supported prompt types

i[
  extract_links
  analyze_content
  summarize_text
  classify_content
  custom
].freeze
VERSION =
'1.4.0'

Class Method Summary collapse

Class Method Details

.build_client(model:, type:, vendor: nil) ⇒ Object

Main entry point for creating LLM clients



27
28
29
# File 'lib/llm_conductor.rb', line 27

def self.build_client(model:, type:, vendor: nil)
  ClientFactory.build(model:, type:, vendor:)
end

.configurationObject



159
160
161
# File 'lib/llm_conductor/configuration.rb', line 159

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



163
164
165
# File 'lib/llm_conductor/configuration.rb', line 163

def self.configure
  yield(configuration)
end

.generate(model: nil, prompt: nil, type: nil, data: nil, vendor: nil) ⇒ Object

Unified generate method supporting both simple prompts and legacy template-based generation



32
33
34
35
36
37
38
39
40
41
# File 'lib/llm_conductor.rb', line 32

def self.generate(model: nil, prompt: nil, type: nil, data: nil, vendor: nil)
  if prompt && !type && !data
    generate_simple_prompt(model:, prompt:, vendor:)
  elsif type && data && !prompt
    generate_with_template(model:, type:, data:, vendor:)
  else
    raise ArgumentError,
          "Invalid arguments. Use either: generate(prompt: 'text') or generate(type: :custom, data: {...})"
  end
end