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)
| 110 | return "Max steps reached" |
| 111 | |
| 112 | def step(self, task: str | None = None) -> StepResult: |
| 113 | """ |
| 114 | Execute a single step of the agent. |
| 115 | |
| 116 | Useful for manual control or debugging. |
| 117 | |
| 118 | Args: |
| 119 | task: Task description (only needed for first step). |
| 120 | |
| 121 | Returns: |
| 122 | StepResult with step details. |
| 123 | """ |
| 124 | is_first = len(self._context) == 0 |
| 125 | |
| 126 | if is_first and not task: |
| 127 | raise ValueError("Task is required for the first step") |
| 128 | |
| 129 | return self._execute_step(task, is_first) |
| 130 | |
| 131 | def reset(self) -> None: |
| 132 | """Reset the agent state for a new task.""" |
no test coverage detected