Class: Luo::LLMFunc::Cain
- Inherits:
-
Object
- Object
- Luo::LLMFunc::Cain
- Includes:
- Dry::Configurable
- Defined in:
- lib/luo/llm_func/cain.rb
Instance Method Summary collapse
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/luo/llm_func/cain.rb', line 14 def call(env) temperature = env.fetch(:temperature, nil) history = env.fetch(:history, nil) = Messages.create(history: history).user(prompt: config.prompt, context: env.to_h) if config.system = .system(text: config.system) end output = config.adapter.call(, temperature || config.temperature) env.set(:output, output) end |