Class: Nukitori::ChatFactory
- Inherits:
-
Object
- Object
- Nukitori::ChatFactory
- Defined in:
- lib/nukitori/chat_factory.rb
Class Method Summary collapse
Class Method Details
.create(model: nil) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/nukitori/chat_factory.rb', line 6 def create(model: nil) = {} [:model] = model if model begin RubyLLM.chat(**) rescue RubyLLM::ModelNotFoundError # If custom OpenAI-compatible API is configured, add required options if custom_openai_api? [:provider] = :openai [:assume_model_exists] = true end RubyLLM.chat(**) end end |