{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "provenance": [] }, "kernelspec": { "name": "python3", "display_name": "Python 3" }, "language_info": { "name": "python" } }, "cells": [ { "cell_type": "code", "execution_count": 25, "metadata": { "id": "LYLftQMbY-LW", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "4cff713f-8711-40e7-9c94-49aa3cc02bcb" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: smolagents[toolkit] in /usr/local/lib/python3.11/dist-packages (1.14.0)\n", "\u001b[33mWARNING: smolagents 1.14.0 does not provide the extra 'toolkit'\u001b[0m\u001b[33m\n", "\u001b[0mRequirement already satisfied: huggingface-hub>=0.28.0 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (0.30.2)\n", "Requirement already satisfied: requests>=2.32.3 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (2.32.3)\n", "Requirement already satisfied: rich>=13.9.4 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (13.9.4)\n", "Requirement already satisfied: jinja2>=3.1.4 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (3.1.6)\n", "Requirement already satisfied: pillow>=11.0.0 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (11.2.1)\n", "Requirement already satisfied: markdownify>=0.14.1 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (1.1.0)\n", "Requirement already satisfied: duckduckgo-search>=6.3.7 in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (8.0.1)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.11/dist-packages (from smolagents[toolkit]) (1.1.0)\n", "Requirement already satisfied: click>=8.1.8 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents[toolkit]) (8.1.8)\n", "Requirement already satisfied: primp>=0.15.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents[toolkit]) (0.15.0)\n", "Requirement already satisfied: lxml>=5.3.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents[toolkit]) (5.4.0)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (3.18.0)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (2025.3.2)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (6.0.2)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (4.67.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents[toolkit]) (4.13.2)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2>=3.1.4->smolagents[toolkit]) (3.0.2)\n", "Requirement already satisfied: beautifulsoup4<5,>=4.9 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents[toolkit]) (4.13.4)\n", "Requirement already satisfied: six<2,>=1.15 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents[toolkit]) (1.17.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents[toolkit]) (3.4.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents[toolkit]) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents[toolkit]) (2.4.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents[toolkit]) (2025.4.26)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents[toolkit]) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents[toolkit]) (2.19.1)\n", "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.11/dist-packages (from beautifulsoup4<5,>=4.9->markdownify>=0.14.1->smolagents[toolkit]) (2.7)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich>=13.9.4->smolagents[toolkit]) (0.1.2)\n" ] } ], "source": [ "!pip install -U smolagents[toolkit]\n" ] }, { "cell_type": "code", "source": [ "!pip install smolagents # Install smolagents" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "GQxYhy7ludJB", "outputId": "4e1dd9ea-603a-4154-d51e-4cf630d99c9b" }, "execution_count": 15, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: smolagents in /usr/local/lib/python3.11/dist-packages (1.14.0)\n", "Requirement already satisfied: huggingface-hub>=0.28.0 in /usr/local/lib/python3.11/dist-packages (from smolagents) (0.30.2)\n", "Requirement already satisfied: requests>=2.32.3 in /usr/local/lib/python3.11/dist-packages (from smolagents) (2.32.3)\n", "Requirement already satisfied: rich>=13.9.4 in /usr/local/lib/python3.11/dist-packages (from smolagents) (13.9.4)\n", "Requirement already satisfied: jinja2>=3.1.4 in /usr/local/lib/python3.11/dist-packages (from smolagents) (3.1.6)\n", "Requirement already satisfied: pillow>=11.0.0 in /usr/local/lib/python3.11/dist-packages (from smolagents) (11.2.1)\n", "Requirement already satisfied: markdownify>=0.14.1 in /usr/local/lib/python3.11/dist-packages (from smolagents) (1.1.0)\n", "Requirement already satisfied: duckduckgo-search>=6.3.7 in /usr/local/lib/python3.11/dist-packages (from smolagents) (8.0.1)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.11/dist-packages (from smolagents) (1.1.0)\n", "Requirement already satisfied: click>=8.1.8 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (8.1.8)\n", "Requirement already satisfied: primp>=0.15.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (0.15.0)\n", "Requirement already satisfied: lxml>=5.3.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (5.4.0)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (3.18.0)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (2025.3.2)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (6.0.2)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (4.67.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (4.13.2)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2>=3.1.4->smolagents) (3.0.2)\n", "Requirement already satisfied: beautifulsoup4<5,>=4.9 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents) (4.13.4)\n", "Requirement already satisfied: six<2,>=1.15 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents) (1.17.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (3.4.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (2.4.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (2025.4.26)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents) (2.19.1)\n", "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.11/dist-packages (from beautifulsoup4<5,>=4.9->markdownify>=0.14.1->smolagents) (2.7)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich>=13.9.4->smolagents) (0.1.2)\n" ] } ] }, { "cell_type": "code", "source": [ "!pip install --upgrade smolagents # Update smolagents to the latest version" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "6BTZt6Gquy_k", "outputId": "81a90b9c-f85a-4569-9a69-33d1226353dc" }, "execution_count": 20, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: smolagents in /usr/local/lib/python3.11/dist-packages (1.14.0)\n", "Requirement already satisfied: huggingface-hub>=0.28.0 in /usr/local/lib/python3.11/dist-packages (from smolagents) (0.30.2)\n", "Requirement already satisfied: requests>=2.32.3 in /usr/local/lib/python3.11/dist-packages (from smolagents) (2.32.3)\n", "Requirement already satisfied: rich>=13.9.4 in /usr/local/lib/python3.11/dist-packages (from smolagents) (13.9.4)\n", "Requirement already satisfied: jinja2>=3.1.4 in /usr/local/lib/python3.11/dist-packages (from smolagents) (3.1.6)\n", "Requirement already satisfied: pillow>=11.0.0 in /usr/local/lib/python3.11/dist-packages (from smolagents) (11.2.1)\n", "Requirement already satisfied: markdownify>=0.14.1 in /usr/local/lib/python3.11/dist-packages (from smolagents) (1.1.0)\n", "Requirement already satisfied: duckduckgo-search>=6.3.7 in /usr/local/lib/python3.11/dist-packages (from smolagents) (8.0.1)\n", "Requirement already satisfied: python-dotenv in /usr/local/lib/python3.11/dist-packages (from smolagents) (1.1.0)\n", "Requirement already satisfied: click>=8.1.8 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (8.1.8)\n", "Requirement already satisfied: primp>=0.15.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (0.15.0)\n", "Requirement already satisfied: lxml>=5.3.0 in /usr/local/lib/python3.11/dist-packages (from duckduckgo-search>=6.3.7->smolagents) (5.4.0)\n", "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (3.18.0)\n", "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (2025.3.2)\n", "Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (24.2)\n", "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (6.0.2)\n", "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (4.67.1)\n", "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.0->smolagents) (4.13.2)\n", "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2>=3.1.4->smolagents) (3.0.2)\n", "Requirement already satisfied: beautifulsoup4<5,>=4.9 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents) (4.13.4)\n", "Requirement already satisfied: six<2,>=1.15 in /usr/local/lib/python3.11/dist-packages (from markdownify>=0.14.1->smolagents) (1.17.0)\n", "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (3.4.1)\n", "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (3.10)\n", "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (2.4.0)\n", "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests>=2.32.3->smolagents) (2025.4.26)\n", "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents) (3.0.0)\n", "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich>=13.9.4->smolagents) (2.19.1)\n", "Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.11/dist-packages (from beautifulsoup4<5,>=4.9->markdownify>=0.14.1->smolagents) (2.7)\n", "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich>=13.9.4->smolagents) (0.1.2)\n" ] } ] }, { "cell_type": "code", "source": [ "from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel\n", "\n", "# Inicialize o modelo\n", "model = InferenceClientModel()\n", "\n", "# Inicialize a ferramenta de busca\n", "search_tool = DuckDuckGoSearchTool()\n", "\n", "# Crie o agente com a ferramenta de busca\n", "agent = CodeAgent(tools=[search_tool], model=model)\n", "\n", "# Execute uma consulta\n", "response = agent.run(\"Qual a altura do Cristo Redentor?\")\n", "print(response)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "u92U9-FwtYGy", "outputId": "83e41566-a5e7-44cd-8bb5-8ab8e4bb3204" }, "execution_count": 27, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m╭─\u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[1;38;2;212;183;2mNew run\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╮\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mQual a altura do Cristo Redentor?\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m╰─\u001b[0m\u001b[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-Coder-32B-Instruct \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n" ], "text/html": [ "
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮\n",
              "                                                                                                                 \n",
              " Qual a altura do Cristo Redentor?                                                                               \n",
              "                                                                                                                 \n",
              "╰─ InferenceClientModel - Qwen/Qwen2.5-Coder-32B-Instruct ────────────────────────────────────────────────────────╯\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m1\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" ], "text/html": [ "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " ─ \u001b[1mExecuting parsed code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────── \n", " \u001b[38;2;248;248;242;48;2;39;40;34mtranslated_question\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34msearch\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mquery\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mQual a altura do Cristo Redentor?\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mf\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mThe translated question is \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m{\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mtranslated_question\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m}\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m.\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mheight_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mweb_search\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mquery\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mheight of Christ the Redeemer\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mheight_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n" ], "text/html": [ "
Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── \n",
              "  translated_question = search(query=\"Qual a altura do Cristo Redentor?\")                                          \n",
              "  print(f\"The translated question is {translated_question}.\")                                                      \n",
              "  height_info = web_search(query=\"height of Christ the Redeemer\")                                                  \n",
              "  print(height_info)                                                                                               \n",
              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1;31mCode execution failed at line \u001b[0m\u001b[32m'translated_question = search\u001b[0m\u001b[32m(\u001b[0m\u001b[32mquery\u001b[0m\u001b[32m=\u001b[0m\u001b[32m\"Qual\u001b[0m\u001b[32m a altura do Cristo Redentor?\"\u001b[0m\u001b[32m)\u001b[0m\u001b[32m'\u001b[0m\u001b[1;31m due to: \u001b[0m\n", "\u001b[1;31mInterpreterError: Forbidden function evaluation: \u001b[0m\u001b[32m'search'\u001b[0m\u001b[1;31m is not among the explicitly allowed tools or \u001b[0m\n", "\u001b[1;31mdefined/imported in the preceding code\u001b[0m\n" ], "text/html": [ "
Code execution failed at line 'translated_question = search(query=\"Qual a altura do Cristo Redentor?\")' due to: \n",
              "InterpreterError: Forbidden function evaluation: 'search' is not among the explicitly allowed tools or \n",
              "defined/imported in the preceding code\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2m[Step 1: Duration 0.25 seconds| Input tokens: 2,047 | Output tokens: 97]\u001b[0m\n" ], "text/html": [ "
[Step 1: Duration 0.25 seconds| Input tokens: 2,047 | Output tokens: 97]\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m2\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" ], "text/html": [ "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " ─ \u001b[1mExecuting parsed code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────── \n", " \u001b[38;2;248;248;242;48;2;39;40;34mheight_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mweb_search\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mquery\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mheight of Christ the Redeemer\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mheight_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n" ], "text/html": [ "
Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── \n",
              "  height_info = web_search(query=\"height of Christ the Redeemer\")                                                  \n",
              "  print(height_info)                                                                                               \n",
              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1mExecution logs:\u001b[0m\n", "## Search Results\n", "\n", "[Christ the Redeemer | History, Height, & Facts | Britannica](https://www.britannica.com/topic/Christ-the-Redeemer)\n", "Christ the Redeemer, colossal statue of Jesus Christ at the summit of Mount Corcovado, Rio de Janeiro, Brazil. It \n", "was completed in 1931 and stands 98 feet (30 meters) tall. The statue is the largest Art Deco-style sculpture in \n", "the world and is one of Rio de Janeiro's most recognizable landmarks.\n", "\n", "[Christ the Redeemer (statue) - Wikipedia](https://en.wikipedia.org/wiki/Christ_the_Redeemer_(statue))\n", "Christ the Redeemer (Portuguese: Cristo Redentor, standard Brazilian Portuguese: [ˈkɾistu ʁedẽˈtoʁ]) is an Art Deco\n", "statue of Jesus in Rio de Janeiro, Brazil, created by French-Polish sculptor Paul Landowski and built by Brazilian \n", "engineer Heitor da Silva Costa, in collaboration with French engineer Albert Caquot. Romanian sculptor Gheorghe \n", "Leonida sculpted the face.\n", "\n", "[Christ The Redeemer: Height, History, And Significance Of Brazil's \n", "...](https://travelpander.com/christ-the-redeemer-how-tall/)\n", "The exact height of Christ the Redeemer from base to tip is approximately 38 meters (125 feet), including its \n", "pedestal. The statue itself is about 30 meters (98 feet) tall, while the pedestal adds an additional 8 meters (26 \n", "feet). Key measurements of Christ the Redeemer: 1. Total height (statue + pedestal): 38 meters (125 feet) 2.\n", "\n", "[Christ the Redeemer - History, Meaning, Height, Construction & Other \n", "...](https://worldhistoryedu.com/christ-the-redeemer-history-meaning-height-construction-other-notable-facts/)\n", "By 1931, the Christ the Redeemer statue was up and looked over the lands. All in all, it cost, at the time, about a\n", "quarter of a million USD to complete the statue. In today's US Dollar equivalent, that figure is around $ 4 \n", "million. Christ the Redeemer was inaugurated on 12th October 1931. Renovations and Restoration\n", "\n", "[Christ The Redeemer Statue: Fascinating Facts, History, And Height Of \n", "...](https://travelpander.com/brazil-statue-of-christ-the-redeemer-facts/)\n", "The Christ the Redeemer statue in Brazil was completed in 1931. It stands 30 meters tall and has arms measuring 28 \n", "meters. The statue weighs 635 metric tons ... Brazil, stands at a height of 30 meters (98 feet) without its \n", "pedestal. The total height, including the pedestal, reaches 38 meters (125 feet).\n", "\n", "[Dimensions of Christ the Redeemer - Wonders of the \n", "world](https://www.wonders-of-the-world.net/Christ-the-Redeemer/Dimensions-of-Christ-the-Redeemer.php)\n", "Christ the Redeemer of Rio, on the hill of Corcovado, is a large statue, but it is far from being among the highest\n", "in the world. It measures 38m high, of which 8m for the base. ... Total height: 38m; Height of the statue: 30m; \n", "Height of the pedestal: 8m; Height of the head: 3,75m; Lenght of a hand: 3,20m; Width: 8,50m; Total Scope: 28m;\n", "\n", "[Christ the Redeemer: 12 facts about Brazil's beloved \n", "monument](https://www.goaheadtours.com/travel-blog/articles/facts-about-christ-the-redeemer)\n", "The dynamic city on Brazil's southeastern coast is known for many things—its gorgeous beaches, legendary Carnival, \n", "and the iconic, towering statue of Jesus known as Christ the Redeemer, or Cristo Redentor in Portuguese. The statue\n", "stands 98 feet tall with arms spanning 92 feet and sits on a 26-foot-high pedestal.\n", "\n", "[Christ the Redeemer - 7 Wonders](https://7wonders.org/south-america/brazil/rio-de-janeiro/christ-redeemer/)\n", "The statue of Christ the Redeemer is located at the top of Corcovado Mountain. The entire monument of statue of \n", "Christ the Redeemer is 38m high with the statue accounting for 30m and overlooking the city of Rio de Janeiro is \n", "one of the tallest statues in the world; the span from finger tip to fingertip is 28m and there is a small chapel \n", "housed in the base.\n", "\n", "[Christ the Redeemer - Paul Landowski](https://www.paul-landowski.com/en/le-christ-de-rio/)\n", "Height of the head: 3.75 meters. The order of the archbishop of Rio with Heitor da Silva Costa. In May 1922, the \n", "\"catholic Circle\" of Rio takes up a 63 years old idea, which consisted in building a figure of Christ on a hill \n", "overhanging the city and the bay of Rio. Among several proposals for a \"monument with Christ the Redeemer\", the ...\n", "\n", "[Christ The Redeemer Statue (Everything To Know Before A \n", "Visit)](https://thetouristchecklist.com/christ-the-redeemer-statue/)\n", "The Christ the Redeemer Statue is one of the most iconic landmarks in the world. The sheer size and stature of this\n", "colossal statue of Jesus Christ dominate the skyline of Rio de Janeiro, Brazil. At 30 meters tall, not including \n", "its 8 meter pedestal, this masterpiece sits atop Corcovado Mountain, which rises 700 meters above the ground. ...\n", "\n", "Out: None\n" ], "text/html": [ "
Execution logs:\n",
              "## Search Results\n",
              "\n",
              "[Christ the Redeemer | History, Height, & Facts | Britannica](https://www.britannica.com/topic/Christ-the-Redeemer)\n",
              "Christ the Redeemer, colossal statue of Jesus Christ at the summit of Mount Corcovado, Rio de Janeiro, Brazil. It \n",
              "was completed in 1931 and stands 98 feet (30 meters) tall. The statue is the largest Art Deco-style sculpture in \n",
              "the world and is one of Rio de Janeiro's most recognizable landmarks.\n",
              "\n",
              "[Christ the Redeemer (statue) - Wikipedia](https://en.wikipedia.org/wiki/Christ_the_Redeemer_(statue))\n",
              "Christ the Redeemer (Portuguese: Cristo Redentor, standard Brazilian Portuguese: [ˈkɾistu ʁedẽˈtoʁ]) is an Art Deco\n",
              "statue of Jesus in Rio de Janeiro, Brazil, created by French-Polish sculptor Paul Landowski and built by Brazilian \n",
              "engineer Heitor da Silva Costa, in collaboration with French engineer Albert Caquot. Romanian sculptor Gheorghe \n",
              "Leonida sculpted the face.\n",
              "\n",
              "[Christ The Redeemer: Height, History, And Significance Of Brazil's \n",
              "...](https://travelpander.com/christ-the-redeemer-how-tall/)\n",
              "The exact height of Christ the Redeemer from base to tip is approximately 38 meters (125 feet), including its \n",
              "pedestal. The statue itself is about 30 meters (98 feet) tall, while the pedestal adds an additional 8 meters (26 \n",
              "feet). Key measurements of Christ the Redeemer: 1. Total height (statue + pedestal): 38 meters (125 feet) 2.\n",
              "\n",
              "[Christ the Redeemer - History, Meaning, Height, Construction & Other \n",
              "...](https://worldhistoryedu.com/christ-the-redeemer-history-meaning-height-construction-other-notable-facts/)\n",
              "By 1931, the Christ the Redeemer statue was up and looked over the lands. All in all, it cost, at the time, about a\n",
              "quarter of a million USD to complete the statue. In today's US Dollar equivalent, that figure is around $ 4 \n",
              "million. Christ the Redeemer was inaugurated on 12th October 1931. Renovations and Restoration\n",
              "\n",
              "[Christ The Redeemer Statue: Fascinating Facts, History, And Height Of \n",
              "...](https://travelpander.com/brazil-statue-of-christ-the-redeemer-facts/)\n",
              "The Christ the Redeemer statue in Brazil was completed in 1931. It stands 30 meters tall and has arms measuring 28 \n",
              "meters. The statue weighs 635 metric tons ... Brazil, stands at a height of 30 meters (98 feet) without its \n",
              "pedestal. The total height, including the pedestal, reaches 38 meters (125 feet).\n",
              "\n",
              "[Dimensions of Christ the Redeemer - Wonders of the \n",
              "world](https://www.wonders-of-the-world.net/Christ-the-Redeemer/Dimensions-of-Christ-the-Redeemer.php)\n",
              "Christ the Redeemer of Rio, on the hill of Corcovado, is a large statue, but it is far from being among the highest\n",
              "in the world. It measures 38m high, of which 8m for the base. ... Total height: 38m; Height of the statue: 30m; \n",
              "Height of the pedestal: 8m; Height of the head: 3,75m; Lenght of a hand: 3,20m; Width: 8,50m; Total Scope: 28m;\n",
              "\n",
              "[Christ the Redeemer: 12 facts about Brazil's beloved \n",
              "monument](https://www.goaheadtours.com/travel-blog/articles/facts-about-christ-the-redeemer)\n",
              "The dynamic city on Brazil's southeastern coast is known for many things—its gorgeous beaches, legendary Carnival, \n",
              "and the iconic, towering statue of Jesus known as Christ the Redeemer, or Cristo Redentor in Portuguese. The statue\n",
              "stands 98 feet tall with arms spanning 92 feet and sits on a 26-foot-high pedestal.\n",
              "\n",
              "[Christ the Redeemer - 7 Wonders](https://7wonders.org/south-america/brazil/rio-de-janeiro/christ-redeemer/)\n",
              "The statue of Christ the Redeemer is located at the top of Corcovado Mountain. The entire monument of statue of \n",
              "Christ the Redeemer is 38m high with the statue accounting for 30m and overlooking the city of Rio de Janeiro is \n",
              "one of the tallest statues in the world; the span from finger tip to fingertip is 28m and there is a small chapel \n",
              "housed in the base.\n",
              "\n",
              "[Christ the Redeemer - Paul Landowski](https://www.paul-landowski.com/en/le-christ-de-rio/)\n",
              "Height of the head: 3.75 meters. The order of the archbishop of Rio with Heitor da Silva Costa. In May 1922, the \n",
              "\"catholic Circle\" of Rio takes up a 63 years old idea, which consisted in building a figure of Christ on a hill \n",
              "overhanging the city and the bay of Rio. Among several proposals for a \"monument with Christ the Redeemer\", the ...\n",
              "\n",
              "[Christ The Redeemer Statue (Everything To Know Before A \n",
              "Visit)](https://thetouristchecklist.com/christ-the-redeemer-statue/)\n",
              "The Christ the Redeemer Statue is one of the most iconic landmarks in the world. The sheer size and stature of this\n",
              "colossal statue of Jesus Christ dominate the skyline of Rio de Janeiro, Brazil. At 30 meters tall, not including \n",
              "its 8 meter pedestal, this masterpiece sits atop Corcovado Mountain, which rises 700 meters above the ground. ...\n",
              "\n",
              "Out: None\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2m[Step 2: Duration 1.08 seconds| Input tokens: 4,377 | Output tokens: 167]\u001b[0m\n" ], "text/html": [ "
[Step 2: Duration 1.08 seconds| Input tokens: 4,377 | Output tokens: 167]\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m3\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" ], "text/html": [ "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " ─ \u001b[1mExecuting parsed code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────── \n", " \u001b[38;2;248;248;242;48;2;39;40;34mfinal_answer\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m38 meters\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n" ], "text/html": [ "
Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── \n",
              "  final_answer(\"38 meters\")                                                                                        \n",
              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1;38;2;212;183;2mOut - Final answer: 38 meters\u001b[0m\n" ], "text/html": [ "
Out - Final answer: 38 meters\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2m[Step 3: Duration 0.12 seconds| Input tokens: 8,076 | Output tokens: 228]\u001b[0m\n" ], "text/html": [ "
[Step 3: Duration 0.12 seconds| Input tokens: 8,076 | Output tokens: 228]\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "38 meters\n" ] } ] }, { "cell_type": "code", "source": [ "from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel\n", "\n", "# Inicialize o modelo\n", "model = InferenceClientModel()\n", "\n", "# Inicialize a ferramenta de busca\n", "search_tool = DuckDuckGoSearchTool()\n", "\n", "# Crie o agente com a ferramenta de busca\n", "agent = CodeAgent(tools=[search_tool], model=model)\n", "\n", "# Execute uma consulta\n", "response = agent.run(\"Quem foi Ada Lovelace?\")\n", "print(response)\n" ], "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "wPWT5CS5vcHZ", "outputId": "786caad3-610a-437c-e4e1-03b9575e6f92" }, "execution_count": 31, "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m╭─\u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[1;38;2;212;183;2mNew run\u001b[0m\u001b[38;2;212;183;2m \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╮\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mQuem foi Ada Lovelace?\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m│\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", "\u001b[38;2;212;183;2m╰─\u001b[0m\u001b[38;2;212;183;2m InferenceClientModel - Qwen/Qwen2.5-Coder-32B-Instruct \u001b[0m\u001b[38;2;212;183;2m───────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n" ], "text/html": [ "
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮\n",
              "                                                                                                                 \n",
              " Quem foi Ada Lovelace?                                                                                          \n",
              "                                                                                                                 \n",
              "╰─ InferenceClientModel - Qwen/Qwen2.5-Coder-32B-Instruct ────────────────────────────────────────────────────────╯\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m1\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" ], "text/html": [ "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " ─ \u001b[1mExecuting parsed code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────── \n", " \u001b[38;2;248;248;242;48;2;39;40;34mada_lovelace_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mweb_search\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mquery\u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mWho is Ada Lovelace?\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mprint\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mada_lovelace_info\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n" ], "text/html": [ "
Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── \n",
              "  ada_lovelace_info = web_search(query=\"Who is Ada Lovelace?\")                                                     \n",
              "  print(ada_lovelace_info)                                                                                         \n",
              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1mExecution logs:\u001b[0m\n", "## Search Results\n", "\n", "[Ada Lovelace | Biography, Computer, & Facts | Britannica](https://www.britannica.com/biography/Ada-Lovelace)\n", "Ada Lovelace, English mathematician, an associate of Charles Babbage, for whose digital computer prototype, the \n", "Analytical Engine, she created a program in 1843. She has been called the first computer programmer. Ada Lovelace \n", "Day, the second Tuesday in October, honors women's contributions to science and technology.\n", "\n", "[Ada Lovelace - Wikipedia](https://en.wikipedia.org/wiki/Ada_Lovelace)\n", "Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 November 1852), also known as Ada \n", "Lovelace, was an English mathematician and writer chiefly known for her work on Charles Babbage's proposed \n", "mechanical general-purpose computer, the Analytical Engine.She was the first to recognise that the machine had \n", "applications beyond pure calculation.\n", "\n", "[Ada Lovelace - Quotes, Children & Facts - Biography](https://www.biography.com/scholars-educators/ada-lovelace)\n", "Ada Lovelace, born as Augusta Ada Byron on December 10, 1815, was the only legitimate child of the famous poet Lord\n", "George Gordon Byron. Lord Byron's marriage to Lovelace's mother, Lady Anne ...\n", "\n", "[Ada Lovelace: The First Computer Programmer | \n", "Britannica](https://www.britannica.com/story/ada-lovelace-the-first-computer-programmer)\n", "Ada Lovelace was the daughter of the noted poet Lord Byron and Annabella Milbanke Byron. Their marriage lasted \n", "little more than a year, and Ada never met her father. To counteract the \"dangerous\" mental tendencies of Ada's \n", "father, Annabella emphasized music, French, and mathematics in her daughter's studies. ...\n", "\n", "[Biography of Ada Lovelace, First Computer Programmer - \n", "ThoughtCo](https://www.thoughtco.com/ada-lovelace-biography-5113321)\n", "Ada Lovelace (born Augusta Ada Byron; December 10, 1815- November 27, 1852) was an English mathematician who has \n", "been called the first computer programmer for writing an algorithm, or a set of operating instructions, for the \n", "early computing machine built by Charles Babbage in 1821. As the daughter of the famed English Romantic poet Lord \n", "Byron, her life has been characterized as a constant ...\n", "\n", "[Ada Lovelace - National Geographic Kids](https://kids.nationalgeographic.com/history/article/ada-lovelace)\n", "Ada Lovelace excelled at them—and became what some say is the world's first computer programmer. Born in England on\n", "December 10, 1815, Ada was the daughter of the famous poet Lord George Byron and his wife, Lady Anne Byron. Her \n", "father left the family just weeks after Ada's birth, but her mother insisted that her daughter have expert ...\n", "\n", "[10 Facts About Ada Lovelace: The First Computer \n", "Programmer](https://www.historyhit.com/facts-about-ada-lovelace-the-first-computer-programmer/)\n", "Ada Lovelace was born on 10 December 1815 in London, as Augusta Ada Byron, and was the only legitimate child of \n", "Lord George Gordon Byron and his wife Lady Annabella Byron. Today considered one of Britain's greatest Romantic \n", "poets, Lord Byron was infamous for his many affairs and dark moods. Though an unconventional match for the deeply \n", "...\n", "\n", "[Who was Ada? - Ada Lovelace Day](https://findingada.com/about/who-was-ada/)\n", "Who was Ada Lovelace? By Sydney Padua, author of The Thrilling Adventures of Lovelace & Babbage.. Read the longer \n", "biography of Ada Lovelace by Suw Charman-Anderson, taken from our book, A Passion for Science: Stories of Discovery\n", "and Invention, but for a short overview of her life and achievements, read on!. The woman most often known as 'Ada \n", "Lovelace' was born Ada Gordon in 1815, sole ...\n", "\n", "[Ada Lovelace: The World's First Computer Programmer Who Predicted \n", "...](https://www.nist.gov/blogs/taking-measure/ada-lovelace-worlds-first-computer-programmer-who-predicted-artifici\n", "al)\n", "Augusta Ada King, the Countess of Lovelace, was born in London on Dec. 10, 1815.She's most well known as Ada \n", "Lovelace. Her parents were the English poet Lord Byron and Lady Anne Isabella Milbanke.. After her parents' \n", "marriage ended, Lovelace had an isolated childhood at the country estate of her grandparents, where her mother \n", "moved after leaving London.\n", "\n", "[Ada Lovelace - Lemelson](https://lemelson.mit.edu/resources/ada-lovelace)\n", "Ada Lovelace (birth name Augusta Ada Byron) was born in London, England on December 10, 1815 to Anne Milbank and \n", "the famous poet, Lord Byron. Her father and mother separated months after she was born. Lord Byron moved to Greece \n", "where he died when Ada was eight years old. Ada's childhood was not a traditional one.\n", "\n", "Out: None\n" ], "text/html": [ "
Execution logs:\n",
              "## Search Results\n",
              "\n",
              "[Ada Lovelace | Biography, Computer, & Facts | Britannica](https://www.britannica.com/biography/Ada-Lovelace)\n",
              "Ada Lovelace, English mathematician, an associate of Charles Babbage, for whose digital computer prototype, the \n",
              "Analytical Engine, she created a program in 1843. She has been called the first computer programmer. Ada Lovelace \n",
              "Day, the second Tuesday in October, honors women's contributions to science and technology.\n",
              "\n",
              "[Ada Lovelace - Wikipedia](https://en.wikipedia.org/wiki/Ada_Lovelace)\n",
              "Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 November 1852), also known as Ada \n",
              "Lovelace, was an English mathematician and writer chiefly known for her work on Charles Babbage's proposed \n",
              "mechanical general-purpose computer, the Analytical Engine.She was the first to recognise that the machine had \n",
              "applications beyond pure calculation.\n",
              "\n",
              "[Ada Lovelace - Quotes, Children & Facts - Biography](https://www.biography.com/scholars-educators/ada-lovelace)\n",
              "Ada Lovelace, born as Augusta Ada Byron on December 10, 1815, was the only legitimate child of the famous poet Lord\n",
              "George Gordon Byron. Lord Byron's marriage to Lovelace's mother, Lady Anne ...\n",
              "\n",
              "[Ada Lovelace: The First Computer Programmer | \n",
              "Britannica](https://www.britannica.com/story/ada-lovelace-the-first-computer-programmer)\n",
              "Ada Lovelace was the daughter of the noted poet Lord Byron and Annabella Milbanke Byron. Their marriage lasted \n",
              "little more than a year, and Ada never met her father. To counteract the \"dangerous\" mental tendencies of Ada's \n",
              "father, Annabella emphasized music, French, and mathematics in her daughter's studies. ...\n",
              "\n",
              "[Biography of Ada Lovelace, First Computer Programmer - \n",
              "ThoughtCo](https://www.thoughtco.com/ada-lovelace-biography-5113321)\n",
              "Ada Lovelace (born Augusta Ada Byron; December 10, 1815- November 27, 1852) was an English mathematician who has \n",
              "been called the first computer programmer for writing an algorithm, or a set of operating instructions, for the \n",
              "early computing machine built by Charles Babbage in 1821. As the daughter of the famed English Romantic poet Lord \n",
              "Byron, her life has been characterized as a constant ...\n",
              "\n",
              "[Ada Lovelace - National Geographic Kids](https://kids.nationalgeographic.com/history/article/ada-lovelace)\n",
              "Ada Lovelace excelled at them—and became what some say is the world's first computer programmer. Born in England on\n",
              "December 10, 1815, Ada was the daughter of the famous poet Lord George Byron and his wife, Lady Anne Byron. Her \n",
              "father left the family just weeks after Ada's birth, but her mother insisted that her daughter have expert ...\n",
              "\n",
              "[10 Facts About Ada Lovelace: The First Computer \n",
              "Programmer](https://www.historyhit.com/facts-about-ada-lovelace-the-first-computer-programmer/)\n",
              "Ada Lovelace was born on 10 December 1815 in London, as Augusta Ada Byron, and was the only legitimate child of \n",
              "Lord George Gordon Byron and his wife Lady Annabella Byron. Today considered one of Britain's greatest Romantic \n",
              "poets, Lord Byron was infamous for his many affairs and dark moods. Though an unconventional match for the deeply \n",
              "...\n",
              "\n",
              "[Who was Ada? - Ada Lovelace Day](https://findingada.com/about/who-was-ada/)\n",
              "Who was Ada Lovelace? By Sydney Padua, author of The Thrilling Adventures of Lovelace & Babbage.. Read the longer \n",
              "biography of Ada Lovelace by Suw Charman-Anderson, taken from our book, A Passion for Science: Stories of Discovery\n",
              "and Invention, but for a short overview of her life and achievements, read on!. The woman most often known as 'Ada \n",
              "Lovelace' was born Ada Gordon in 1815, sole ...\n",
              "\n",
              "[Ada Lovelace: The World's First Computer Programmer Who Predicted \n",
              "...](https://www.nist.gov/blogs/taking-measure/ada-lovelace-worlds-first-computer-programmer-who-predicted-artifici\n",
              "al)\n",
              "Augusta Ada King, the Countess of Lovelace, was born in London on Dec. 10, 1815.She's most well known as Ada \n",
              "Lovelace. Her parents were the English poet Lord Byron and Lady Anne Isabella Milbanke.. After her parents' \n",
              "marriage ended, Lovelace had an isolated childhood at the country estate of her grandparents, where her mother \n",
              "moved after leaving London.\n",
              "\n",
              "[Ada Lovelace - Lemelson](https://lemelson.mit.edu/resources/ada-lovelace)\n",
              "Ada Lovelace (birth name Augusta Ada Byron) was born in London, England on December 10, 1815 to Anne Milbank and \n",
              "the famous poet, Lord Byron. Her father and mother separated months after she was born. Lord Byron moved to Greece \n",
              "where he died when Ada was eight years old. Ada's childhood was not a traditional one.\n",
              "\n",
              "Out: None\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2m[Step 1: Duration 1.31 seconds| Input tokens: 2,045 | Output tokens: 68]\u001b[0m\n" ], "text/html": [ "
[Step 1: Duration 1.31 seconds| Input tokens: 2,045 | Output tokens: 68]\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m2\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" ], "text/html": [ "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ " ─ \u001b[1mExecuting parsed code:\u001b[0m ──────────────────────────────────────────────────────────────────────────────────────── \n", " \u001b[38;2;248;248;242;48;2;39;40;34mada_lovelace_summary\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;255;70;137;48;2;39;40;34m=\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mAda Lovelace, born as Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 November \u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;230;219;116;48;2;39;40;34m1852), \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mwas an English mathematician and writer. She is best known for her work on Charles Babbage\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m'\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34ms proposed \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mmechanical general-purpose computer, the Analytical Engine. She is recognized as the first computer \u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;230;219;116;48;2;39;40;34mprogrammer \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34m \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34mfor writing an algorithm intended for the Analytical Engine. \u001b[0m\u001b[38;2;230;219;116;48;2;39;40;34m\"\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " \u001b[38;2;248;248;242;48;2;39;40;34mfinal_answer\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m(\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34mada_lovelace_summary\u001b[0m\u001b[38;2;248;248;242;48;2;39;40;34m)\u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n" ], "text/html": [ "
Executing parsed code: ──────────────────────────────────────────────────────────────────────────────────────── \n",
              "  ada_lovelace_summary = (                                                                                         \n",
              "      \"Ada Lovelace, born as Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 November     \n",
              "  1852), \"                                                                                                         \n",
              "      \"was an English mathematician and writer. She is best known for her work on Charles Babbage's proposed \"     \n",
              "      \"mechanical general-purpose computer, the Analytical Engine. She is recognized as the first computer         \n",
              "  programmer \"                                                                                                     \n",
              "      \"for writing an algorithm intended for the Analytical Engine. \"                                              \n",
              "  )                                                                                                                \n",
              "  final_answer(ada_lovelace_summary)                                                                               \n",
              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[1;38;2;212;183;2mOut - Final answer: Ada Lovelace, born as Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 \u001b[0m\n", "\u001b[1;38;2;212;183;2mNovember 1852), was an English mathematician and writer. She is best known for her work on Charles Babbage's \u001b[0m\n", "\u001b[1;38;2;212;183;2mproposed mechanical general-purpose computer, the Analytical Engine. She is recognized as the first computer \u001b[0m\n", "\u001b[1;38;2;212;183;2mprogrammer for writing an algorithm intended for the Analytical Engine. \u001b[0m\n" ], "text/html": [ "
Out - Final answer: Ada Lovelace, born as Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 \n",
              "November 1852), was an English mathematician and writer. She is best known for her work on Charles Babbage's \n",
              "proposed mechanical general-purpose computer, the Analytical Engine. She is recognized as the first computer \n",
              "programmer for writing an algorithm intended for the Analytical Engine. \n",
              "
\n" ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "\u001b[2m[Step 2: Duration 0.10 seconds| Input tokens: 5,344 | Output tokens: 228]\u001b[0m\n" ], "text/html": [ "
[Step 2: Duration 0.10 seconds| Input tokens: 5,344 | Output tokens: 228]\n",
              "
\n" ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Ada Lovelace, born as Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 - 27 November 1852), was an English mathematician and writer. She is best known for her work on Charles Babbage's proposed mechanical general-purpose computer, the Analytical Engine. She is recognized as the first computer programmer for writing an algorithm intended for the Analytical Engine. \n" ] } ] } ] }