Class: Girb::Providers::Base
- Inherits:
-
Object
- Object
- Girb::Providers::Base
- Defined in:
- lib/girb/providers/base.rb
Overview
Base class for LLM providers Implement this class to add support for new LLM providers
Example:
class MyProvider < Girb::Providers::Base
def chat(messages:, system_prompt:, tools:)
# Call your LLM API
# Return Response object
end
end
Girb.configure do |c|
c.provider = MyProvider.new(api_key: "...")
end
Defined Under Namespace
Classes: Response
Instance Method Summary collapse
-
#chat(messages:, system_prompt:, tools:, binding: nil) ⇒ Response
Send a chat request to the LLM.
Instance Method Details
#chat(messages:, system_prompt:, tools:, binding: nil) ⇒ Response
Send a chat request to the LLM
29 30 31 |
# File 'lib/girb/providers/base.rb', line 29 def chat(messages:, system_prompt:, tools:, binding: nil) raise NotImplementedError, "#{self.class}#chat must be implemented" end |