Skip to content

The Library for LLM-based web-agent applications

License

Notifications You must be signed in to change notification settings

TxTo777/LiteWebAgent

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiteWebAgent

Please note that the LiteWebAgent repository is in development mode. We have open-sourced the repository to foster collaboration between contributors.

2. Development mode

(1) Installation

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

(2) QuickStart

  • 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 

(3) test different input features

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

(4) Demos

About

The Library for LLM-based web-agent applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 76.2%
  • Python 21.9%
  • JavaScript 1.9%