start implementation on new architecture
This commit is contained in:
35
sia/command_result.py
Normal file
35
sia/command_result.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
@dataclass
|
||||
class CommandResult:
|
||||
"""
|
||||
Result of a command execution.
|
||||
|
||||
Attributes:
|
||||
message: Optional message describing the result
|
||||
success: Whether the command executed successfully
|
||||
should_stop: Whether the agent should stop after this command
|
||||
"""
|
||||
message: str
|
||||
success: bool = True
|
||||
should_stop: bool = False
|
||||
|
||||
@staticmethod
|
||||
def success() -> 'CommandResult':
|
||||
"""Create a successful command result."""
|
||||
return CommandResult(message="", success=True, should_stop=False)
|
||||
|
||||
@staticmethod
|
||||
def failure(message: str) -> 'CommandResult':
|
||||
"""
|
||||
Create a failed command result.
|
||||
|
||||
Args:
|
||||
message: Description of the failure
|
||||
"""
|
||||
return CommandResult(message=message, success=False, should_stop=False)
|
||||
|
||||
@staticmethod
|
||||
def stop() -> 'CommandResult':
|
||||
"""Create a command result indicating the agent should stop."""
|
||||
return CommandResult(message="", success=True, should_stop=True)
|
||||
Reference in New Issue
Block a user