From 7411d223e7b8b88158ac224fca6b395d5a8b2bf5 Mon Sep 17 00:00:00 2001 From: evelynmitchell Date: Wed, 10 Jul 2024 20:11:17 -0600 Subject: [PATCH] Update agent.py initialize out To fix the local variable 'out' reference before assigment in running the Agent + LongTerm Memory error: ``` 2024-07-11T02:00:55.457112+0000 Couting tokens of retrieved document 2024-07-11T02:00:55.459163+0000 Retrieved document token count 1 2024-07-11T02:00:55.460820+0000 Error querying long term memory: local variable 'out' referenced before assignment 2024-07-11T02:00:55.461227+0000 Attempt 1: Error generating response: local variable 'out' referenced before assignment ``` --- swarms/structs/agent.py | 1 + 1 file changed, 1 insertion(+) diff --git a/swarms/structs/agent.py b/swarms/structs/agent.py index 7204679f..2c270a96 100644 --- a/swarms/structs/agent.py +++ b/swarms/structs/agent.py @@ -957,6 +957,7 @@ class Agent(BaseStructure): Returns: str: The agent history prompt """ + out = "" try: logger.info(f"Querying long term memory database for {query}") ltr = self.long_term_memory.query(query, *args, **kwargs)