Spaces:
Runtime error
Runtime error
# 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") |