fix truncation logic (#125)

This commit is contained in:
Robert Brennan 2024-03-24 18:46:01 -04:00 committed by GitHub
parent 8ce2ac7648
commit a023fcae64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ class Agent:
self.memory = LongTermMemory()
def add_event(self, event):
if 'output' in event.args:
if 'output' in event.args and len(event.args['output']) > MAX_OUTPUT_LENGTH:
event.args['output'] = event.args['output'][:MAX_OUTPUT_LENGTH] + "..."
self.monologue.add_event(event)
self.memory.add_event(event)