Class: Charai::Agent
- Inherits:
-
Object
- Object
- Charai::Agent
- Defined in:
- lib/charai/agent.rb
Defined Under Namespace
Classes: HandleMessageError, Message, Sandbox
Instance Attribute Summary collapse
-
#last_message ⇒ Object
readonly
Returns the value of attribute last_message.
Instance Method Summary collapse
- #<<(text) ⇒ Object
-
#initialize(input_tool:, openai_chat:) ⇒ Agent
constructor
A new instance of Agent.
Constructor Details
#initialize(input_tool:, openai_chat:) ⇒ Agent
Returns a new instance of Agent.
10 11 12 13 14 15 16 |
# File 'lib/charai/agent.rb', line 10 def initialize(input_tool:, openai_chat:) input_tool. do || () end @sandbox = Sandbox.new(input_tool) @openai_chat = openai_chat end |
Instance Attribute Details
#last_message ⇒ Object (readonly)
Returns the value of attribute last_message.
23 24 25 |
# File 'lib/charai/agent.rb', line 23 def end |
Instance Method Details
#<<(text) ⇒ Object
18 19 20 21 |
# File 'lib/charai/agent.rb', line 18 def <<(text) = Message.new(text: text) () end |