Class: Crimson::Client::Base Abstract
- Inherits:
-
Object
- Object
- Crimson::Client::Base
- Defined in:
- lib/crimson/client/base.rb
Overview
This class is abstract.
Subclasses must implement #chat.
Abstract base class for LLM API client adapters.
Direct Known Subclasses
Instance Method Summary collapse
-
#chat(messages:, tools: []) {|text_chunk, tool_event| ... } ⇒ Array(Message::Assistant, Hash, nil)
Send a chat request and return the assistant response.
-
#initialize(config) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(config) ⇒ Base
Returns a new instance of Base.
9 10 11 |
# File 'lib/crimson/client/base.rb', line 9 def initialize(config) @config = config end |
Instance Method Details
#chat(messages:, tools: []) {|text_chunk, tool_event| ... } ⇒ Array(Message::Assistant, Hash, nil)
Send a chat request and return the assistant response.
20 21 22 |
# File 'lib/crimson/client/base.rb', line 20 def chat(messages:, tools: [], &stream_callback) raise NotImplementedError, "#{self.class}#chat must be implemented" end |