Class: Llm::Agent::Rails::Store::Memory
- Inherits:
-
Object
- Object
- Llm::Agent::Rails::Store::Memory
- Defined in:
- lib/llm/agent/rails/store/memory.rb
Instance Method Summary collapse
- #fetch_tool_messages(thread_id) ⇒ Object
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #push_tool_message(thread_id, msg) ⇒ Object
Constructor Details
#initialize ⇒ Memory
7 8 9 |
# File 'lib/llm/agent/rails/store/memory.rb', line 7 def initialize @tool_msgs_by_thread = Hash.new { |h,k| h[k] = [] } end |
Instance Method Details
#fetch_tool_messages(thread_id) ⇒ Object
10 |
# File 'lib/llm/agent/rails/store/memory.rb', line 10 def (thread_id) = @tool_msgs_by_thread[thread_id] |
#push_tool_message(thread_id, msg) ⇒ Object
11 |
# File 'lib/llm/agent/rails/store/memory.rb', line 11 def (thread_id, msg) = @tool_msgs_by_thread[thread_id] << msg |