|
21 | 21 | from askui.models.shared.agent_message_param import MessageParam |
22 | 22 | from askui.models.shared.agent_on_message_cb import OnMessageCb |
23 | 23 | from askui.models.shared.settings import ActSettings |
24 | | -from askui.models.shared.tools import ToolCollection |
| 24 | +from askui.models.shared.tools import Tool, ToolCollection |
25 | 25 | from askui.models.types.response_schemas import ResponseSchema |
26 | 26 | from askui.reporting import Reporter |
| 27 | +from askui.tools.computer import Computer20241022Tool |
27 | 28 | from askui.utils.image_utils import ImageSource, image_to_base64 |
28 | 29 | from askui.utils.pdf_utils import PdfSource |
29 | 30 | from askui.utils.source_utils import Source |
@@ -228,11 +229,11 @@ def act( |
228 | 229 | raise ValueError(error_msg) # noqa: TRY004 |
229 | 230 |
|
230 | 231 | # Find the computer tool |
231 | | - computer_tool = None |
| 232 | + computer_tool: Computer20241022Tool | None = None |
232 | 233 | if tools: |
233 | 234 | for tool in tools: |
234 | 235 | if tool.name == "computer": |
235 | | - computer_tool = tool |
| 236 | + computer_tool: Computer20241022Tool = tool |
236 | 237 | break |
237 | 238 |
|
238 | 239 | if computer_tool is None: |
@@ -260,7 +261,7 @@ def act( |
260 | 261 | self.execute_act(self.act_history, computer_tool) |
261 | 262 |
|
262 | 263 | def add_screenshot_to_history( |
263 | | - self, message_history: list[dict[str, Any]], computer_tool: Tool |
| 264 | + self, message_history: list[dict[str, Any]], computer_tool: Computer20241022Tool |
264 | 265 | ) -> None: |
265 | 266 | screenshot = computer_tool(action="screenshot") |
266 | 267 | message_history.append( |
|
0 commit comments