Spaces:
Running
Running
| class AgentState: | |
| def __init__(self): | |
| self.states = {} | |
| def get_latest_state(self, project_name: str): | |
| return self.states.get(project_name, None) | |
| def is_agent_completed(self, project_name: str): | |
| state = self.get_latest_state(project_name) | |
| return state.get("completed", True) if state else True | |
| def is_agent_active(self, project_name: str): | |
| state = self.get_latest_state(project_name) | |
| return state.get("agent_is_active", False) if state else False |