Class: Gemlings::RubyLLMAgentWrapper
- Inherits:
-
Object
- Object
- Gemlings::RubyLLMAgentWrapper
- Defined in:
- lib/gemlings/ruby_llm.rb
Overview
Minimal agent-like wrapper around a RubyLLM::Chat so it can be used with Gemlings::ManagedAgentTool.
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(chat, name:, description:) ⇒ RubyLLMAgentWrapper
constructor
A new instance of RubyLLMAgentWrapper.
- #run(task) ⇒ Object
Constructor Details
#initialize(chat, name:, description:) ⇒ RubyLLMAgentWrapper
Returns a new instance of RubyLLMAgentWrapper.
60 61 62 63 64 |
# File 'lib/gemlings/ruby_llm.rb', line 60 def initialize(chat, name:, description:) @chat = chat @name = name @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
58 59 60 |
# File 'lib/gemlings/ruby_llm.rb', line 58 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
58 59 60 |
# File 'lib/gemlings/ruby_llm.rb', line 58 def name @name end |
Instance Method Details
#run(task) ⇒ Object
66 67 68 69 |
# File 'lib/gemlings/ruby_llm.rb', line 66 def run(task) response = @chat.ask(task) response.content end |