from upsonic import Task, Agent
from pydantic import BaseModel
class Product(BaseModel):
name: str
price: float
class ProductList(BaseModel):
products: list[Product]
class BrowserUse:
command = "npx"
args = ["@playwright/mcp@latest"]
task = Task(
"Go and get the latest suggested phones and their prices in google.com",
tools=[BrowserUse], # Enabling Computer Use
response_format=ProductList
)
agent = Agent(name="Browser Use Agent")
agent.print_do(task)