Execute a single step of the agent. Useful for manual control or debugging. Args: task: Task description (only needed for first step). Returns: StepResult with step details.
(self, task: str | None = None)
| 128 | return "Max steps reached" |
| 129 | |
| 130 | def step(self, task: str | None = None) -> StepResult: |
| 131 | """ |
| 132 | Execute a single step of the agent. |
| 133 | |
| 134 | Useful for manual control or debugging. |
| 135 | |
| 136 | Args: |
| 137 | task: Task description (only needed for first step). |
| 138 | |
| 139 | Returns: |
| 140 | StepResult with step details. |
| 141 | """ |
| 142 | is_first = len(self._context) == 0 |
| 143 | |
| 144 | if is_first and not task: |
| 145 | raise ValueError("Task is required for the first step") |
| 146 | |
| 147 | return self._execute_step(task, is_first) |
| 148 | |
| 149 | def reset(self) -> None: |
| 150 | """Reset the agent state for a new task.""" |
nothing calls this directly
no test coverage detected