LaVague / app.py
SpyCoder77's picture
Create app.py
2cde005 verified
raw
history blame contribute delete
856 Bytes
# Install necessary elements
from lavague.drivers.selenium import SeleniumDriver
from lavague.core import ActionEngine, WorldModel
from lavague.core.agents import WebAgent
# Set up our three key components: Driver, Action Engine, World Model
driver = SeleniumDriver(headless=False)
action_engine = ActionEngine(driver)
world_model = WorldModel()
# Create Web Agent
agent = WebAgent(world_model, action_engine)
# Set URL
agent.get("https://huggingface.co/docs")
# Run agent with a specific objective
agent.run("Go on the quicktour of PEFT")
driver = SeleniumDriver(headless=True)
action_engine = ActionEngine(driver)
world_model = WorldModel()
# Create Web Agent
agent = WebAgent(world_model, action_engine)
# Set URL
agent.get("https://huggingface.co/docs")
# Launch the agent in the Agent Gradio Demo mode
agent.demo("Go on the quicktour of PEFT")