repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
cwjokaka/bilibili_member_crawler
https://github.com/cwjokaka/bilibili_member_crawler/blob/a4b9cb64b073ec452f1b12b5225539e53996689b/exception/sql_insert_exception.py
exception/sql_insert_exception.py
from exception.bilibili_exception import BilibiliException class SqlInsertException(BilibiliException): def __init__(self, msg) -> None: super().__init__(msg)
python
MIT
a4b9cb64b073ec452f1b12b5225539e53996689b
2026-01-05T07:13:29.310919Z
false
cwjokaka/bilibili_member_crawler
https://github.com/cwjokaka/bilibili_member_crawler/blob/a4b9cb64b073ec452f1b12b5225539e53996689b/exception/sql_already_exists_exception.py
exception/sql_already_exists_exception.py
from exception.bilibili_exception import BilibiliException class SqlAlreadyExistsException(BilibiliException): def __init__(self, msg) -> None: super().__init__(msg)
python
MIT
a4b9cb64b073ec452f1b12b5225539e53996689b
2026-01-05T07:13:29.310919Z
false
cwjokaka/bilibili_member_crawler
https://github.com/cwjokaka/bilibili_member_crawler/blob/a4b9cb64b073ec452f1b12b5225539e53996689b/exception/__init__.py
exception/__init__.py
python
MIT
a4b9cb64b073ec452f1b12b5225539e53996689b
2026-01-05T07:13:29.310919Z
false
cwjokaka/bilibili_member_crawler
https://github.com/cwjokaka/bilibili_member_crawler/blob/a4b9cb64b073ec452f1b12b5225539e53996689b/exception/user_not_found_exception.py
exception/user_not_found_exception.py
from exception.bilibili_exception import BilibiliException class UserNotFoundException(BilibiliException): def __init__(self, msg) -> None: super().__init__(msg)
python
MIT
a4b9cb64b073ec452f1b12b5225539e53996689b
2026-01-05T07:13:29.310919Z
false
aaugustin/datedelta
https://github.com/aaugustin/datedelta/blob/82df8cc33b270fe5b06870b2ca2591faf1d3241c/test_datedelta.py
test_datedelta.py
# For convenience and readability in tests, use short aliases. import pickle from datetime import date as d from datetime import timedelta as td import pytest from datedelta import datedelta as dd from datedelta import DAY, MONTH, WEEK, YEAR @pytest.mark.parametrize( ("constant", "value"), [ (DAY, d...
python
BSD-3-Clause
82df8cc33b270fe5b06870b2ca2591faf1d3241c
2026-01-05T07:13:33.593315Z
false
aaugustin/datedelta
https://github.com/aaugustin/datedelta/blob/82df8cc33b270fe5b06870b2ca2591faf1d3241c/datedelta.py
datedelta.py
import datetime class datedelta: __slots__ = ["_years", "_months", "_days"] def __init__(self, *, years=0, months=0, days=0): int_years = int(years) int_months = int(months) int_days = int(days) if int_years != years: raise ValueError("years must be an integer val...
python
BSD-3-Clause
82df8cc33b270fe5b06870b2ca2591faf1d3241c
2026-01-05T07:13:33.593315Z
false
aantonop/wifiportal21
https://github.com/aantonop/wifiportal21/blob/73c6e1120eeeb2b4a1c1684bc61062ab77fde85f/setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name='wifiportal21', version = "0.1", packages=['wifiportal21'], package_data={'wifiportal21': ['templates/*','static/*']}, include_package_data=True, license='http://opensource.org/licenses/MIT', author='Andreas M. An...
python
MIT
73c6e1120eeeb2b4a1c1684bc61062ab77fde85f
2026-01-05T07:13:34.315735Z
false
aantonop/wifiportal21
https://github.com/aantonop/wifiportal21/blob/73c6e1120eeeb2b4a1c1684bc61062ab77fde85f/config.py
config.py
receiving_key = "xpub6F8dWKbomfy7qmQ9Ma16SAwL3H9xMyaEjAfsEhtRjt5Bx3MFHTgDjvp4eZfUZES4i4AgaVGzVPyCKbSufdVsFvfR4wNjKRGraJrv5nLVs4h" # m/44'/0'/0'/0 SATOSHIS_PER_MINUTE = 2000
python
MIT
73c6e1120eeeb2b4a1c1684bc61062ab77fde85f
2026-01-05T07:13:34.315735Z
false
aantonop/wifiportal21
https://github.com/aantonop/wifiportal21/blob/73c6e1120eeeb2b4a1c1684bc61062ab77fde85f/wifiportal21/__init__.py
wifiportal21/__init__.py
python
MIT
73c6e1120eeeb2b4a1c1684bc61062ab77fde85f
2026-01-05T07:13:34.315735Z
false
aantonop/wifiportal21
https://github.com/aantonop/wifiportal21/blob/73c6e1120eeeb2b4a1c1684bc61062ab77fde85f/wifiportal21/auth_server.py
wifiportal21/auth_server.py
#!/usr/bin/env python import logging import requests import flask from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask import request, flash, redirect, render_template, url_for from flask import jsonify from two1.lib.bitcoin.crypto import HDKey, HDPublicKey from two1.lib.wallet.hd_account impor...
python
MIT
73c6e1120eeeb2b4a1c1684bc61062ab77fde85f
2026-01-05T07:13:34.315735Z
false
CuriousLearner/GeeksForGeeksScrapper
https://github.com/CuriousLearner/GeeksForGeeksScrapper/blob/1b683913d9eb3a1f60140920c33c46afc9c3de79/g4g.py
g4g.py
#!/usr/bin/python import requests from os import system from sys import exit from time import sleep from requests.exceptions import ConnectionError from bs4 import BeautifulSoup from article import Article BASE_URL = "http://www.geeksforgeeks.org/" articles = [] CHOICE_TO_CATEGORY_MAPPING = { 1: "c", 2: ...
python
MIT
1b683913d9eb3a1f60140920c33c46afc9c3de79
2026-01-05T07:13:34.983476Z
false
CuriousLearner/GeeksForGeeksScrapper
https://github.com/CuriousLearner/GeeksForGeeksScrapper/blob/1b683913d9eb3a1f60140920c33c46afc9c3de79/article.py
article.py
class Article(object): """ This Class Contains the title and the content of the article. The title can be use as key to the article link for the navigation purpose. """ def __init__(self, title, content): self.title = title self.content = content
python
MIT
1b683913d9eb3a1f60140920c33c46afc9c3de79
2026-01-05T07:13:34.983476Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/client.py
exps/android_exp/client.py
from gradio_client import Client from PIL import Image from env import AndroidAction, ActionType from typing import Dict, Union from time import sleep from abc import ABC, abstractmethod class AbstractAgent(ABC): @abstractmethod def act(self, task:str, image_path:str)->Union[AndroidAction, Dict]: pas...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/runner.py
exps/android_exp/runner.py
from env import AndroidEnv from client import AbstractAgent import time import time import uuid import os import json from termcolor import colored, cprint def create_human_friendly_uid(): current_time_str = time.strftime("%m%d_%H%M%S") # Generate a random UUID random_uuid = str(uuid.uuid4()).split("-")[0...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/main.py
exps/android_exp/main.py
from env import AndroidEnv, AndroidAction, ActionType from runner import Runner from client import CogAgent, AutoUI import argparse import json import os def main(args): if args.agent == "cogagent": agent = CogAgent("https://6cbe60874cce4c4f3e<removed>/") elif args.agent == "autoui-large": age...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/env.py
exps/android_exp/env.py
import os import shutil from dataclasses import dataclass from typing import List, Tuple, Union from enum import Enum import subprocess, signal import re from time import sleep from appium import webdriver from appium.options.android import UiAutomator2Options import base64 from PIL import Image from io import BytesI...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/action_matching.py
exps/android_exp/models/Auto-UI/action_matching.py
''' Adapted from https://github.com/google-research/google-research/tree/master/android_in_the_wild ''' # import jax # import jax.numpy as jnp import numpy as np import action_type as action_type_lib _TAP_DISTANCE_THRESHOLD = 0.14 # Fraction of the screen ANNOTATION_WIDTH_AUGMENT_FRACTION = 1.4 ANNOTATION_HEIGHT_A...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/action_type.py
exps/android_exp/models/Auto-UI/action_type.py
''' Adapted from https://github.com/google-research/google-research/tree/master/android_in_the_wild ''' import enum class ActionType(enum.IntEnum): # Placeholders for unused enum values UNUSED_0 = 0 UNUSED_1 = 1 UNUSED_2 = 2 UNUSED_8 = 8 UNUSED_9 = 9 ########### Agent actions ########### # A type a...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/serve_base.py
exps/android_exp/models/Auto-UI/serve_base.py
import os import numpy as np import torch import os import re import json import argparse import random from transformers import AutoTokenizer, DataCollatorForSeq2Seq, Seq2SeqTrainingArguments, Seq2SeqTrainer from model import T5ForMultimodalGeneration from infer_utils import ImageFeatureExtractor from PIL import Image...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/utils_data.py
exps/android_exp/models/Auto-UI/utils_data.py
from torch.utils.data import Dataset import torch import pickle from tqdm import tqdm import action_matching, action_type import numpy as np import numpy as jnp # import jax.numpy as jnp import random import re img_shape = { "resnet": (512, 2048), "clip": (49, 2048), "detr": (100, 256), "vit": (577, 768...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/fetch_features.py
exps/android_exp/models/Auto-UI/fetch_features.py
import action_type, action_matching import tensorflow as tf import numpy as np from tqdm import tqdm import json import jax.numpy as jnp import argparse import pickle import torch import tensorflow as tf from PIL import Image from transformers import AutoProcessor, Blip2Model device = "cuda" if torch.cuda.is_available...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/model.py
exps/android_exp/models/Auto-UI/model.py
''' Adapted from https://github.com/huggingface/transformers ''' from transformers import T5Config, T5ForConditionalGeneration from transformers.models.t5.modeling_t5 import T5Stack, __HEAD_MASK_WARNING_MSG import copy from transformers.modeling_outputs import BaseModelOutput, Seq2SeqLMOutput from typing import Option...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/main.py
exps/android_exp/models/Auto-UI/main.py
import os import numpy as np import torch import os import re import json import argparse import random from transformers import AutoTokenizer, DataCollatorForSeq2Seq, Seq2SeqTrainingArguments, Seq2SeqTrainer from model import T5ForMultimodalGeneration from utils_data import AITWDatasetImg, load_data from rich.table im...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/serve_large.py
exps/android_exp/models/Auto-UI/serve_large.py
import os import numpy as np import torch import os import re import json import argparse import random from transformers import AutoTokenizer, DataCollatorForSeq2Seq, Seq2SeqTrainingArguments, Seq2SeqTrainer from model import T5ForMultimodalGeneration from infer_utils import ImageFeatureExtractor from PIL import Image...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/Auto-UI/infer_utils.py
exps/android_exp/models/Auto-UI/infer_utils.py
import torch from PIL import Image from transformers import AutoProcessor, Blip2Model, AutoTokenizer from model import T5ForMultimodalGeneration class ImageFeatureExtractor: def __init__(self): # Set device based on CUDA availability self.device = "cuda" if torch.cuda.is_available() else "cpu" ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/android_exp/models/CogAgent/web_demo_simple.py
exps/android_exp/models/CogAgent/web_demo_simple.py
""" This script is a simple web demo of the CogVLM and CogAgent models, designed for easy and quick demonstrations. For a more sophisticated user interface, users are encouraged to refer to the 'composite_demo', which is built with a more aesthetically pleasing Streamlit framework. Usage: - Use the interface to upload...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/ios_exp/collect_trajectories.py
exps/ios_exp/collect_trajectories.py
from gradio_client import Client import argparse from env import IOSEnv, ALL_TASKS from utils import translate_action from tqdm import tqdm import json import random def main(args): client = Client(args.gardio_http) env = IOSEnv(save_path=args.save_path, udid=args.udid, device_path=args.device_path) epis...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/ios_exp/utils.py
exps/ios_exp/utils.py
import random COMMAND_MAP = { "swipe right": "idb ui swipe --udid {udid} 200 200 300 200 --duration 0.1", "swipe left": "idb ui swipe --udid {udid} 400 200 300 200 --duration 0.1", "swipe up": "idb ui swipe --udid {udid} 200 400 200 200 --duration 0.1", "swipe down": "idb ui swipe --udid {udid} 200 200 ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/ios_exp/env.py
exps/ios_exp/env.py
import time import os import subprocess import signal import cv2 import random from PIL import Image import json with open("train_tasks.json", "r") as fb: ALL_TASKS = json.load(fb) TASK_PROMPT = 'What steps do I need to take to "{task}"?(with grounding)' ALL_TASKS = [TASK_PROMPT.format(task=task) for task in ALL_T...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/run.py
exps/webarena_exp/run.py
"""Script to run end-to-end evaluation on the benchmark""" import argparse import glob import json import logging import os import random import subprocess import tempfile import time from pathlib import Path import openai from agent import ( Agent, PromptAgent, TeacherForcingAgent, construct_agent, )...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/setup.py
exps/webarena_exp/setup.py
from setuptools import setup if __name__ == "__main__": setup()
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/minimal_example.py
exps/webarena_exp/minimal_example.py
#!/usr/bin/env python3 # type: ignore import json import os import re import subprocess import time SLEEP = 1.5 # set the URLs of each website, we use the demo sites as an example os.environ[ "SHOPPING" ] = "http://ec2-3-131-244-37.us-east-2.compute.amazonaws.com:7770" os.environ[ "SHOPPING_ADMIN" ] = "http:/...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/run_reflexion.py
exps/webarena_exp/run_reflexion.py
"""Script to run end-to-end evaluation on the benchmark""" import argparse import glob import json import logging import os import copy import random import subprocess import tempfile import time from pathlib import Path import openai import openai.error from agent import ( Agent, PromptAgent, TeacherForc...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/scripts/generate_test_data.py
exps/webarena_exp/scripts/generate_test_data.py
"""Replace the website placeholders with website domains from env_config Generate the test data""" import json from browser_env.env_config import * def main() -> None: with open("config_files/test.raw.json", "r") as f: raw = f.read() raw = raw.replace("__GITLAB__", GITLAB) raw = raw.replace("__RE...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/scripts/check_error_runs.py
exps/webarena_exp/scripts/check_error_runs.py
"""Some executions may failed. This script checks the recordings, print the task ids. It deletes the recordings if needed.""" import argparse import glob import os import shutil import sys def merge_logs(result_folder: str, args: argparse.Namespace) -> str: if not os.path.exists(f"{result_folder}/log_files.txt"):...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/scripts/html2json.py
exps/webarena_exp/scripts/html2json.py
import argparse import base64 import glob import json import os from collections import defaultdict from typing import Any from bs4 import BeautifulSoup def main(result_folder: str, config_json: str) -> None: all_data = {} template_to_id: dict[str, Any] = defaultdict(lambda: len(template_to_id)) with op...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/scripts/collect_obs.py
exps/webarena_exp/scripts/collect_obs.py
"""Simple script to quickly get the observation of a page""" import json import re import time from typing import Dict, Optional, Tuple, Type, Union, cast import pytest from playwright.sync_api import Page, expect from browser_env import ( ScriptBrowserEnv, create_id_based_action, create_key_press_action...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/conftest.py
exps/webarena_exp/tests/conftest.py
from typing import AsyncGenerator, Generator import pytest import pytest_asyncio from browser_env import AsyncScriptBrowserEnv, ScriptBrowserEnv HEADLESS = True SLOW_MO = 0 @pytest.fixture(scope="function") def script_browser_env() -> Generator[ScriptBrowserEnv, None, None]: """Create a ScriptBrowserEnv instan...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_browser_env/test_actions.py
exps/webarena_exp/tests/test_browser_env/test_actions.py
import numpy as np from browser_env import * def test_is_equivalent() -> None: for action_type in ActionTypes.__members__.values(): action_a = create_random_action() action_b = create_random_action() if action_a["action_type"] != action_b["action_type"]: assert not is_equivale...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_browser_env/test_auth_cookie.py
exps/webarena_exp/tests/test_browser_env/test_auth_cookie.py
import asyncio import json from browser_env import * auth_json = { "cookies": [ { "name": "session-username", "value": "standard_user", "domain": "www.saucedemo.com", "path": "/", "httpOnly": False, "secure": False, "sameS...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_browser_env/test_action_functionalities.py
exps/webarena_exp/tests/test_browser_env/test_action_functionalities.py
import re from typing import Dict, Optional, Tuple, Type, Union, cast import pytest from playwright.sync_api import Page, expect from browser_env import ( ScriptBrowserEnv, create_id_based_action, create_key_press_action, create_playwright_action, create_scroll_action, ) HEADLESS = True SLOW_MO =...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_browser_env/test_script_browser_env.py
exps/webarena_exp/tests/test_browser_env/test_script_browser_env.py
import asyncio import collections import json import tempfile from typing import Callable, Dict, Optional, Tuple, Type, Union, cast import pytest from gymnasium.vector import AsyncVectorEnv from playwright.sync_api import Page from browser_env import ( Action, AsyncScriptBrowserEnv, DetachedPage, Scri...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_browser_env/test_playwright_actions.py
exps/webarena_exp/tests/test_browser_env/test_playwright_actions.py
from typing import Dict, Generator, Optional, Tuple, Type, Union, cast import pytest from playwright.sync_api import Page from browser_env import ScriptBrowserEnv, create_playwright_action HEADLESS = True SLOW_MO = 0 def test_frame_locator(script_browser_env: ScriptBrowserEnv) -> None: env = script_browser_env...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_evaluation_harness/test_evaluators.py
exps/webarena_exp/tests/test_evaluation_harness/test_evaluators.py
import json import os import random from glob import glob from pathlib import Path from typing import Any import pytest from py import test from agent import Agent, TeacherForcingAgent from browser_env import ActionTypes, ScriptBrowserEnv from browser_env.env_config import * from evaluation_harness import ( HTMLC...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/tests/test_evaluation_harness/test_helper_functions.py
exps/webarena_exp/tests/test_evaluation_harness/test_helper_functions.py
import json import os from pathlib import Path from browser_env import ScriptBrowserEnv from browser_env.env_config import * from evaluation_harness.helper_functions import ( gitlab_get_project_memeber_role, ) HEADLESS = True config_file_folder = "tests/test_evaluation_harness/configs" def test_gitlab_get_proje...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/evaluation_harness/evaluators.py
exps/webarena_exp/evaluation_harness/evaluators.py
"""base class for evaluation""" # answer string match import collections import html import importlib import json import time import urllib from pathlib import Path from typing import Any, Tuple, Union from beartype import beartype from nltk.tokenize import word_tokenize # type: ignore from playwright.sync_api import...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/evaluation_harness/__init__.py
exps/webarena_exp/evaluation_harness/__init__.py
from .evaluators import * from .helper_functions import ( shopping_get_latest_order_url, shopping_get_sku_latest_review_author, shopping_get_sku_latest_review_rating, )
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/evaluation_harness/helper_functions.py
exps/webarena_exp/evaluation_harness/helper_functions.py
"""Implements helper functions to assist evaluation cases where other evaluators are not suitable.""" import json from typing import Any from urllib.parse import urlparse import requests from playwright.sync_api import CDPSession, Page from browser_env.env_config import ( ACCOUNTS, GITLAB, MAP, REDDIT...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/constants.py
exps/webarena_exp/browser_env/constants.py
from typing import Literal ROLES = ( "alert", "alertdialog", "application", "article", "banner", "blockquote", "button", "caption", "cell", "checkbox", "code", "columnheader", "combobox", "complementary", "contentinfo", "definition", "deletion", "...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/auto_login.py
exps/webarena_exp/browser_env/auto_login.py
"""Script to automatically login each website""" import argparse import glob import os import time from concurrent.futures import ThreadPoolExecutor from itertools import combinations from pathlib import Path from playwright.sync_api import sync_playwright from browser_env.env_config import ( ACCOUNTS, GITLAB...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/env_config.py
exps/webarena_exp/browser_env/env_config.py
# websites domain import os REDDIT = os.environ.get("REDDIT", "") SHOPPING = os.environ.get("SHOPPING", "") SHOPPING_ADMIN = os.environ.get("SHOPPING_ADMIN", "") GITLAB = os.environ.get("GITLAB", "") WIKIPEDIA = os.environ.get("WIKIPEDIA", "") MAP = os.environ.get("MAP", "") HOMEPAGE = os.environ.get("HOMEPAGE", "") ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/processors.py
exps/webarena_exp/browser_env/processors.py
import json import re from collections import defaultdict from typing import Any, TypedDict, Union import numpy as np import numpy.typing as npt from gymnasium import spaces from playwright.sync_api import CDPSession, Page, ViewportSize from browser_env.constants import ( ASCII_CHARSET, FREQ_UNICODE_CHARSET, ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/utils.py
exps/webarena_exp/browser_env/utils.py
from dataclasses import dataclass from io import BytesIO from typing import Any, Dict, TypedDict, Union import numpy as np import numpy.typing as npt from PIL import Image @dataclass class DetachedPage: url: str content: str # html def png_bytes_to_numpy(png: bytes) -> npt.NDArray[np.uint8]: """Conver...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/async_envs.py
exps/webarena_exp/browser_env/async_envs.py
import asyncio import json from dataclasses import dataclass from pathlib import Path import numpy as np import numpy.typing as npt from gymnasium import Env from gymnasium.spaces import Box, Text from playwright.async_api import Page, ViewportSize, async_playwright from .actions import Action, aexecute_action, get_a...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/__init__.py
exps/webarena_exp/browser_env/__init__.py
import asyncio from .actions import ( Action, ActionParsingError, ActionTypes, action2create_function, action2str, create_check_action, create_click_action, create_focus_and_click_action, create_focus_and_type_action, create_go_back_action, create_go_forward_action, crea...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/envs.py
exps/webarena_exp/browser_env/envs.py
import json import re import time from collections import defaultdict from dataclasses import dataclass from pathlib import Path from typing import Any, Union import numpy as np import numpy.typing as npt from beartype import beartype from beartype.door import is_bearable from gymnasium import Env from gymnasium.space...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/actions.py
exps/webarena_exp/browser_env/actions.py
""" Browser Env action space. Inspited by Farama-Foundation/miniwob-plusplus """ import ast import random import re import string from enum import IntEnum from itertools import chain from typing import Any, TypedDict, Union, cast import numpy as np import numpy.typing as npt from beartype import beartype from gymnasiu...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
true
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/helper_functions.py
exps/webarena_exp/browser_env/helper_functions.py
import base64 import io import json import re from pathlib import Path from typing import Any, Optional import numpy as np from PIL import Image from agent.prompts import * from browser_env import ( Action, ActionTypes, ObservationMetadata, StateInfo, action2str, ) HTML_TEMPLATE = """ <!DOCTYPE h...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/browser_env/trajectory.py
exps/webarena_exp/browser_env/trajectory.py
from typing import Union from .actions import Action from .utils import StateInfo Trajectory = list[Union[StateInfo, Action]]
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/utils.py
exps/webarena_exp/llms/utils.py
import argparse from typing import Any import time from llms import ( generate_from_huggingface_completion, generate_from_openai_chat_completion, generate_from_openai_completion, lm_config, ) APIInput = str | list[Any] | dict[str, Any] def call_llm( lm_config: lm_config.LMConfig, prompt: API...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/__init__.py
exps/webarena_exp/llms/__init__.py
"""This module is adapt from https://github.com/zeno-ml/zeno-build""" from .providers.hf_utils import generate_from_huggingface_completion from .providers.openai_utils import ( generate_from_openai_chat_completion, generate_from_openai_completion, ) from .utils import call_llm __all__ = [ "generate_from_op...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/tokenizers.py
exps/webarena_exp/llms/tokenizers.py
from typing import Any import tiktoken from transformers import LlamaTokenizer # type: ignore class Tokenizer(object): def __init__(self, provider: str, model_name: str) -> None: if provider == "openai": self.tokenizer = tiktoken.encoding_for_model(model_name) elif provider == "huggi...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/lm_config.py
exps/webarena_exp/llms/lm_config.py
"""Config for language models.""" from __future__ import annotations import argparse import dataclasses from dataclasses import dataclass from typing import Any @dataclass(frozen=True) class LMConfig: """A config for a language model. Attributes: provider: The name of the API provider. mode...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/providers/hf_utils.py
exps/webarena_exp/llms/providers/hf_utils.py
from text_generation import Client # type: ignore def generate_from_huggingface_completion( prompt: str, model_endpoint: str, temperature: float, top_p: float, max_new_tokens: int, stop_sequences: list[str] | None = None, ) -> str: client = Client(model_endpoint, timeout=60) generatio...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/llms/providers/openai_utils.py
exps/webarena_exp/llms/providers/openai_utils.py
"""Tools to generate from OpenAI prompts. Adopted from https://github.com/zeno-ml/zeno-build/""" import asyncio import logging import os import random import time from typing import Any import aiolimiter import openai import openai.error from tqdm.asyncio import tqdm_asyncio def retry_with_exponential_backoff( # t...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/environment_docker/webarena-homepage/app.py
exps/webarena_exp/environment_docker/webarena-homepage/app.py
from flask import Flask, render_template app = Flask(__name__) @app.route("/") def index() -> str: return render_template("index.html") @app.route("/scratchpad.html") def scratchpad() -> str: return render_template("scratchpad.html") @app.route("/calculator.html") def calculator() -> str: return rend...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/evaluator.py
exps/webarena_exp/agent/evaluator.py
import os from typing import Any from gradio_client import Client from browser_env import Trajectory import numpy as np import tempfile from PIL import Image from typing import Union, Literal import time from agent_eval.clients import LM_Client, GPT4V_Client from agent_eval.eval.evaluator import Evaluator import multip...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/__init__.py
exps/webarena_exp/agent/__init__.py
from .agent import ( Agent, PromptAgent, TeacherForcingAgent, construct_agent, ) __all__ = ["Agent", "TeacherForcingAgent", "PromptAgent", "construct_agent"]
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/agent.py
exps/webarena_exp/agent/agent.py
import argparse import json from typing import Any import tiktoken from beartype import beartype from agent.prompts import * from browser_env import Trajectory from browser_env.actions import ( Action, ActionParsingError, create_id_based_action, create_none_action, create_playwright_action, ) from...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/prompt_constructor.py
exps/webarena_exp/agent/prompts/prompt_constructor.py
import json import re from pathlib import Path from typing import Any, TypedDict from browser_env import Action, ActionParsingError, Trajectory from browser_env.env_config import URL_MAPPINGS from browser_env.utils import StateInfo from llms import lm_config from llms.tokenizers import Tokenizer from llms.utils import...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/to_json.py
exps/webarena_exp/agent/prompts/to_json.py
import glob import importlib import json import os # use the current directory as the root def run() -> None: """Convert all python files in agent/prompts to json files in agent/prompts/jsons Python files are easiser to edit """ for p_file in glob.glob(f"agent/prompts/raw/*.py"): # import the...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/__init__.py
exps/webarena_exp/agent/prompts/__init__.py
from .prompt_constructor import *
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s_no_na.py
exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s_no_na.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/reflexion_generation.py
exps/webarena_exp/agent/prompts/raw/reflexion_generation.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_3s_llama.py
exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_3s_llama.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. The actions you can perform fall into several categories: Page Operation Actions: `click [id]`: This action clicks on an element with a specific id on the webpage. `type [id] [content] [press_enter_after=0|1]`: Use th...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s.py
exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_2s_no_na.py
exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_2s_no_na.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s_reflexion.py
exps/webarena_exp/agent/prompts/raw/p_cot_id_actree_2s_reflexion.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_2s.py
exps/webarena_exp/agent/prompts/raw/p_direct_id_actree_2s.py
prompt = { "intro": """You are an autonomous intelligent agent tasked with navigating a web browser. You will be given web-based tasks. These tasks will be accomplished through the use of specific actions you can issue. Here's the information you'll have: The user's objective: This is the task you're trying to comple...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/setup.py
agent_eval/setup.py
from setuptools import setup setup( name="agent_eval", version="0.0.1", packages=["agent_eval"], install_requires=[ "openai", "requests", "pillow", "bs4", "matplotlib", "termcolor", "human_id", "pandas", "easy_ocr", "einops...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/scripts/run_eval_android.py
agent_eval/scripts/run_eval_android.py
from tqdm import tqdm import json from human_id import generate_id import os import argparse import multiprocessing as mp from agent_eval.clients import LM_Client, GPT4V_Client from agent_eval.domains.unified import UniTrajectoryDataset from agent_eval.eval.evaluator import Evaluator from agent_eval.eval.metrics impor...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/scripts/run_eval_web.py
agent_eval/scripts/run_eval_web.py
from tqdm import tqdm import json from human_id import generate_id import os import argparse import multiprocessing as mp import traceback from agent_eval.clients import LM_Client, GPT4V_Client from agent_eval.domains.unified import UniTrajectoryDataset from agent_eval.eval.evaluator import Evaluator from agent_eval.e...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/scripts/annotate_ios_dense.py
agent_eval/scripts/annotate_ios_dense.py
from agent_eval.eval.annotator import Annotator from agent_eval.domains.unified import UniTrajectoryDataset from agent_eval.clients import LM_Client, GPT4V_Client import multiprocessing as mp from tqdm import tqdm import json def process_sample( traj_info: dict, model: str, ): try: print("processi...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/utils.py
agent_eval/agent_eval/utils.py
from PIL import Image import matplotlib.pyplot as plt import numpy as np def display_images(images): """Display list of PIL images in a 2xN grid.""" n = len(images) # Calculate grid shape cols = int(np.ceil(n / 2.0)) rows = 2 if n > 1 else 1 cols, rows = rows, cols # Swap # Create a ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/__init__.py
agent_eval/agent_eval/__init__.py
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/clients.py
agent_eval/agent_eval/clients.py
import openai from openai.api_resources import ChatCompletion # from openai import OpenAI, AsyncOpenAI import requests from typing import List, Union, Dict, Optional, Tuple from PIL import Image from io import BytesIO import base64 # from openai.types.chat.chat_completion import ChatCompletion import os import reques...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/domains/unified.py
agent_eval/agent_eval/domains/unified.py
from PIL import Image import os import json from typing import List, Dict, Any, Tuple from collections import defaultdict from termcolor import cprint import re import numpy as np class UniTrajectoryDataset: def __init__( self, dataset_path: str, eval_log_names: List[str], captioner...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/domains/unify_webarena.py
agent_eval/agent_eval/domains/unify_webarena.py
# %% import agent_eval from agent_eval.domains.webarena import extract_trajectory_info, extract_eval_results import json import os # %% # raw_dataset_path = "/home/<user>/code/WebArena/webarena_traj/102023_release_v2/919_gpt4_8k_cot" # output_dataset_path = "/home/<user>/data/GUI_Proj/unified_datasets/webarena-gpt4cot...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/domains/__init__.py
agent_eval/agent_eval/domains/__init__.py
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/domains/webarena.py
agent_eval/agent_eval/domains/webarena.py
import base64 from bs4 import BeautifulSoup from io import BytesIO from PIL import Image import os import json import re import random def extract_eval_results(merged_log: str): """Extract the evaluation results from the merged log file.""" results = {} for line in merged_log.splitlines(): if '[Res...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/captioner/annotate_screenshots.py
agent_eval/agent_eval/captioner/annotate_screenshots.py
# %% from agent_eval.clients import GPT4V_Client from PIL import Image import os, time import random from tqdm import tqdm import json from langdetect import detect as lang_detect import pytesseract random.seed(42) # %% def get_cap(img): # if random.random() < 0.5: # print("=") # else: # prin...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/captioner/prepare_caps_sub.py
agent_eval/agent_eval/captioner/prepare_caps_sub.py
import os import json from tqdm import tqdm from gradio_client import Client from collections import defaultdict def save(this_obj, file_path): with open(file_path, 'w') as f: json.dump(this_obj, f) def predict(img_path, client): result = client.predict( img_path, # str in 'text' Textbox ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/captioner/utils.py
agent_eval/agent_eval/captioner/utils.py
def detect_repetition()
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/captioner/__init__.py
agent_eval/agent_eval/captioner/__init__.py
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/captioner/captioner_server.py
agent_eval/agent_eval/captioner/captioner_server.py
from transformers import ( AutoModelForCausalLM, AutoTokenizer, __version__, GenerationConfig, ) from PIL import Image import gradio as gr import argparse import tempfile from PIL import Image import easyocr import torch assert ( __version__ == "4.32.0" ), "Please use transformers version 4.32.0, ...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/eval/prompts.py
agent_eval/agent_eval/eval/prompts.py
def build_obs_simplifier_prompt(cap, intent, response) -> str: prompt = f"""Given the following user question and context, extract part of the context that is unbiased, so that using that text alone would be good context for providing an unbiased answer to the user query. **User Query**: The bot responded with "{r...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/eval/metrics.py
agent_eval/agent_eval/eval/metrics.py
import os import json import pandas as pd LABEL_CORRECTION = { "24": False, "201": False, "225": False, "247": False, "390": False, "435": False, "466": False, "677": False, "678": False, "679": False, "680": False, "752": False, "792": False, "793": False, } d...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/eval/annotate_app.py
agent_eval/agent_eval/eval/annotate_app.py
import gradio as gr from matplotlib import pyplot as plt import math import io from PIL import Image from numpy import asarray from agent_eval.domains.unified import UniTrajectoryDataset import time import json from collections import defaultdict import os def main(dataset_abs_path, log_name): annotation_log_path...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/eval/annotator.py
agent_eval/agent_eval/eval/annotator.py
import json import os from typing import Any, List, Tuple from termcolor import cprint sys_prompt_v1_icl = """You are a GUI Trajectory Evaluator. Your task is to observe a bot's action within a graphical user interface (GUI) and classify its behavior into one of four categories based on its progress towards a specifi...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false
Berkeley-NLP/Agent-Eval-Refine
https://github.com/Berkeley-NLP/Agent-Eval-Refine/blob/0eef6eba80d91d99d99133c319f464d7adf47abe/agent_eval/agent_eval/eval/evaluator.py
agent_eval/agent_eval/eval/evaluator.py
import json import os from typing import Any, List, Tuple from termcolor import cprint from agent_eval.eval.prompts import * class Evaluator: def __init__(self, lm_clients, log_save_path=None): self.lm_clients = lm_clients self.log_save_path = log_save_path def __call__(self, info, client="...
python
BSD-3-Clause
0eef6eba80d91d99d99133c319f464d7adf47abe
2026-01-05T07:13:34.281805Z
false