Class: RubyLLM::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/providers/base.rb

Overview

Base provider class for LLM interactions

Direct Known Subclasses

Anthropic, OpenAI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
# File 'lib/ruby_llm/providers/base.rb', line 9

def initialize
  @connection = build_connection
end

Instance Attribute Details

#connectionObject (readonly)

Returns the value of attribute connection.



7
8
9
# File 'lib/ruby_llm/providers/base.rb', line 7

def connection
  @connection
end

Instance Method Details

#chat(messages, **options, &block) ⇒ Object

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/ruby_llm/providers/base.rb', line 13

def chat(messages, **options, &block)
  raise NotImplementedError
end