Class: Regent::LLM::Base
- Inherits:
-
Object
- Object
- Regent::LLM::Base
- Includes:
- Concerns::Dependable
- Defined in:
- lib/regent/llm/base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(model:, api_key: nil, **options) ⇒ Base
constructor
A new instance of Base.
- #parse_error(error) ⇒ Object
Methods included from Concerns::Dependable
Constructor Details
#initialize(model:, api_key: nil, **options) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 16 |
# File 'lib/regent/llm/base.rb', line 10 def initialize(model:, api_key: nil, **) @model = model @api_key = api_key || api_key_from_env = super() end |
Instance Method Details
#parse_error(error) ⇒ Object
18 19 20 |
# File 'lib/regent/llm/base.rb', line 18 def parse_error(error) error.response.dig(:body, "error", "message") end |