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.7.1'
Class Method Summary collapse
-
.build_client(model:, type:, vendor: nil, params: {}) ⇒ Object
Main entry point for creating LLM clients.
- .configuration ⇒ Object
- .configure {|configuration| ... } ⇒ Object
-
.generate(model: nil, prompt: nil, type: nil, data: nil, vendor: nil, params: {}) ⇒ Object
Unified generate method supporting both simple prompts and legacy template-based generation.
Class Method Details
.build_client(model:, type:, vendor: nil, params: {}) ⇒ 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, params: {}) ClientFactory.build(model:, type:, vendor:, params:) end |
.configuration ⇒ Object
185 186 187 |
# File 'lib/llm_conductor/configuration.rb', line 185 def self.configuration @configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
189 190 191 |
# File 'lib/llm_conductor/configuration.rb', line 189 def self.configure yield(configuration) end |
.generate(model: nil, prompt: nil, type: nil, data: nil, vendor: nil, params: {}) ⇒ 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, params: {}) if prompt && !type && !data generate_simple_prompt(model:, prompt:, vendor:, params:) elsif type && data && !prompt generate_with_template(model:, type:, data:, vendor:, params:) else raise ArgumentError, "Invalid arguments. Use either: generate(prompt: 'text') or generate(type: :custom, data: {...})" end end |