From 3631caa88358ee1e6ec3b1acf0fd35a6254f7f62 Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Wed, 6 Aug 2025 10:27:59 -0400 Subject: [PATCH] Changed keypress to cast strings to lists --- libs/python/agent/agent/computer_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/python/agent/agent/computer_handler.py b/libs/python/agent/agent/computer_handler.py index 1cf3c4d2..7425f59e 100644 --- a/libs/python/agent/agent/computer_handler.py +++ b/libs/python/agent/agent/computer_handler.py @@ -3,7 +3,7 @@ Computer handler implementation for OpenAI computer-use-preview protocol. """ import base64 -from typing import Dict, List, Any, Literal +from typing import Dict, List, Any, Literal, Union from .types import Computer @@ -61,8 +61,10 @@ class OpenAIComputerHandler: """Move cursor to coordinates.""" await self.interface.move_cursor(x, y) - async def keypress(self, keys: List[str]) -> None: + async def keypress(self, keys: Union[List[str], str]) -> None: """Press key combination.""" + if isinstance(keys, str): + keys = [keys] if len(keys) == 1: await self.interface.press_key(keys[0]) else: