Module: RubyPi::LLM
- Defined in:
- lib/ruby_pi.rb,
lib/ruby_pi/llm/model.rb,
lib/ruby_pi/llm/gemini.rb,
lib/ruby_pi/llm/openai.rb,
lib/ruby_pi/llm/fallback.rb,
lib/ruby_pi/llm/response.rb,
lib/ruby_pi/llm/anthropic.rb,
lib/ruby_pi/llm/tool_call.rb,
lib/ruby_pi/llm/stream_event.rb,
lib/ruby_pi/llm/base_provider.rb
Overview
Namespace for large language model providers and related abstractions.
Defined Under Namespace
Classes: Anthropic, BaseProvider, Fallback, Gemini, Model, OpenAI, Response, StreamEvent, ToolCall
Class Method Summary collapse
-
.model(provider, name, **options) ⇒ RubyPi::LLM::BaseProvider
Factory method for constructing a provider instance from a provider name and model identifier.
Class Method Details
.model(provider, name, **options) ⇒ RubyPi::LLM::BaseProvider
Factory method for constructing a provider instance from a provider name and model identifier.
98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ruby_pi.rb', line 98 def model(provider, name, **) case provider.to_sym when :gemini Gemini.new(model: name, **) when :anthropic Anthropic.new(model: name, **) when :openai OpenAI.new(model: name, **) else raise ArgumentError, "Unsupported provider: #{provider}" end end |