-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
System Info
The agent.chat() method fails to fully reset the session state, leading to the previously executed code (last_code_generated) persisting in the new prompt. This contradicts the "clean start" expected from the chat() method. when i call the method clear memorty, it dose not delete everythin, because these method never delete their value: @Property
def last_generated_code(self):
return self._state.last_code_generated
@property
def last_code_executed(self):
return self._state.last_code_generated
@property
def last_prompt_used(self):
return self._state.last_prompt_used
🐛 Describe the bug
def clear_memory(self):
"""
Clears the memory
"""
self._state.memory.clear()
it should be like this:
def start_new_conversation(self):
self.clear_memory()
# Add explicit code context reset:
if hasattr(self._state, 'last_code_generated'):
self._state.last_code_generated = None
if hasattr(self._state, 'last_prompt_used'):
self._state.last_prompt_used = None
Metadata
Metadata
Assignees
Labels
No labels