From 889c5ee1e2faa40591f66c1007c79feeec50ef22 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Thu, 11 Jan 2024 06:56:09 +0400 Subject: [PATCH] Possible fix #41 --- notebooks/web_browser_agent.ipynb | 676 +++++++++++++----------------- 1 file changed, 290 insertions(+), 386 deletions(-) diff --git a/notebooks/web_browser_agent.ipynb b/notebooks/web_browser_agent.ipynb index 1a16bbc9..ec0fe9b6 100644 --- a/notebooks/web_browser_agent.ipynb +++ b/notebooks/web_browser_agent.ipynb @@ -3,114 +3,46 @@ { "cell_type": "code", "execution_count": null, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: selenium in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.16.0)\r\n", - "Requirement already satisfied: webdriver-manager in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.0.1)\r\n", - "Requirement already satisfied: selenium_stealth in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (1.0.6)\r\n", - "Requirement already satisfied: gradio in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.9.1)\r\n", - "Requirement already satisfied: urllib3<3,>=1.26 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from urllib3[socks]<3,>=1.26->selenium) (1.26.18)\r\n", - "Requirement already satisfied: trio~=0.17 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (0.23.2)\r\n", - "Requirement already satisfied: trio-websocket~=0.9 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (0.11.1)\r\n", - "Requirement already satisfied: certifi>=2021.10.8 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (2023.11.17)\r\n", - "Requirement already satisfied: requests in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (2.31.0)\r\n", - "Requirement already satisfied: python-dotenv in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (1.0.0)\r\n", - "Requirement already satisfied: packaging in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (23.1)\r\n", - "Requirement already satisfied: aiofiles<24.0,>=22.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (23.2.1)\r\n", - "Requirement already satisfied: altair<6.0,>=4.2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (5.2.0)\r\n", - "Requirement already satisfied: fastapi in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.105.0)\r\n", - "Requirement already satisfied: ffmpy in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.3.1)\r\n", - "Requirement already satisfied: gradio-client==0.7.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.7.3)\r\n", - "Requirement already satisfied: httpx in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.25.2)\r\n", - "Requirement already satisfied: huggingface-hub>=0.19.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.19.4)\r\n", - "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (6.1.1)\r\n", - "Requirement already satisfied: jinja2<4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.1.2)\r\n", - "Requirement already satisfied: markupsafe~=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.1.1)\r\n", - "Requirement already satisfied: matplotlib~=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.8.2)\r\n", - "Requirement already satisfied: numpy~=1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (1.26.2)\r\n", - "Requirement already satisfied: orjson~=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.9.10)\r\n", - "Requirement already satisfied: pandas<3.0,>=1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.1.4)\r\n", - "Requirement already satisfied: pillow<11.0,>=8.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (10.1.0)\r\n", - "Requirement already satisfied: pydantic>=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.5.2)\r\n", - "Requirement already satisfied: pydub in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.25.1)\r\n", - "Requirement already satisfied: python-multipart in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.0.6)\r\n", - "Requirement already satisfied: pyyaml<7.0,>=5.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (6.0.1)\r\n", - "Requirement already satisfied: semantic-version~=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.10.0)\r\n", - "Requirement already satisfied: tomlkit==0.12.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.12.0)\r\n", - "Requirement already satisfied: typer<1.0,>=0.9 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.9.0)\r\n", - "Requirement already satisfied: typing-extensions~=4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (4.9.0)\r\n", - "Requirement already satisfied: uvicorn>=0.14.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.24.0.post1)\r\n", - "Requirement already satisfied: fsspec in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio-client==0.7.3->gradio) (2023.12.2)\r\n", - "Requirement already satisfied: websockets<12.0,>=10.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio-client==0.7.3->gradio) (11.0.3)\r\n", - "Requirement already satisfied: jsonschema>=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.2)\r\n", - "Requirement already satisfied: toolz in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\r\n", - "Requirement already satisfied: filelock in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\r\n", - "Requirement already satisfied: tqdm>=4.42.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\r\n", - "Requirement already satisfied: contourpy>=1.0.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\r\n", - "Requirement already satisfied: cycler>=0.10 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\r\n", - "Requirement already satisfied: fonttools>=4.22.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.46.0)\r\n", - "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\r\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\r\n", - "Requirement already satisfied: python-dateutil>=2.7 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\r\n", - "Requirement already satisfied: pytz>=2020.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\r\n", - "Requirement already satisfied: tzdata>=2022.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\r\n", - "Requirement already satisfied: annotated-types>=0.4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.6.0)\r\n", - "Requirement already satisfied: pydantic-core==2.14.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.14.5)\r\n", - "Requirement already satisfied: attrs>=20.1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (23.1.0)\r\n", - "Requirement already satisfied: sortedcontainers in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (2.4.0)\r\n", - "Requirement already satisfied: idna in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (3.4)\r\n", - "Requirement already satisfied: outcome in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.3.0.post0)\r\n", - "Requirement already satisfied: sniffio>=1.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.3.0)\r\n", - "Requirement already satisfied: exceptiongroup in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.0.4)\r\n", - "Requirement already satisfied: wsproto>=0.14 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio-websocket~=0.9->selenium) (1.2.0)\r\n", - "Requirement already satisfied: click<9.0.0,>=7.1.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer<1.0,>=0.9->typer[all]<1.0,>=0.9->gradio) (8.1.7)\r\n", - "Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\r\n", - "Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\r\n", - "Requirement already satisfied: rich<14.0.0,>=10.11.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\r\n", - "Requirement already satisfied: PySocks!=1.5.7,<2.0,>=1.5.6 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from urllib3[socks]<3,>=1.26->selenium) (1.7.1)\r\n", - "Requirement already satisfied: h11>=0.8 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (0.14.0)\r\n", - "Requirement already satisfied: anyio<4.0.0,>=3.7.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from fastapi->gradio) (3.7.1)\r\n", - "Requirement already satisfied: starlette<0.28.0,>=0.27.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from fastapi->gradio) (0.27.0)\r\n", - "Requirement already satisfied: httpcore==1.* in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from httpx->gradio) (1.0.2)\r\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from requests->webdriver-manager) (2.0.4)\r\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\r\n", - "Requirement already satisfied: referencing>=0.28.4 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\r\n", - "Requirement already satisfied: rpds-py>=0.7.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\r\n", - "Requirement already satisfied: six>=1.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\r\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\r\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.15.1)\r\n", - "Requirement already satisfied: mdurl~=0.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\r\n" - ] - } - ], - "source": [ - "!pip install -r ../requirements.txt\n", - "!pip install selenium webdriver-manager selenium_stealth gradio" - ], + "id": "4e14ef4c098022de", "metadata": { - "collapsed": false, "ExecuteTime": { "start_time": "2024-01-04T04:21:52.228510Z" + }, + "collapsed": false, + "jupyter": { + "outputs_hidden": false } }, - "id": "4e14ef4c098022de" + "outputs": [], + "source": [ + "!pip install -r ../requirements.txt\n", + "!pip install selenium webdriver-manager selenium_stealth gradio" + ] }, { "cell_type": "markdown", + "id": "f2506b86-ec2f-4740-9f4b-2a5a92f3689f", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "source": [ "# Example From The Video\n", "Testing [oai-widget.com](https://oai-widget.com)" - ], - "metadata": { - "collapsed": false - }, - "id": "65f4e3db8ade99e9" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "initial_id", + "metadata": { + "ExecuteTime": { + "end_time": "2024-01-11T02:50:45.987748Z", + "start_time": "2024-01-11T02:50:45.977586Z" + } + }, "outputs": [], "source": [ "import sys\n", @@ -119,91 +51,112 @@ "%load_ext autoreload\n", "\n", "%autoreload 2" - ], - "metadata": { - "collapsed": true - }, - "id": "initial_id", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b3bb4f042e4b3050", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm import set_openai_key\n", "set_openai_key(\"YOUR_OPENAI_API_KEY\")" - ], - "metadata": { - "collapsed": false - }, - "id": "b3bb4f042e4b3050" + ] }, { "cell_type": "code", "execution_count": null, + "id": "45a0d3b52118f8cc", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm.agents.browsing import BrowsingAgent\n", "from agency_swarm import Agency, Agent" - ], - "metadata": { - "collapsed": false - }, - "id": "45a0d3b52118f8cc" + ] }, { "cell_type": "code", "execution_count": null, + "id": "6e83f218845b2060", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "browsing_agent = BrowsingAgent()" - ], - "metadata": { - "collapsed": false - }, - "id": "6e83f218845b2060" + ] }, { "cell_type": "code", "execution_count": null, + "id": "dc3c752d72ed8939", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "qa_manager = Agent(name=\"QA Manager\",\n", " description=\"The QA Manager Agent is an advanced digital entity designed to oversee and enhance the quality of processes for our SaaS product.\",\n", " instructions=\"As a Quality Assurance (QA) Manager, your role involves direct interaction and oversight of the BrowsingAgent's operations. Your primary duty is to guarantee that the user's task is comprehensively and accurately completed. Achieve this by methodically issuing each step of the task as a distinct message to the BrowsingAgent. It's crucial to confirm the successful execution of one step before advancing to the next. This procedure forms part of an integration test, which will be conducted in a live production environment. Importantly, ensure to provide the BrowsingAgent with the actual credentials related to the task, enabling authentic testing scenarios.\")" - ], - "metadata": { - "collapsed": false - }, - "id": "dc3c752d72ed8939" + ] }, { "cell_type": "code", "execution_count": null, + "id": "fef41ee496b4890d", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "agency = Agency([qa_manager,\n", " [qa_manager, browsing_agent]])" - ], - "metadata": { - "collapsed": false - }, - "id": "fef41ee496b4890d" + ] }, { "cell_type": "code", "execution_count": null, + "id": "d0586b684514e713", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "demo = agency.demo_gradio(height=700) # reload the notebook each time you run this cell" - ], - "metadata": { - "collapsed": false - }, - "id": "d0586b684514e713" + ] }, { "cell_type": "markdown", + "id": "c6acc12f-d36c-4534-abdc-27176eecfcc5", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "source": [ "Here are the instructions for this quality assurance testing task:\n", "1. Login to the website https://www.oai-widget.com/ using credentials 'test' and 'test'\n", @@ -216,44 +169,57 @@ "8. Ensure that response is received.\n", "\n", "If there are any issues along the way, please try to troubleshoot them yourself with the browsing agent first, before reporting back to me." - ], - "metadata": { - "collapsed": false - }, - "id": "4f3101f44f624b43" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6decc2caf79dc22d", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "demo.close()" - ], - "metadata": { - "collapsed": false - }, - "id": "6decc2caf79dc22d", - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "# Creating Your Own Browsing Swarm" - ], + "id": "b131cf4e-20ed-4115-b5bb-de83ddced46c", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, - "id": "ef8e806cc7c257a2" + "source": [ + "# Creating Your Own Browsing Swarm" + ] }, { "cell_type": "markdown", - "source": [], + "id": "e4decf6c-2f48-4aba-8e46-a8c2774ae7a5", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, - "id": "4867d3eb93c38cce" + "source": [] }, { "cell_type": "code", + "execution_count": null, + "id": "10a116e29529fb08", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "import sys\n", @@ -262,125 +228,154 @@ "%load_ext autoreload\n", "\n", "%autoreload 2" - ], - "metadata": { - "collapsed": false - }, - "id": "10a116e29529fb08", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "cba104a92da3f9e4", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm import set_openai_key\n", "set_openai_key(\"YOUR_OPENAI_API_KEY\")" - ], - "metadata": { - "collapsed": false - }, - "id": "cba104a92da3f9e4", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "a6eca041305cce5a", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm.agents.browsing import BrowsingAgent\n", "from agency_swarm import Agency, Agent" - ], - "metadata": { - "collapsed": false - }, - "id": "a6eca041305cce5a", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "55d911e7d32a509c", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "report_manager = Agent(name=\"Report Manager\",\n", " description=\"The Report Manager Agent is responsible for supervising data collection from various weather websites and compiling reports as necessary.\",\n", " instructions=\"As a Report Manager Agent, your role involves direct interaction and oversight of the BrowsingAgent's operations. Your primary duty is to guarantee that the user's task is comprehensively and accurately completed. Achieve this by methodically breaking down each task from the user into smaller steps required to complete it. Then, issue each step of the task as a distinct message to the BrowsingAgent. Make sure to always tell the browsing agent to go back to google search results before proceeding to the the next source. After the necessary data is collection, compile a report and send it to the user. Make sure to ask the browsing agent for direct links to the sources and include them into report. Try to trouble shoot any issues that may arise along the way with the other agents first, before reporting back to the user. Do not respond to the user until the report is complete or you have encountered an issue that you cannot resolve yourself.\")" - ], - "metadata": { - "collapsed": false - }, - "id": "55d911e7d32a509c", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "2215c629454380d1", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "browsing_agent = BrowsingAgent()" - ], - "metadata": { - "collapsed": false - }, - "id": "2215c629454380d1", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6fcafb1fdf523943", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "agency = Agency([report_manager,\n", " [report_manager, browsing_agent]],\n", " shared_instructions=\"You are a part of a data collection agency with the goal to find the most relevant information about people on the web. Your core value is autonomy and you are free to use any means necessary to achieve your goal. You do not stop until you have found the information you need or you have exhausted all possible means. You always to to compile a comprehensive report with as much information from the web pages as possible.\")" - ], - "metadata": { - "collapsed": false - }, - "id": "6fcafb1fdf523943", - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "Reload the notebook each time you run the cell below" - ], + "id": "fc27d1ed-678c-4a22-b465-f306db91e76e", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, - "id": "f735bed0fe50e590" + "source": [ + "Reload the notebook each time you run the cell below" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "6e622ad186d4fef8", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "agency.demo_gradio(height=900)" - ], - "metadata": { - "collapsed": false - }, - "id": "6e622ad186d4fef8", - "execution_count": null + ] }, { "cell_type": "markdown", - "source": [ - "Compile a report on Arsenii Shatokhin from the top 3 sources on google" - ], + "id": "d1fac448-98ff-44eb-aa17-b3125381aa24", "metadata": { - "collapsed": false + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } }, - "id": "83024788dfcf7031" + "source": [ + "Compile a report on Arsenii Shatokhin from the top 3 sources on google" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "25ce5ab2798e019b", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "demo.close()" - ], - "metadata": { - "collapsed": false - }, - "id": "25ce5ab2798e019b", - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "cbf09c8e-5599-4e15-adb6-e17e26775ce3", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "source": [ "Here are the instructions:\n", "1. Tell browsing agent to to https://www.youtube.com/results?search_query=ai&sp=EgIQAg%253D%253D, which is a search results page for all channels on ai\n", @@ -393,160 +388,55 @@ "6. Copy email \n", "7. Repeat from step 1 for top 5 channels\n", "8. Send emails back to me" - ], - "metadata": { - "collapsed": false - }, - "id": "7ae90d08019d1f60" + ] }, { "cell_type": "markdown", + "id": "2f24a9af-c38b-4e59-8237-5aca8a711b70", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "source": [ "# Breaking Captchas\n", "You can run this example with no additional configuration.\n", "\n", "However, to add your own cookies, go to `chrome://version/` Then copy Profile path folder and paste it into Chrome Canary installation folder. You might also need to login with google first time the browser window opens. Don't forget to allow less secure apps: https://support.google.com/accounts/answer/6010255?hl=en" - ], - "metadata": { - "collapsed": false - }, - "id": "310a18bde1649e3c" + ] }, { "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Requirement already satisfied: openai==1.5.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 1)) (1.5.0)\r\n", - "Requirement already satisfied: instructor==0.4.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 2)) (0.4.5)\r\n", - "Requirement already satisfied: deepdiff==6.7.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 3)) (6.7.1)\r\n", - "Requirement already satisfied: termcolor==2.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 4)) (2.3.0)\r\n", - "Requirement already satisfied: python-dotenv==1.0.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 5)) (1.0.0)\r\n", - "Requirement already satisfied: rich==13.7.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from -r ../requirements.txt (line 6)) (13.7.0)\r\n", - "Requirement already satisfied: anyio<5,>=3.5.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (3.7.1)\r\n", - "Requirement already satisfied: distro<2,>=1.7.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (1.8.0)\r\n", - "Requirement already satisfied: httpx<1,>=0.23.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (0.25.2)\r\n", - "Requirement already satisfied: pydantic<3,>=1.9.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (2.5.2)\r\n", - "Requirement already satisfied: sniffio in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (1.3.0)\r\n", - "Requirement already satisfied: tqdm>4 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (4.66.1)\r\n", - "Requirement already satisfied: typing-extensions<5,>=4.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from openai==1.5.0->-r ../requirements.txt (line 1)) (4.9.0)\r\n", - "Requirement already satisfied: aiohttp<4.0.0,>=3.9.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from instructor==0.4.5->-r ../requirements.txt (line 2)) (3.9.1)\r\n", - "Requirement already satisfied: docstring-parser<0.16,>=0.15 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from instructor==0.4.5->-r ../requirements.txt (line 2)) (0.15)\r\n", - "Requirement already satisfied: typer<0.10.0,>=0.9.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from instructor==0.4.5->-r ../requirements.txt (line 2)) (0.9.0)\r\n", - "Requirement already satisfied: ordered-set<4.2.0,>=4.0.2 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from deepdiff==6.7.1->-r ../requirements.txt (line 3)) (4.1.0)\r\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich==13.7.0->-r ../requirements.txt (line 6)) (3.0.0)\r\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich==13.7.0->-r ../requirements.txt (line 6)) (2.15.1)\r\n", - "Requirement already satisfied: attrs>=17.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (23.1.0)\r\n", - "Requirement already satisfied: multidict<7.0,>=4.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (6.0.4)\r\n", - "Requirement already satisfied: yarl<2.0,>=1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (1.9.3)\r\n", - "Requirement already satisfied: frozenlist>=1.1.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (1.4.0)\r\n", - "Requirement already satisfied: aiosignal>=1.1.2 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (1.3.1)\r\n", - "Requirement already satisfied: async-timeout<5.0,>=4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from aiohttp<4.0.0,>=3.9.1->instructor==0.4.5->-r ../requirements.txt (line 2)) (4.0.3)\r\n", - "Requirement already satisfied: idna>=2.8 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from anyio<5,>=3.5.0->openai==1.5.0->-r ../requirements.txt (line 1)) (3.4)\r\n", - "Requirement already satisfied: exceptiongroup in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from anyio<5,>=3.5.0->openai==1.5.0->-r ../requirements.txt (line 1)) (1.0.4)\r\n", - "Requirement already satisfied: certifi in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from httpx<1,>=0.23.0->openai==1.5.0->-r ../requirements.txt (line 1)) (2023.11.17)\r\n", - "Requirement already satisfied: httpcore==1.* in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from httpx<1,>=0.23.0->openai==1.5.0->-r ../requirements.txt (line 1)) (1.0.2)\r\n", - "Requirement already satisfied: h11<0.15,>=0.13 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from httpcore==1.*->httpx<1,>=0.23.0->openai==1.5.0->-r ../requirements.txt (line 1)) (0.14.0)\r\n", - "Requirement already satisfied: mdurl~=0.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich==13.7.0->-r ../requirements.txt (line 6)) (0.1.2)\r\n", - "Requirement already satisfied: annotated-types>=0.4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic<3,>=1.9.0->openai==1.5.0->-r ../requirements.txt (line 1)) (0.6.0)\r\n", - "Requirement already satisfied: pydantic-core==2.14.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic<3,>=1.9.0->openai==1.5.0->-r ../requirements.txt (line 1)) (2.14.5)\r\n", - "Requirement already satisfied: click<9.0.0,>=7.1.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer<0.10.0,>=0.9.0->instructor==0.4.5->-r ../requirements.txt (line 2)) (8.1.7)\r\n", - "Requirement already satisfied: selenium in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.16.0)\r\n", - "Requirement already satisfied: webdriver-manager in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.0.1)\r\n", - "Requirement already satisfied: selenium_stealth in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (1.0.6)\r\n", - "Requirement already satisfied: gradio in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (4.9.1)\r\n", - "Requirement already satisfied: urllib3<3,>=1.26 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from urllib3[socks]<3,>=1.26->selenium) (1.26.18)\r\n", - "Requirement already satisfied: trio~=0.17 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (0.23.2)\r\n", - "Requirement already satisfied: trio-websocket~=0.9 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (0.11.1)\r\n", - "Requirement already satisfied: certifi>=2021.10.8 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from selenium) (2023.11.17)\r\n", - "Requirement already satisfied: requests in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (2.31.0)\r\n", - "Requirement already satisfied: python-dotenv in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (1.0.0)\r\n", - "Requirement already satisfied: packaging in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from webdriver-manager) (23.1)\r\n", - "Requirement already satisfied: aiofiles<24.0,>=22.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (23.2.1)\r\n", - "Requirement already satisfied: altair<6.0,>=4.2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (5.2.0)\r\n", - "Requirement already satisfied: fastapi in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.105.0)\r\n", - "Requirement already satisfied: ffmpy in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.3.1)\r\n", - "Requirement already satisfied: gradio-client==0.7.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.7.3)\r\n", - "Requirement already satisfied: httpx in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.25.2)\r\n", - "Requirement already satisfied: huggingface-hub>=0.19.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.19.4)\r\n", - "Requirement already satisfied: importlib-resources<7.0,>=1.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (6.1.1)\r\n", - "Requirement already satisfied: jinja2<4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.1.2)\r\n", - "Requirement already satisfied: markupsafe~=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.1.1)\r\n", - "Requirement already satisfied: matplotlib~=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.8.2)\r\n", - "Requirement already satisfied: numpy~=1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (1.26.2)\r\n", - "Requirement already satisfied: orjson~=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (3.9.10)\r\n", - "Requirement already satisfied: pandas<3.0,>=1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.1.4)\r\n", - "Requirement already satisfied: pillow<11.0,>=8.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (10.1.0)\r\n", - "Requirement already satisfied: pydantic>=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.5.2)\r\n", - "Requirement already satisfied: pydub in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.25.1)\r\n", - "Requirement already satisfied: python-multipart in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.0.6)\r\n", - "Requirement already satisfied: pyyaml<7.0,>=5.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (6.0.1)\r\n", - "Requirement already satisfied: semantic-version~=2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (2.10.0)\r\n", - "Requirement already satisfied: tomlkit==0.12.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.12.0)\r\n", - "Requirement already satisfied: typer<1.0,>=0.9 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.9.0)\r\n", - "Requirement already satisfied: typing-extensions~=4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (4.9.0)\r\n", - "Requirement already satisfied: uvicorn>=0.14.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio) (0.24.0.post1)\r\n", - "Requirement already satisfied: fsspec in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio-client==0.7.3->gradio) (2023.12.2)\r\n", - "Requirement already satisfied: websockets<12.0,>=10.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from gradio-client==0.7.3->gradio) (11.0.3)\r\n", - "Requirement already satisfied: jsonschema>=3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (4.19.2)\r\n", - "Requirement already satisfied: toolz in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio) (0.12.0)\r\n", - "Requirement already satisfied: filelock in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (3.13.1)\r\n", - "Requirement already satisfied: tqdm>=4.42.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from huggingface-hub>=0.19.3->gradio) (4.66.1)\r\n", - "Requirement already satisfied: contourpy>=1.0.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.2.0)\r\n", - "Requirement already satisfied: cycler>=0.10 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (0.12.1)\r\n", - "Requirement already satisfied: fonttools>=4.22.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (4.46.0)\r\n", - "Requirement already satisfied: kiwisolver>=1.3.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (1.4.5)\r\n", - "Requirement already satisfied: pyparsing>=2.3.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (3.1.1)\r\n", - "Requirement already satisfied: python-dateutil>=2.7 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from matplotlib~=3.0->gradio) (2.8.2)\r\n", - "Requirement already satisfied: pytz>=2020.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3.post1)\r\n", - "Requirement already satisfied: tzdata>=2022.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio) (2023.3)\r\n", - "Requirement already satisfied: annotated-types>=0.4.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (0.6.0)\r\n", - "Requirement already satisfied: pydantic-core==2.14.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from pydantic>=2.0->gradio) (2.14.5)\r\n", - "Requirement already satisfied: attrs>=20.1.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (23.1.0)\r\n", - "Requirement already satisfied: sortedcontainers in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (2.4.0)\r\n", - "Requirement already satisfied: idna in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (3.4)\r\n", - "Requirement already satisfied: outcome in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.3.0.post0)\r\n", - "Requirement already satisfied: sniffio>=1.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.3.0)\r\n", - "Requirement already satisfied: exceptiongroup in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio~=0.17->selenium) (1.0.4)\r\n", - "Requirement already satisfied: wsproto>=0.14 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from trio-websocket~=0.9->selenium) (1.2.0)\r\n", - "Requirement already satisfied: click<9.0.0,>=7.1.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer<1.0,>=0.9->typer[all]<1.0,>=0.9->gradio) (8.1.7)\r\n", - "Requirement already satisfied: colorama<0.5.0,>=0.4.3 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (0.4.6)\r\n", - "Requirement already satisfied: shellingham<2.0.0,>=1.3.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (1.5.4)\r\n", - "Requirement already satisfied: rich<14.0.0,>=10.11.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from typer[all]<1.0,>=0.9->gradio) (13.7.0)\r\n", - "Requirement already satisfied: PySocks!=1.5.7,<2.0,>=1.5.6 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from urllib3[socks]<3,>=1.26->selenium) (1.7.1)\r\n", - "Requirement already satisfied: h11>=0.8 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio) (0.14.0)\r\n", - "Requirement already satisfied: anyio<4.0.0,>=3.7.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from fastapi->gradio) (3.7.1)\r\n", - "Requirement already satisfied: starlette<0.28.0,>=0.27.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from fastapi->gradio) (0.27.0)\r\n", - "Requirement already satisfied: httpcore==1.* in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from httpx->gradio) (1.0.2)\r\n", - "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from requests->webdriver-manager) (2.0.4)\r\n", - "Requirement already satisfied: jsonschema-specifications>=2023.03.6 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (2023.7.1)\r\n", - "Requirement already satisfied: referencing>=0.28.4 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.30.2)\r\n", - "Requirement already satisfied: rpds-py>=0.7.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio) (0.10.6)\r\n", - "Requirement already satisfied: six>=1.5 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio) (1.16.0)\r\n", - "Requirement already satisfied: markdown-it-py>=2.2.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (3.0.0)\r\n", - "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (2.15.1)\r\n", - "Requirement already satisfied: mdurl~=0.1 in /Users/vrsen/Projects/agency swarm/agency-swarm/env/lib/python3.10/site-packages (from markdown-it-py>=2.2.0->rich<14.0.0,>=10.11.0->typer[all]<1.0,>=0.9->gradio) (0.1.2)\r\n" - ] - } - ], - "source": [ - "!pip install -r ../requirements.txt\n", - "!pip install selenium webdriver-manager selenium_stealth gradio" - ], + "execution_count": null, + "id": "f574bd57b35088b8", "metadata": { - "collapsed": false, "ExecuteTime": { "end_time": "2024-01-04T04:22:06.368573Z", "start_time": "2024-01-04T04:22:04.471011Z" - } + }, + "collapsed": false, + "jupyter": { + "outputs_hidden": false + }, + "scrolled": true }, - "id": "f574bd57b35088b8", - "execution_count": 2 + "outputs": [], + "source": [ + "!pip install -r ../requirements.txt\n", + "!pip install selenium webdriver-manager selenium_stealth gradio" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "b3bcb53e3e0638f6", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "import sys\n", @@ -555,109 +445,123 @@ "%load_ext autoreload\n", "\n", "%autoreload 2" - ], - "metadata": { - "collapsed": false - }, - "id": "b3bcb53e3e0638f6", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "97376adcafed4820", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm import set_openai_key\n", "set_openai_key(\"YOUR_OPENAI_API_KEY\")" - ], - "metadata": { - "collapsed": false - }, - "id": "97376adcafed4820" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "86e2966a4afe3a89", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "from agency_swarm.agents.browsing import BrowsingAgent\n", "from agency_swarm import Agency" - ], - "metadata": { - "collapsed": false - }, - "id": "86e2966a4afe3a89", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "10b3ec1a2bd49658", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "browsing_agent = BrowsingAgent(selenium_config={\n", " #\"chrome_profile_path\": \"/Users/vrsen/Library/Application Support/Google/Chrome Canary/Profile 5\", # path to your canary chrome profile\n", " \"headless\": False, # set to True if you don't want to see the browser\n", "})" - ], - "metadata": { - "collapsed": false - }, - "id": "10b3ec1a2bd49658", - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, + "id": "5f343de7bd09c6db", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "agency = Agency([browsing_agent],shared_instructions=\"\")" - ], - "metadata": { - "collapsed": false - }, - "id": "5f343de7bd09c6db", - "execution_count": null + ] }, { "cell_type": "markdown", + "id": "dab211ec-1367-4aef-884c-d788a553a7dc", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "source": [ "### Task Instructions:\n", "\n", "Go to https://www.google.com/recaptcha/api2/demo and use solve captcha tool" - ], - "metadata": { - "collapsed": false - }, - "id": "fdb57def81bb0fdf" + ] }, { "cell_type": "code", + "execution_count": null, + "id": "db538b4b13cdff38", + "metadata": { + "collapsed": false, + "jupyter": { + "outputs_hidden": false + } + }, "outputs": [], "source": [ "# Reload the notebook each time you run this cell \n", "# Additionally, do not change browser window size, or it will not work\n", "agency.demo_gradio(height=600)" - ], - "metadata": { - "collapsed": false - }, - "id": "db538b4b13cdff38", - "execution_count": null + ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.6" + "pygments_lexer": "ipython3", + "version": "3.10.13" } }, "nbformat": 4,