Please note that the LiteWebAgent repository is in development mode. We have open-sourced the repository to foster collaboration between contributors.
From PyPI: https://pypi.org/project/litewebagent/
pip install litewebagent
Set up locally First set up virtual environment
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
then allow your code to be able to see 'litewebagent'
cd ..
pip install -e .
Then please create a .env file, and update your API keys:
cp .env.example .env
- use web agent to finish some task and save the workflow
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.google.com --goal 'search dining table' --plan 'search dining table'
python -m litewebagent.main --agent_type HighLevelPlanningAgent --starting_url https://www.airbnb.com --goal "set destination as San Francisco, then search the results" --plan "(1) enter the 'San Francisco' as destination, (2) and click search"
python -m litewebagent.main --agent_type ContextAwarePlanningAgent --starting_url https://www.google.com --goal 'search dining table' --plan 'search dining table'
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.google.com --goal 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"' --plan 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"'
python -m litewebagent.main --agent_type HighLevelPlanningAgent --starting_url https://www.google.com --goal 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"' --plan 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"'
python -m litewebagent.main --agent_type ContextAwarePlanningAgent --starting_url https://www.google.com --goal 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"' --plan 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"'
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.google.com --goal 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"' --plan 'Find the pdf of the paper "GPT-4V(ision) is a Generalist Web Agent, if Grounded"'
- replay the workflow verified by the web agent If you haven't used the web agent to try any tests yet, first copy our example.json file.
cp litewebagent/flow/example.json litewebagent/flow/steps.json
Now that we have the steps.json file, which contains the workflow of a specific task, we can replay.
python -m litewebagent.replay
- enable user agent interaction
python -m litewebagent.cli_main --agent_type HighLevelPlanningAgent
We use axtree by default. Alternatively, you can provide a comma-separated string listing the desired input feature types.
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.airbnb.com --goal 'set destination as San Francisco, then search the results' --plan '(1) enter the "San Francisco" as destination, (2) and click search'
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.airbnb.com --goal 'set destination as San Francisco, then search the results' --plan '(1) enter the "San Francisco" as destination, (2) and click search' --features interactive_elements
python -m litewebagent.main --agent_type DemoAgent --starting_url https://www.airbnb.com --goal 'set destination as San Francisco, then search the results' --plan '(1) enter the "San Francisco" as destination, (2) and click search' --features axtree,interactive_elements