Skip to content

Commit d7401bf

Browse files
committed
lint
1 parent 7449033 commit d7401bf

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/agentlab/benchmarks/osworld.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,13 @@ def _add_task_context(self, converted_obs: dict[str, Any], obs: dict[str, Any]):
475475
def convert_agentlab_action_to_computer_13(self, action: str) -> dict[str, Any] | str:
476476
"""Convert action string to dictionary format.
477477
478+
Args:
479+
action (str): Action string in AgentLab format, e.g., "move_to(x=100, y=200)".
480+
481+
Returns:
482+
dict[str, Any] | str: Action in OSWorld Computer 13 format as a dictionary,
483+
or a string for simple actions like "wait", "done", or "fail".
484+
478485
Examples:
479486
>>> env = OsworldGym(task={}, provider_name="vmware", region=None, path_to_vm=None,
480487
... snapshot_name="init_state", action_space="computer_13",
@@ -506,6 +513,13 @@ def convert_agentlab_action_to_computer_13(self, action: str) -> dict[str, Any]
506513
def parse_agentlab_action_str_to_func_args(action: str):
507514
"""Parse the agentlab action string to extract function name, args, and kwargs.
508515
516+
Args:
517+
action (str): Action string in AgentLab format, e.g., "move_to(x=100, y=200)".
518+
519+
Returns:
520+
tuple: A tuple containing the function name, a list of positional arguments,
521+
and a dictionary of keyword arguments.
522+
509523
Examples:
510524
>>> parse_agentlab_action_str_to_func_args("move_to(x=100, y=200)")
511525
('move_to', [], {'x': 100, 'y': 200})
@@ -671,9 +685,16 @@ def model_post_init(self, __context: Any) -> None:
671685
self.env_args_list.append(task_env_args)
672686
logger.info(f"Loaded {len(self.env_args_list)} tasks from domain '{self.domain}'")
673687

674-
def fix_settings_file_path_in_config(self, task) -> str:
688+
def fix_settings_file_path_in_config(self, task: dict) -> dict:
675689
"""Fix the settings file path in the task configuration.
690+
676691
#TODO: We can create our own tiny_osworld.json with correct paths (OSWorld prefixed) to settings files. Meanwhile use this function to fix the paths.
692+
693+
Args:
694+
task (dict): Task configuration dictionary.
695+
696+
Returns:
697+
dict: Updated task configuration with fixed settings file paths.
677698
"""
678699
osworld_repo = os.getenv("OSWORLD_REPO", "OSWorld")
679700
updated_task = deepcopy(task) # Avoid modifying the original task

0 commit comments

Comments
 (0)