# examples/natural_language.py
"""Natural language task execution example."""

import asyncio
from surfai import Browser


async def main():
    """Example: Execute natural language task."""
    async with Browser() as browser:
        # Execute a complex task with natural language
        results = await browser.execute_task(
            "Go to GitHub and find the most starred Python repository"
        )
        
        print("Actions executed:")
        for action in results["actions_executed"]:
            print(f"  - {action}")
        
        print("\nExtracted data:")
        for data in results["extracted_data"]:
            print(f"  - {data}")
        
        print("\nScreenshots:")
        for path in results["screenshots"]:
            print(f"  - {path}")


if __name__ == "__main__":
    asyncio.run(main())
