browseruse_bench.utils.task_utils
Task processing utility functions.Import
load_tasks
Load task data.str
required
Path to tasks JSON file
str
default:"None"
Optional prompt template, format like
"{task}\n...{url}...". If provided, a prompt field will be added to the task dictionary.list of dict
List of tasks, each containing
task_id, task_text, url. Includes prompt if prompt_fmt is provided.load_tasks_with_benchmark_support
Load tasks with support for different benchmarks (including BrowseComp).Path
required
Path to tasks JSON file
str
default:"None"
Optional prompt template (ignored for BrowseComp which has its own template)
filter_tasks
Filter tasks based on mode.list of dict
required
List of tasks
str
required
Filter mode:
single- Run first task onlyfirst_n- Run first N taskssample_n- Randomly sample N tasksspecific- Run tasks with specified IDsby_id- Run single task by IDall- Run all tasks
int
required
Number of tasks for
first_n or sample_n modelist of str
default:"None"
List of task IDs for
specific modestr
default:"None"
Single task ID for
by_id modefilter_completed_tasks
Filter out completed tasks.list of dict
required
List of tasks
Path
required
Output directory
function
required
Function to check if a task is completed
tuple
(List of remaining tasks, number of skipped tasks)
is_task_completed_by_result_json
Check if task is completed (via result.json).str
required
Task ID
Path
required
Output directory path
bool
True if result.json exists and is not empty
resolve_tasks_json_path
Resolve task JSON file path.str
default:"None"
Path passed via command line
Path
required
Default path
str
default:"'TASKS_JSON'"
Environment variable name
print_task_summary
Print task execution summary.int
required
Total number of tasks
int
required
Number of tasks run in this session
int
required
Number of successful tasks
int
required
Number of failed tasks
Path
required
Output directory path