start implementation on new architecture

This commit is contained in:
2024-11-01 09:56:30 +01:00
parent ee089e5be7
commit 2c1e134c6e
43 changed files with 2978 additions and 619 deletions

30
sia/stop_command.py Normal file
View File

@@ -0,0 +1,30 @@
from .command import Command
from .command_result import CommandResult
from .working_memory import WorkingMemory
class StopCommand(Command):
"""
Command to stop the agent.
Performs cleanup on all entries and clears working memory.
"""
def execute(self, memory: WorkingMemory) -> CommandResult:
"""
Signal that the agent should stop.
Cleans up all entries and clears the working memory.
Args:
memory: WorkingMemory instance to clear
Returns:
CommandResult: Stop result
"""
# Get a copy of entries to iterate over
entries = memory.get_entries()
# Clean up each entry individually
for entry in entries:
entry.cleanup()
memory.remove_entry(entry.id)
return CommandResult.stop()