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/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
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].freeze
- SUPPORTED_PROMPT_TYPES =
List of supported prompt types
%i[ extract_links analyze_content summarize_text classify_content custom ].freeze
- VERSION =
'1.1.2'
Class Method Summary collapse
-
.build_client(model:, type:, vendor: nil) ⇒ Object
Main entry point for creating LLM clients.
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
-
.generate(model: nil, prompt: nil, type: nil, data: nil, vendor: nil) ⇒ Object
Unified generate method supporting both simple prompts and legacy template-based generation.
Class Method Details
.build_client(model:, type:, vendor: nil) ⇒ Object
Main entry point for creating LLM clients
26 27 28 |
# File 'lib/llm_conductor.rb', line 26 def self.build_client(model:, type:, vendor: nil) ClientFactory.build(model:, type:, vendor:) end |
.configuration ⇒ Object
142 143 144 |
# File 'lib/llm_conductor/configuration.rb', line 142 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
146 147 148 |
# File 'lib/llm_conductor/configuration.rb', line 146 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
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/llm_conductor.rb', line 31 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 |