From 9402c90ea5ce6c387918468bc2f1d524631cb269 Mon Sep 17 00:00:00 2001 From: Srilakshmi Chavali Date: Wed, 22 Jan 2025 11:50:26 -0800 Subject: [PATCH] docs: added smolagent tracing --- .../tracing/smolagents_tracing_tutorial.ipynb | 844 ++++++++++++++++++ 1 file changed, 844 insertions(+) create mode 100644 tutorials/tracing/smolagents_tracing_tutorial.ipynb diff --git a/tutorials/tracing/smolagents_tracing_tutorial.ipynb b/tutorials/tracing/smolagents_tracing_tutorial.ipynb new file mode 100644 index 0000000000..6f8cf48f5f --- /dev/null +++ b/tutorials/tracing/smolagents_tracing_tutorial.ipynb @@ -0,0 +1,844 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "YNLwNM6nBgYj" + }, + "source": [ + "
\n", + "

\n", + " \"phoenix\n", + "
\n", + "
\n", + " Docs\n", + " |\n", + " GitHub\n", + " |\n", + " Community\n", + "

\n", + "
\n", + "

Tracing Smolagents with Arize Phoenix

" + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Install Dependencies" + ], + "metadata": { + "id": "UAn1qp84jeTe" + } + }, + { + "cell_type": "code", + "source": [ + "!pip install smolagents -q\n", + "!pip install -q arize-phoenix opentelemetry-sdk opentelemetry-exporter-otlp openinference-instrumentation-smolagents" + ], + "metadata": { + "id": "bmsqnhAUgvTH" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "r9X87mdGnpbc" + }, + "source": [ + "## Connect to Phoenix\n" + ] + }, + { + "cell_type": "markdown", + "source": [ + "In this example, we'll use Phoenix as our destination. You could instead add any other exporters you'd like in this approach.\n", + "\n", + "If you need to set up an API key for Phoenix, you can do so [here](https://app.phoenix.arize.com/)." + ], + "metadata": { + "id": "99Qatk6vj2bN" + } + }, + { + "cell_type": "markdown", + "source": [ + "#### Keys\n", + "\n", + "Note: For this colab you'll need:\n", + "\n", + "* Phoenix API key\n", + "* Hugging Face Token" + ], + "metadata": { + "id": "GmVK7vV2lzAv" + } + }, + { + "cell_type": "code", + "source": [ + "import getpass\n", + "import os\n", + "\n", + "# Prompt the user for their API keys if they haven't been set\n", + "if not (phoenix_api_key := os.getenv(\"PHOENIX_API_KEY\")):\n", + " phoenix_api_key = getpass.getpass(\"Enter your Phoenix API Key: \")\n", + "if not (hf_token_value := os.getenv(\"HF_TOKEN\")):\n", + " hf_token_value = getpass.getpass(\"Enter your Hugging Face Token: \")\n", + "\n", + "# Set the environment variables with the provided keys\n", + "os.environ[\"PHOENIX_CLIENT_HEADERS\"] = f\"api_key={phoenix_api_key}\"\n", + "os.environ[\"PHOENIX_COLLECTOR_ENDPOINT\"] = \"https://app.phoenix.arize.com\"\n", + "os.environ[\"HF_TOKEN\"] = f\"{hf_token_value}\"" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "LAfxxKe-jsMe", + "outputId": "f6b89e77-6847-4699-c773-0016e545be9b" + }, + "execution_count": null, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter your Phoenix API Key: ··········\n", + "Enter your Hugging Face Token: ··········\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "source": [ + "### Define the Trace Provider" + ], + "metadata": { + "id": "LVl2XBq9kMT-" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "2F-FOgzRBgYl", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "ac72e04c-6061-4c6f-d3cc-3e9fb56f060e" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "🔭 OpenTelemetry Tracing Details 🔭\n", + "| Phoenix Project: my-agent-app\n", + "| Span Processor: SimpleSpanProcessor\n", + "| Collector Endpoint: localhost:4317\n", + "| Transport: gRPC\n", + "| Transport Headers: {'user-agent': '****'}\n", + "| \n", + "| Using a default SpanProcessor. `add_span_processor` will overwrite this default.\n", + "| \n", + "| `register` has set this TracerProvider as the global OpenTelemetry default.\n", + "| To disable this behavior, call `register` with `set_global_tracer_provider=False`.\n", + "\n" + ] + } + ], + "source": [ + "from phoenix.otel import register\n", + "\n", + "tracer_provider = register(\n", + " project_name=\"my-agent-app\", # Default is 'default'\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "vYT-EU56ni94" + }, + "source": [ + "## Instrument Smolagents\n", + "\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "tJBfBa9uBgYm" + }, + "outputs": [], + "source": [ + "from openinference.instrumentation.smolagents import SmolagentsInstrumentor\n", + "\n", + "SmolagentsInstrumentor().instrument(tracer_provider=tracer_provider)" + ] + }, + { + "cell_type": "markdown", + "source": [ + "## Create your Smolagents & Run\n" + ], + "metadata": { + "id": "DQWEnbi2k7Sf" + } + }, + { + "cell_type": "markdown", + "source": [ + "Now you can create any sort of agent using the smolagents module, and Phoenix will track every step, input, output, tool, and call your agent makes." + ], + "metadata": { + "id": "UgUAi7F3NP35" + } + }, + { + "cell_type": "code", + "source": [ + "from smolagents import (\n", + " CodeAgent,\n", + " ToolCallingAgent,\n", + " ManagedAgent,\n", + " DuckDuckGoSearchTool,\n", + " VisitWebpageTool,\n", + " HfApiModel,\n", + ")\n", + "\n", + "model = HfApiModel()\n", + "\n", + "agent = ToolCallingAgent(\n", + " tools=[DuckDuckGoSearchTool(), VisitWebpageTool()],\n", + " model=model,\n", + ")\n", + "managed_agent = ManagedAgent(\n", + " agent=agent,\n", + " name=\"managed_agent\",\n", + " description=\"This is an agent that can do web search.\",\n", + ")\n", + "manager_agent = CodeAgent(\n", + " tools=[],\n", + " model=model,\n", + " managed_agents=[managed_agent],\n", + ")\n", + "\n", + "manager_agent.run(\n", + " \"What are Smolagents?\"\n", + ")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000 + }, + "id": "gSU1viq7cX4p", + "outputId": "68766edc-9380-4ace-bb03-e73308b0cbe2" + }, + "execution_count": null, + "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[1mWhat are Smolagents?\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 HfApiModel - 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",
+              " What are Smolagents?                                                                                            \n",
+              "                                                                                                                 \n",
+              "╰─ HfApiModel - 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;36m0\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" + ], + "text/html": [ + "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 0 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "WARNING:opentelemetry.attributes:Invalid type ChatMessage for attribute 'output.value' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + " ─ \u001b[1mExecuting this code:\u001b[0m ────────────────────────────────────────────────────────────────────────────────────────── \n", + " \u001b[38;2;248;248;242;48;2;39;40;34msmolagents_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;34mmanaged_agent\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;34mrequest\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;34mWhat are Smolagents? Provide a detailed definition and context.\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;34msmolagents_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 this code: ────────────────────────────────────────────────────────────────────────────────────────── \n",
+              "  smolagents_info = managed_agent(request=\"What are Smolagents? Provide a detailed definition and context.\")       \n",
+              "  print(smolagents_info)                                                                                           \n",
+              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "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[1mYou're a helpful agent named 'managed_agent'.\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYou have been submitted this task by your manager.\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m---\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mTask:\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mWhat are Smolagents? Provide a detailed definition and context.\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m---\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mYou're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1minformation as possible to give them a clear understanding of the answer.\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[1mYour final_answer WILL HAVE to contain these parts:\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 1. Task outcome (short version):\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 2. Task outcome (extremely detailed version):\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m### 3. Additional context (if relevant):\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[1mPut all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mlost.\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mAnd even if your task resolution is not successful, please return as much context as possible, so that your \u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1mmanager can act upon this feedback.\u001b[0m \u001b[38;2;212;183;2m│\u001b[0m\n", + "\u001b[38;2;212;183;2m│\u001b[0m \u001b[1m{additional_prompting}\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 HfApiModel - 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",
+              " You're a helpful agent named 'managed_agent'.                                                                   \n",
+              " You have been submitted this task by your manager.                                                              \n",
+              " ---                                                                                                             \n",
+              " Task:                                                                                                           \n",
+              " What are Smolagents? Provide a detailed definition and context.                                                 \n",
+              " ---                                                                                                             \n",
+              " You're helping your manager solve a wider task: so make sure to not provide a one-line answer, but give as much \n",
+              " information as possible to give them a clear understanding of the answer.                                       \n",
+              "                                                                                                                 \n",
+              " Your final_answer WILL HAVE to contain these parts:                                                             \n",
+              " ### 1. Task outcome (short version):                                                                            \n",
+              " ### 2. Task outcome (extremely detailed version):                                                               \n",
+              " ### 3. Additional context (if relevant):                                                                        \n",
+              "                                                                                                                 \n",
+              " Put all these in your final_answer tool, everything that you do not pass as an argument to final_answer will be \n",
+              " lost.                                                                                                           \n",
+              " And even if your task resolution is not successful, please return as much context as possible, so that your     \n",
+              " manager can act upon this feedback.                                                                             \n",
+              " {additional_prompting}                                                                                          \n",
+              "                                                                                                                 \n",
+              "╰─ HfApiModel - 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;36m0\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" + ], + "text/html": [ + "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 0 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "stream", + "name": "stderr", + "text": [ + "WARNING:opentelemetry.attributes:Invalid type ChatMessage for attribute 'output.value' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ Calling tool: 'web_search' with arguments: {'query': 'What are Smolagents?'} │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
+              "│ Calling tool: 'web_search' with arguments: {'query': 'What are Smolagents?'}                                    │\n",
+              "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Observations: ## Search Results\n", + "\n", + "|Smolagents : Huggingface AI Agent Framework\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://smolagents.org/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "🤗 Smolagents is a minimalist AI agent framework developed by the Hugging Face team, crafted to enable developers \n", + "to deploy robust agents with just a few lines of code. Embracing simplicity and efficiency, smolagents empowers \n", + "large language models \u001b[1m(\u001b[0mLLMs\u001b[1m)\u001b[0m to interact seamlessly with the real world.\n", + "\n", + "|smolagents - Hugging Face\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://huggingface.co/docs/smolagents/index\u001b[0m\u001b[4;94m)\u001b[0m\n", + "smolagents. This library is the simplest framework out there to build powerful agents! By the way, wtf are \n", + "\u001b[32m\"agents\"\u001b[0m? We provide our definition in this page, where you'll also find tips for when to use them or not \n", + "\u001b[1m(\u001b[0mspoilers: you'll often be better off without agents\u001b[1m)\u001b[0m.\n", + "\n", + "|GitHub - huggingface/smolagents: smolagents: a barebones library for \n", + "\u001b[33m...\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://github.com/huggingface/smolagents\u001b[0m\u001b[4;94m)\u001b[0m\n", + "smolagents is a library that enables you to run powerful agents in a few lines of code. It offers: Simplicity: the \n", + "logic for agents fits in ~thousand lines of code \u001b[1m(\u001b[0msee agents.py\u001b[1m)\u001b[0m.We kept abstractions to their minimal shape above \n", + "raw code! 🧑‍💻 First-class support for Code Agents, i.e. agents that write their actions in code \u001b[1m(\u001b[0mas opposed to \n", + "\u001b[32m\"agents being used to write code\"\u001b[0m\u001b[1m)\u001b[0m.\n", + "\n", + "|Introduction to Agents - Hugging Face\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://huggingface.co/docs/smolagents/conceptual_guides/intro_agents\u001b[0m\u001b[4;94m)\u001b[0m\n", + "Why smolagents ? For some low-level agentic use cases, like chains or routers, you can write all the code yourself.\n", + "You'll be much better that way, since it will let you control and understand your system better.\n", + "\n", + "|Introduction to Smolagents: A Hugging Face Agentic \n", + "Framework\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://medium.com/@mauryaanoop3/introduction-to-smolagents-a-hugging-face-agentic-framework-190169b424f\u001b[0m\n", + "\u001b[4;94m4\u001b[0m\u001b[4;94m)\u001b[0m\n", + "What Are Smolagents? Smolagents is a minimalist yet powerful library that enables the construction of AI agents \n", + "with minimal code. By providing a simplified interface, it allows developers to \u001b[33m...\u001b[0m\n", + "\n", + "|Agents - Guided tour - Hugging Face\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://huggingface.co/docs/smolagents/guided_tour\u001b[0m\u001b[4;94m)\u001b[0m\n", + "The system prompt includes: An introduction that explains how the agent should behave and what tools are.; A \n", + "description of all the tools that is defined by a \u001b[1m{\u001b[0m\u001b[1m{\u001b[0mtool_descriptions\u001b[1m}\u001b[0m\u001b[1m}\u001b[0m token that is dynamically replaced at \n", + "runtime with the tools defined/chosen by the user.. The tool description comes from the tool attributes, name, \n", + "description, inputs and output_type, and a simple jinja2 template \u001b[33m...\u001b[0m\n", + "\n", + "|SmolAgents by Hugging Face: Build AI Agents in Under \u001b[1;36m30\u001b[0m \n", + "Lines\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.analyticsvidhya.com/blog/2025/01/smolagents/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "SmolAgents is an innovative library designed to simplify the creation and execution of powerful agents. Developed \n", + "by Hugging Face, it stands out for its minimalist approach, with the entire agent logic encapsulated in \n", + "approximately \u001b[1;36m1\u001b[0m,\u001b[1;36m000\u001b[0m lines of code. This streamlined design ensures ease of use while maintaining robust \n", + "functionality.\n", + "\n", + "|Agents - Guided tour - Smolagents\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://smolagents.org/docs/agents-guided-tour/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "from smolagents import tool @tool def \u001b[1;35mmodel_download_tool\u001b[0m\u001b[1m(\u001b[0mtask: str\u001b[1m)\u001b[0m -> str: \u001b[32m\"\"\u001b[0m\" This is a tool that returns the \n", + "most downloaded model of a given task on the Hugging Face Hub. It returns the name of the checkpoint.\n", + "\n", + "|Smolagents - Smolagents\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://smolagents.org/docs/smolagent-docs/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "This library is the simplest framework out there to build powerful agents! By the way, wtf are \u001b[32m\"agents\"\u001b[0m? We provide\n", + "our definition in this page, where you'll also find tips for when to use them or not \u001b[1m(\u001b[0mspoilers: you'll often be \n", + "better off without agents\u001b[1m)\u001b[0m. This library offers: Simplicity: the logic for agents fits in ~thousand\u001b[33m...\u001b[0m\n", + "\n", + "|Using Smolagents For Code Automation - \n", + "Forbes\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.forbes.com/sites/johnwerner/2025/01/02/using-smolagents-for-code-automation/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "Smolagents and the Democratization of Code. Presumably, the end result is that people are going to be able to \n", + "understand code better. In some ways, this sort of effort has been going on for awhile.\n" + ], + "text/html": [ + "
Observations: ## Search Results\n",
+              "\n",
+              "|Smolagents : Huggingface AI Agent Framework](https://smolagents.org/)\n",
+              "🤗 Smolagents is a minimalist AI agent framework developed by the Hugging Face team, crafted to enable developers \n",
+              "to deploy robust agents with just a few lines of code. Embracing simplicity and efficiency, smolagents empowers \n",
+              "large language models (LLMs) to interact seamlessly with the real world.\n",
+              "\n",
+              "|smolagents - Hugging Face](https://huggingface.co/docs/smolagents/index)\n",
+              "smolagents. This library is the simplest framework out there to build powerful agents! By the way, wtf are \n",
+              "\"agents\"? We provide our definition in this page, where you'll also find tips for when to use them or not \n",
+              "(spoilers: you'll often be better off without agents).\n",
+              "\n",
+              "|GitHub - huggingface/smolagents: smolagents: a barebones library for \n",
+              "...](https://github.com/huggingface/smolagents)\n",
+              "smolagents is a library that enables you to run powerful agents in a few lines of code. It offers: Simplicity: the \n",
+              "logic for agents fits in ~thousand lines of code (see agents.py).We kept abstractions to their minimal shape above \n",
+              "raw code! 🧑‍💻 First-class support for Code Agents, i.e. agents that write their actions in code (as opposed to \n",
+              "\"agents being used to write code\").\n",
+              "\n",
+              "|Introduction to Agents - Hugging Face](https://huggingface.co/docs/smolagents/conceptual_guides/intro_agents)\n",
+              "Why smolagents ? For some low-level agentic use cases, like chains or routers, you can write all the code yourself.\n",
+              "You'll be much better that way, since it will let you control and understand your system better.\n",
+              "\n",
+              "|Introduction to Smolagents: A Hugging Face Agentic \n",
+              "Framework](https://medium.com/@mauryaanoop3/introduction-to-smolagents-a-hugging-face-agentic-framework-190169b424f\n",
+              "4)\n",
+              "What Are Smolagents? Smolagents is a minimalist yet powerful library that enables the construction of AI agents \n",
+              "with minimal code. By providing a simplified interface, it allows developers to ...\n",
+              "\n",
+              "|Agents - Guided tour - Hugging Face](https://huggingface.co/docs/smolagents/guided_tour)\n",
+              "The system prompt includes: An introduction that explains how the agent should behave and what tools are.; A \n",
+              "description of all the tools that is defined by a {{tool_descriptions}} token that is dynamically replaced at \n",
+              "runtime with the tools defined/chosen by the user.. The tool description comes from the tool attributes, name, \n",
+              "description, inputs and output_type, and a simple jinja2 template ...\n",
+              "\n",
+              "|SmolAgents by Hugging Face: Build AI Agents in Under 30 \n",
+              "Lines](https://www.analyticsvidhya.com/blog/2025/01/smolagents/)\n",
+              "SmolAgents is an innovative library designed to simplify the creation and execution of powerful agents. Developed \n",
+              "by Hugging Face, it stands out for its minimalist approach, with the entire agent logic encapsulated in \n",
+              "approximately 1,000 lines of code. This streamlined design ensures ease of use while maintaining robust \n",
+              "functionality.\n",
+              "\n",
+              "|Agents - Guided tour - Smolagents](https://smolagents.org/docs/agents-guided-tour/)\n",
+              "from smolagents import tool @tool def model_download_tool(task: str) -> str: \"\"\" This is a tool that returns the \n",
+              "most downloaded model of a given task on the Hugging Face Hub. It returns the name of the checkpoint.\n",
+              "\n",
+              "|Smolagents - Smolagents](https://smolagents.org/docs/smolagent-docs/)\n",
+              "This library is the simplest framework out there to build powerful agents! By the way, wtf are \"agents\"? We provide\n",
+              "our definition in this page, where you'll also find tips for when to use them or not (spoilers: you'll often be \n",
+              "better off without agents). This library offers: Simplicity: the logic for agents fits in ~thousand...\n",
+              "\n",
+              "|Using Smolagents For Code Automation - \n",
+              "Forbes](https://www.forbes.com/sites/johnwerner/2025/01/02/using-smolagents-for-code-automation/)\n",
+              "Smolagents and the Democratization of Code. Presumably, the end result is that people are going to be able to \n",
+              "understand code better. In some ways, this sort of effort has been going on for awhile.\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2m[Step 0: Duration 0.77 seconds| Input tokens: 1,549 | Output tokens: 25]\u001b[0m\n" + ], + "text/html": [ + "
[Step 0: Duration 0.77 seconds| Input tokens: 1,549 | Output tokens: 25]\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": "stream", + "name": "stderr", + "text": [ + "WARNING:opentelemetry.attributes:Invalid type ChatMessage for attribute 'output.value' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ Calling tool: 'final_answer' with arguments: {'answer': \"### 1. Task outcome (short version):\\\\nSmolagents is a │\n", + "│ minimalist AI agent framework developed by Hugging Face, enabling developers to create powerful agents with │\n", + "│ minimal code. It focuses on simplicity and efficiency, making it easy to deploy agents that can interact with │\n", + "│ the real world using large language models (LLMs).\\\\n### 2. Task outcome (extremely detailed │\n", + "│ version):\\\\nSmolagents is a cutting-edge library developed by the Hugging Face team designed to simplify the │\n", + "│ creation and deployment of AI agents. It is characterized by its minimalist approach, with the core logic │\n", + "│ encapsulated in approximately 1, 000 lines of code. This framework is particularly useful for low-level agentic │\n", + "│ use cases, such as chains or routers, where developers can write custom code to control and understand their │\n", + "│ systems better. Smolagents supports code agents, which write their actions directly in code rather than using │\n", + "│ agents to write code. The library provides a simple interface for defining system prompts, tool descriptions, │\n", + "│ and dynamic tool usage. It is ideal for scenarios where traditional agent frameworks might be overly complex, │\n", + "│ offering a streamlined solution for developers looking to integrate AI agents into their applications.\\\\n### 3. │\n", + "│ Additional context (if relevant):\\\\nSmolagents is part of Hugging Face's efforts to democratize AI development │\n", + "│ by providing accessible tools for developers. It is designed to be easy to use, with comprehensive │\n", + "│ documentation and examples available on the official website and GitHub repository. The framework is │\n", + "│ particularly useful in scenarios where developers need to create agents that can perform specific tasks with │\n", + "│ minimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is │\n", + "│ often recommended to use traditional agent frameworks for more complex applications where the additional │\n", + "│ features and flexibility are necessary.\"} │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
+              "│ Calling tool: 'final_answer' with arguments: {'answer': \"### 1. Task outcome (short version):\\\\nSmolagents is a │\n",
+              "│ minimalist AI agent framework developed by Hugging Face, enabling developers to create powerful agents with     │\n",
+              "│ minimal code. It focuses on simplicity and efficiency, making it easy to deploy agents that can interact with   │\n",
+              "│ the real world using large language models (LLMs).\\\\n### 2. Task outcome (extremely detailed                    │\n",
+              "│ version):\\\\nSmolagents is a cutting-edge library developed by the Hugging Face team designed to simplify the    │\n",
+              "│ creation and deployment of AI agents. It is characterized by its minimalist approach, with the core logic       │\n",
+              "│ encapsulated in approximately 1, 000 lines of code. This framework is particularly useful for low-level agentic │\n",
+              "│ use cases, such as chains or routers, where developers can write custom code to control and understand their    │\n",
+              "│ systems better. Smolagents supports code agents, which write their actions directly in code rather than using   │\n",
+              "│ agents to write code. The library provides a simple interface for defining system prompts, tool descriptions,   │\n",
+              "│ and dynamic tool usage. It is ideal for scenarios where traditional agent frameworks might be overly complex,   │\n",
+              "│ offering a streamlined solution for developers looking to integrate AI agents into their applications.\\\\n### 3. │\n",
+              "│ Additional context (if relevant):\\\\nSmolagents is part of Hugging Face's efforts to democratize AI development  │\n",
+              "│ by providing accessible tools for developers. It is designed to be easy to use, with comprehensive              │\n",
+              "│ documentation and examples available on the official website and GitHub repository. The framework is            │\n",
+              "│ particularly useful in scenarios where developers need to create agents that can perform specific tasks with    │\n",
+              "│ minimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is   │\n",
+              "│ often recommended to use traditional agent frameworks for more complex applications where the additional        │\n",
+              "│ features and flexibility are necessary.\"}                                                                       │\n",
+              "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[1;38;2;212;183;2mFinal answer: ### 1. Task outcome (short version):\\nSmolagents is a minimalist AI agent framework developed by \u001b[0m\n", + "\u001b[1;38;2;212;183;2mHugging Face, enabling developers to create powerful agents with minimal code. It focuses on simplicity and \u001b[0m\n", + "\u001b[1;38;2;212;183;2mefficiency, making it easy to deploy agents that can interact with the real world using large language models \u001b[0m\n", + "\u001b[1;38;2;212;183;2m(LLMs).\\n### 2. Task outcome (extremely detailed version):\\nSmolagents is a cutting-edge library developed by the \u001b[0m\n", + "\u001b[1;38;2;212;183;2mHugging Face team designed to simplify the creation and deployment of AI agents. It is characterized by its \u001b[0m\n", + "\u001b[1;38;2;212;183;2mminimalist approach, with the core logic encapsulated in approximately 1, 000 lines of code. This framework is \u001b[0m\n", + "\u001b[1;38;2;212;183;2mparticularly useful for low-level agentic use cases, such as chains or routers, where developers can write custom \u001b[0m\n", + "\u001b[1;38;2;212;183;2mcode to control and understand their systems better. Smolagents supports code agents, which write their actions \u001b[0m\n", + "\u001b[1;38;2;212;183;2mdirectly in code rather than using agents to write code. The library provides a simple interface for defining \u001b[0m\n", + "\u001b[1;38;2;212;183;2msystem prompts, tool descriptions, and dynamic tool usage. It is ideal for scenarios where traditional agent \u001b[0m\n", + "\u001b[1;38;2;212;183;2mframeworks might be overly complex, offering a streamlined solution for developers looking to integrate AI agents \u001b[0m\n", + "\u001b[1;38;2;212;183;2minto their applications.\\n### 3. Additional context (if relevant):\\nSmolagents is part of Hugging Face's efforts to\u001b[0m\n", + "\u001b[1;38;2;212;183;2mdemocratize AI development by providing accessible tools for developers. It is designed to be easy to use, with \u001b[0m\n", + "\u001b[1;38;2;212;183;2mcomprehensive documentation and examples available on the official website and GitHub repository. The framework is \u001b[0m\n", + "\u001b[1;38;2;212;183;2mparticularly useful in scenarios where developers need to create agents that can perform specific tasks with \u001b[0m\n", + "\u001b[1;38;2;212;183;2mminimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is often\u001b[0m\n", + "\u001b[1;38;2;212;183;2mrecommended to use traditional agent frameworks for more complex applications where the additional features and \u001b[0m\n", + "\u001b[1;38;2;212;183;2mflexibility are necessary.\u001b[0m\n" + ], + "text/html": [ + "
Final answer: ### 1. Task outcome (short version):\\nSmolagents is a minimalist AI agent framework developed by \n",
+              "Hugging Face, enabling developers to create powerful agents with minimal code. It focuses on simplicity and \n",
+              "efficiency, making it easy to deploy agents that can interact with the real world using large language models \n",
+              "(LLMs).\\n### 2. Task outcome (extremely detailed version):\\nSmolagents is a cutting-edge library developed by the \n",
+              "Hugging Face team designed to simplify the creation and deployment of AI agents. It is characterized by its \n",
+              "minimalist approach, with the core logic encapsulated in approximately 1, 000 lines of code. This framework is \n",
+              "particularly useful for low-level agentic use cases, such as chains or routers, where developers can write custom \n",
+              "code to control and understand their systems better. Smolagents supports code agents, which write their actions \n",
+              "directly in code rather than using agents to write code. The library provides a simple interface for defining \n",
+              "system prompts, tool descriptions, and dynamic tool usage. It is ideal for scenarios where traditional agent \n",
+              "frameworks might be overly complex, offering a streamlined solution for developers looking to integrate AI agents \n",
+              "into their applications.\\n### 3. Additional context (if relevant):\\nSmolagents is part of Hugging Face's efforts to\n",
+              "democratize AI development by providing accessible tools for developers. It is designed to be easy to use, with \n",
+              "comprehensive documentation and examples available on the official website and GitHub repository. The framework is \n",
+              "particularly useful in scenarios where developers need to create agents that can perform specific tasks with \n",
+              "minimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is often\n",
+              "recommended to use traditional agent frameworks for more complex applications where the additional features and \n",
+              "flexibility are necessary.\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2m[Step 1: Duration 9.87 seconds| Input tokens: 4,074 | Output tokens: 396]\u001b[0m\n" + ], + "text/html": [ + "
[Step 1: Duration 9.87 seconds| Input tokens: 4,074 | Output tokens: 396]\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[1mExecution logs:\u001b[0m\n", + "### 1. Task outcome (short version):\\nSmolagents is a minimalist AI agent framework developed by Hugging Face, \n", + "enabling developers to create powerful agents with minimal code. It focuses on simplicity and efficiency, making it\n", + "easy to deploy agents that can interact with the real world using large language models (LLMs).\\n### 2. Task \n", + "outcome (extremely detailed version):\\nSmolagents is a cutting-edge library developed by the Hugging Face team \n", + "designed to simplify the creation and deployment of AI agents. It is characterized by its minimalist approach, with\n", + "the core logic encapsulated in approximately 1, 000 lines of code. This framework is particularly useful for \n", + "low-level agentic use cases, such as chains or routers, where developers can write custom code to control and \n", + "understand their systems better. Smolagents supports code agents, which write their actions directly in code rather\n", + "than using agents to write code. The library provides a simple interface for defining system prompts, tool \n", + "descriptions, and dynamic tool usage. It is ideal for scenarios where traditional agent frameworks might be overly \n", + "complex, offering a streamlined solution for developers looking to integrate AI agents into their \n", + "applications.\\n### 3. Additional context (if relevant):\\nSmolagents is part of Hugging Face's efforts to \n", + "democratize AI development by providing accessible tools for developers. It is designed to be easy to use, with \n", + "comprehensive documentation and examples available on the official website and GitHub repository. The framework is \n", + "particularly useful in scenarios where developers need to create agents that can perform specific tasks with \n", + "minimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is often\n", + "recommended to use traditional agent frameworks for more complex applications where the additional features and \n", + "flexibility are necessary.\n", + "\n", + "Out: None\n" + ], + "text/html": [ + "
Execution logs:\n",
+              "### 1. Task outcome (short version):\\nSmolagents is a minimalist AI agent framework developed by Hugging Face, \n",
+              "enabling developers to create powerful agents with minimal code. It focuses on simplicity and efficiency, making it\n",
+              "easy to deploy agents that can interact with the real world using large language models (LLMs).\\n### 2. Task \n",
+              "outcome (extremely detailed version):\\nSmolagents is a cutting-edge library developed by the Hugging Face team \n",
+              "designed to simplify the creation and deployment of AI agents. It is characterized by its minimalist approach, with\n",
+              "the core logic encapsulated in approximately 1, 000 lines of code. This framework is particularly useful for \n",
+              "low-level agentic use cases, such as chains or routers, where developers can write custom code to control and \n",
+              "understand their systems better. Smolagents supports code agents, which write their actions directly in code rather\n",
+              "than using agents to write code. The library provides a simple interface for defining system prompts, tool \n",
+              "descriptions, and dynamic tool usage. It is ideal for scenarios where traditional agent frameworks might be overly \n",
+              "complex, offering a streamlined solution for developers looking to integrate AI agents into their \n",
+              "applications.\\n### 3. Additional context (if relevant):\\nSmolagents is part of Hugging Face's efforts to \n",
+              "democratize AI development by providing accessible tools for developers. It is designed to be easy to use, with \n",
+              "comprehensive documentation and examples available on the official website and GitHub repository. The framework is \n",
+              "particularly useful in scenarios where developers need to create agents that can perform specific tasks with \n",
+              "minimal setup, such as code automation or interacting with external APIs. While Smolagents is powerful, it is often\n",
+              "recommended to use traditional agent frameworks for more complex applications where the additional features and \n",
+              "flexibility are necessary.\n",
+              "\n",
+              "Out: None\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2m[Step 0: Duration 11.08 seconds| Input tokens: 2,525 | Output tokens: 371]\u001b[0m\n" + ], + "text/html": [ + "
[Step 0: Duration 11.08 seconds| Input tokens: 2,525 | Output tokens: 371]\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": "stream", + "name": "stderr", + "text": [ + "WARNING:opentelemetry.attributes:Invalid type ChatMessage for attribute 'output.value' value. Expected one of ['bool', 'str', 'bytes', 'int', 'float'] or a sequence of those types\n" + ] + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + " ─ \u001b[1mExecuting this 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;34mSmolagents is a minimalist AI agent framework developed by Hugging Face, enabling developers to \u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", + " \u001b[38;2;230;219;116;48;2;39;40;34mcreate powerful agents with minimal code. It focuses on simplicity and efficiency, making it easy to deploy \u001b[0m\u001b[48;2;39;40;34m \u001b[0m \n", + " \u001b[38;2;230;219;116;48;2;39;40;34magents that can interact with the real world using large language models (LLMs).\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 this code: ────────────────────────────────────────────────────────────────────────────────────────── \n",
+              "  final_answer(\"Smolagents is a minimalist AI agent framework developed by Hugging Face, enabling developers to    \n",
+              "  create powerful agents with minimal code. It focuses on simplicity and efficiency, making it easy to deploy      \n",
+              "  agents that can interact with the real world using large language models (LLMs).\")                               \n",
+              " ───────────────────────────────────────────────────────────────────────────────────────────────────────────────── \n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[1;38;2;212;183;2mOut - Final answer: Smolagents is a minimalist AI agent framework developed by Hugging Face, enabling developers to\u001b[0m\n", + "\u001b[1;38;2;212;183;2mcreate powerful agents with minimal code. It focuses on simplicity and efficiency, making it easy to deploy agents \u001b[0m\n", + "\u001b[1;38;2;212;183;2mthat can interact with the real world using large language models (LLMs).\u001b[0m\n" + ], + "text/html": [ + "
Out - Final answer: Smolagents is a minimalist AI agent framework developed by Hugging Face, enabling developers to\n",
+              "create powerful agents with minimal code. It focuses on simplicity and efficiency, making it easy to deploy agents \n",
+              "that can interact with the real world using large language models (LLMs).\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2m[Step 1: Duration 2.03 seconds| Input tokens: 5,155 | Output tokens: 461]\u001b[0m\n" + ], + "text/html": [ + "
[Step 1: Duration 2.03 seconds| Input tokens: 5,155 | Output tokens: 461]\n",
+              "
\n" + ] + }, + "metadata": {} + }, + { + "output_type": "execute_result", + "data": { + "text/plain": [ + "'Smolagents is a minimalist AI agent framework developed by Hugging Face, enabling developers to create powerful agents with minimal code. It focuses on simplicity and efficiency, making it easy to deploy agents that can interact with the real world using large language models (LLMs).'" + ], + "application/vnd.google.colaboratory.intrinsic+json": { + "type": "string" + } + }, + "metadata": {}, + "execution_count": 12 + } + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "aOByjYf-XmZp" + }, + "source": [ + " ## ⭐⭐⭐ If you like this guide, please give [Arize Phoenix](https://github.com/Arize-ai/phoenix) a star ⭐⭐⭐" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + }, + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} \ No newline at end of file