diff --git a/T1_WebSearch_Agent/web_search_agent.ipynb b/T1_WebSearch_Agent/web_search_agent.ipynb index 1433708..52bf935 100644 --- a/T1_WebSearch_Agent/web_search_agent.ipynb +++ b/T1_WebSearch_Agent/web_search_agent.ipynb @@ -9,18 +9,9 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "c:\\Users\\RNT\\.conda\\envs\\smolagent\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", - " from .autonotebook import tqdm as notebook_tqdm\n" - ] - } - ], + "outputs": [], "source": [ "from typing import Optional\n", "\n", @@ -38,13 +29,13 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model = LiteLLMModel(\n", - " model_id=\"ollama_chat/llama3.2\",\n", - " api_base=\"http://localhost:11434\", # replace with remote open-ai compatible server if necessary\n", + " model_id=\"ollama_chat/llama3.1\",\n", + " api_base=\"http://192.168.0.117:11434\", # replace with remote open-ai compatible server if necessary\n", " #api_key=\"your-api-key\", # replace with API key if necessary\n", " #num_ctx=8192, # ollama default is 2048 which will often fail horribly. 8192 works for easy tasks, more is better. Check https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator to calculate how much VRAM this will need for the selected model.\n", " )" @@ -59,7 +50,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -75,11 +66,13 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "prompt = \"What is the capital of France?\"" + "# prompt = \"What is the capital of France?\"\n", + "# promt = \"What is the capital of Germany?\"\n", + "prompt = \"who is the current world champion in football?\"" ] }, { @@ -91,660 +84,9 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮\n", - "│ │\n", - "│ What is the capital of France? │\n", - "│ │\n", - "╰─ LiteLLMModel - ollama_chat/llama3.2 ───────────────────────────────────────────────────────────────────────────╯\n", - "\n" - ], - "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 is the capital of France?\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 LiteLLMModel - ollama_chat/llama3.2 \u001b[0m\u001b[38;2;212;183;2m──────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "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" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'capital of France'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", - "\n" - ], - "text/plain": [ - "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'capital of France'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Observations: ## Search Results\n", - "\n", - "|Paris - Wikipedia](https://en.wikipedia.org/wiki/Paris)\n", - "Paris (French pronunciation: ⓘ) is the capital and largest city of France.With an estimated population of 2,048,472\n", - "residents in January 2025 |3] in an area of more than 105 km 2 (41 sq mi), |4] Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in 2022. |5]\n", - "\n", - "|Paris | Definition, Map, Population, Facts, & History | Britannica](https://www.britannica.com/place/Paris)\n", - "Paris, city and capital of France, located along the Seine River, in the north-central part of the country. Paris \n", - "is one of the world's most important and attractive cities, famed for its gastronomy, haute couture, painting, \n", - "literature, and intellectual community. Learn more about Paris in this article.\n", - "\n", - "|France | History, Maps, Flag, Population, Cities, Capital, & Facts ...](https://www.britannica.com/place/France)\n", - "France, a country of northwestern Europe, is historically and culturally among the most important countries in the \n", - "Western world. It has also played a highly significant role in international affairs for centuries. Its capital is \n", - "Paris, one of the most important cultural and commercial centers in the world.\n", - "\n", - "|Paris - Simple English Wikipedia, the free encyclopedia](https://simple.wikipedia.org/wiki/Paris)\n", - "Paris is the capital city and the largest city of France, with a population of about 2.15 million. It has a rich \n", - "history, many art museums, historical buildings, and a famous landmark, the Eiffel Tower.\n", - "\n", - "|List of capitals of France - Wikipedia](https://en.wikipedia.org/wiki/List_of_capitals_of_France)\n", - "Learn about the historical and current capitals of France, from Tournai to Paris. See the chronology of changes, \n", - "the reasons for relocations, and the provisional seats of the government.\n", - "\n", - "|What is the Capital of France? - \n", - "WorldAtlas](https://www.worldatlas.com/articles/what-is-the-capital-of-france.html)\n", - "Learn about the history, geography, economy, tourism, and administration of Paris, the capital city of France and \n", - "the country's largest city. Find out why Paris is called the City of Light and the City of Love.\n", - "\n", - "|Paris: Facts & Related Content - Encyclopedia Britannica](https://www.britannica.com/facts/Paris)\n", - "Learn about Paris, the capital of France, and its history, culture, landmarks, and people. Find out why Paris is \n", - "called \"the City of Light\" and when it was founded, liberated, and attacked.\n", - "\n", - "|Paris - Wikiwand](https://www.wikiwand.com/en/articles/Paris)\n", - "Paris is the capital and largest city of France. With an estimated population of 2,048,472 residents in January \n", - "2025 in an area of more than 105 km2 (41 sq mi),...\n", - "\n", - "|Paris, France - New World Encyclopedia](https://www.newworldencyclopedia.org/entry/Paris,_France)\n", - "Learn about the history, geography, culture, and administration of Paris, the capital city of France and one of the\n", - "world's leading global cities. Find out how Paris got its name, what landmarks and monuments it has, and how it \n", - "became a center of education and ideas.\n", - "\n", - "|Paris - Wikipedia, the free encyclopedia - Wikinews](https://en.wikipedia.beta.wmflabs.org/wiki/Paris)\n", - "Paris (French pronunciation: . REDIRECCIÓN Plantilla:AFI ⓘ) is the capital and most populous city of France, with \n", - "an estimated population of 2,165,423 residents in 2019 in an area of more than 105 square kilometres (41 square \n", - "miles), |3] making it the 34th most densely populated city in the world in 2020. |4] Since the 17th century, Paris \n", - "has been one of the world's major centres of finance ...\n", - "\n" - ], - "text/plain": [ - "Observations: ## Search Results\n", - "\n", - "|Paris - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris \u001b[1m(\u001b[0mFrench pronunciation: ⓘ\u001b[1m)\u001b[0m is the capital and largest city of France.With an estimated population of \u001b[1;36m2\u001b[0m,\u001b[1;36m048\u001b[0m,\u001b[1;36m472\u001b[0m\n", - "residents in January \u001b[1;36m2025\u001b[0m |\u001b[1;36m3\u001b[0m\u001b[1m]\u001b[0m in an area of more than \u001b[1;36m105\u001b[0m km \u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0m\u001b[1;36m41\u001b[0m sq mi\u001b[1m)\u001b[0m, |\u001b[1;36m4\u001b[0m\u001b[1m]\u001b[0m Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in \u001b[1;36m2022\u001b[0m. |\u001b[1;36m5\u001b[0m\u001b[1m]\u001b[0m\n", - "\n", - "|Paris | Definition, Map, Population, Facts, & History | Britannica\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/place/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris, city and capital of France, located along the Seine River, in the north-central part of the country. Paris \n", - "is one of the world's most important and attractive cities, famed for its gastronomy, haute couture, painting, \n", - "literature, and intellectual community. Learn more about Paris in this article.\n", - "\n", - "|France | History, Maps, Flag, Population, Cities, Capital, & Facts \u001b[33m...\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/place/France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "France, a country of northwestern Europe, is historically and culturally among the most important countries in the \n", - "Western world. It has also played a highly significant role in international affairs for centuries. Its capital is \n", - "Paris, one of the most important cultural and commercial centers in the world.\n", - "\n", - "|Paris - Simple English Wikipedia, the free encyclopedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://simple.wikipedia.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris is the capital city and the largest city of France, with a population of about \u001b[1;36m2.15\u001b[0m million. It has a rich \n", - "history, many art museums, historical buildings, and a famous landmark, the Eiffel Tower.\n", - "\n", - "|List of capitals of France - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/List_of_capitals_of_France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the historical and current capitals of France, from Tournai to Paris. See the chronology of changes, \n", - "the reasons for relocations, and the provisional seats of the government.\n", - "\n", - "|What is the Capital of France? - \n", - "WorldAtlas\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.worldatlas.com/articles/what-is-the-capital-of-france.html\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the history, geography, economy, tourism, and administration of Paris, the capital city of France and \n", - "the country's largest city. Find out why Paris is called the City of Light and the City of Love.\n", - "\n", - "|Paris: Facts & Related Content - Encyclopedia Britannica\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/facts/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about Paris, the capital of France, and its history, culture, landmarks, and people. Find out why Paris is \n", - "called \u001b[32m\"the City of Light\"\u001b[0m and when it was founded, liberated, and attacked.\n", - "\n", - "|Paris - Wikiwand\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.wikiwand.com/en/articles/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris is the capital and largest city of France. With an estimated population of \u001b[1;36m2\u001b[0m,\u001b[1;36m048\u001b[0m,\u001b[1;36m472\u001b[0m residents in January \n", - "\u001b[1;36m2025\u001b[0m in an area of more than \u001b[1;36m105\u001b[0m km2 \u001b[1m(\u001b[0m\u001b[1;36m41\u001b[0m sq mi\u001b[1m)\u001b[0m,\u001b[33m...\u001b[0m\n", - "\n", - "|Paris, France - New World Encyclopedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.newworldencyclopedia.org/entry/Paris,_France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the history, geography, culture, and administration of Paris, the capital city of France and one of the\n", - "world's leading global cities. Find out how Paris got its name, what landmarks and monuments it has, and how it \n", - "became a center of education and ideas.\n", - "\n", - "|Paris - Wikipedia, the free encyclopedia - Wikinews\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.beta.wmflabs.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris \u001b[1m(\u001b[0mFrench pronunciation: . REDIRECCIÓN Plantill\u001b[1;92ma:AF\u001b[0mI ⓘ\u001b[1m)\u001b[0m is the capital and most populous city of France, with \n", - "an estimated population of \u001b[1;36m2\u001b[0m,\u001b[1;36m165\u001b[0m,\u001b[1;36m423\u001b[0m residents in \u001b[1;36m2019\u001b[0m in an area of more than \u001b[1;36m105\u001b[0m square kilometres \u001b[1m(\u001b[0m\u001b[1;36m41\u001b[0m square \n", - "miles\u001b[1m)\u001b[0m, |\u001b[1;36m3\u001b[0m\u001b[1m]\u001b[0m making it the 34th most densely populated city in the world in \u001b[1;36m2020\u001b[0m. |\u001b[1;36m4\u001b[0m\u001b[1m]\u001b[0m Since the 17th century, Paris \n", - "has been one of the world's major centres of finance \u001b[33m...\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 0: Duration 6.42 seconds| Input tokens: 1,107 | Output tokens: 19]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 0: Duration 6.42 seconds| Input tokens: 1,107 | Output tokens: 19]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "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" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'capital of France'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", - "\n" - ], - "text/plain": [ - "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'capital of France'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Observations: ## Search Results\n", - "\n", - "|Paris - Wikipedia](https://en.wikipedia.org/wiki/Paris)\n", - "Paris (French pronunciation: ⓘ) is the capital and largest city of France.With an estimated population of 2,048,472\n", - "residents in January 2025 |3] in an area of more than 105 km 2 (41 sq mi), |4] Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in 2022. |5]\n", - "\n", - "|Paris | Definition, Map, Population, Facts, & History | Britannica](https://www.britannica.com/place/Paris)\n", - "Paris, city and capital of France, located along the Seine River, in the north-central part of the country. Paris \n", - "is one of the world's most important and attractive cities, famed for its gastronomy, haute couture, painting, \n", - "literature, and intellectual community. Learn more about Paris in this article.\n", - "\n", - "|France | History, Maps, Flag, Population, Cities, Capital, & Facts ...](https://www.britannica.com/place/France)\n", - "France, a country of northwestern Europe, is historically and culturally among the most important countries in the \n", - "Western world. It has also played a highly significant role in international affairs for centuries. Its capital is \n", - "Paris, one of the most important cultural and commercial centers in the world.\n", - "\n", - "|Paris - Simple English Wikipedia, the free encyclopedia](https://simple.wikipedia.org/wiki/Paris)\n", - "Paris is the capital city and the largest city of France, with a population of about 2.15 million. It has a rich \n", - "history, many art museums, historical buildings, and a famous landmark, the Eiffel Tower.\n", - "\n", - "|What is the Capital of France? - \n", - "WorldAtlas](https://www.worldatlas.com/articles/what-is-the-capital-of-france.html)\n", - "Learn about the history, geography, economy, tourism, and administration of Paris, the capital city of France and \n", - "the country's largest city. Find out why Paris is called the City of Light and the City of Love.\n", - "\n", - "|List of capitals of France - Wikipedia](https://en.wikipedia.org/wiki/List_of_capitals_of_France)\n", - "Learn about the historical and current capitals of France, from Tournai to Paris. See the chronology of changes, \n", - "the reasons for relocations, and the provisional seats of the government.\n", - "\n", - "|Paris: Facts & Related Content - Encyclopedia Britannica](https://www.britannica.com/facts/Paris)\n", - "Learn about Paris, the capital of France, and its history, culture, landmarks, and people. Find out why Paris is \n", - "called \"the City of Light\" and when it was founded, liberated, and attacked.\n", - "\n", - "|Capital of France - Simple English Wikipedia, the free \n", - "encyclopedia](https://simple.wikipedia.org/wiki/Capital_of_France)\n", - "Learn about the history and current status of the capital of France, which is Paris. Find out which other cities \n", - "have been the national capital in different periods of time, from ancient to modern.\n", - "\n", - "|Paris - Kids | Britannica Kids | Homework Help](https://kids.britannica.com/kids/article/Paris/345991)\n", - "Learn about Paris, the capital of France and one of western Europe's major centers of culture and business. \n", - "Discover its famous landmarks, history, economy, and population.\n", - "\n", - "|What is the Capital of France? - Mappr](https://www.mappr.co/capital-cities/france/)\n", - "Learn about Paris, the capital of France, and its rich history, culture, and geography. Discover its landmarks, \n", - "climate, population, and role as a global city.\n", - "\n" - ], - "text/plain": [ - "Observations: ## Search Results\n", - "\n", - "|Paris - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris \u001b[1m(\u001b[0mFrench pronunciation: ⓘ\u001b[1m)\u001b[0m is the capital and largest city of France.With an estimated population of \u001b[1;36m2\u001b[0m,\u001b[1;36m048\u001b[0m,\u001b[1;36m472\u001b[0m\n", - "residents in January \u001b[1;36m2025\u001b[0m |\u001b[1;36m3\u001b[0m\u001b[1m]\u001b[0m in an area of more than \u001b[1;36m105\u001b[0m km \u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0m\u001b[1;36m41\u001b[0m sq mi\u001b[1m)\u001b[0m, |\u001b[1;36m4\u001b[0m\u001b[1m]\u001b[0m Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in \u001b[1;36m2022\u001b[0m. |\u001b[1;36m5\u001b[0m\u001b[1m]\u001b[0m\n", - "\n", - "|Paris | Definition, Map, Population, Facts, & History | Britannica\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/place/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris, city and capital of France, located along the Seine River, in the north-central part of the country. Paris \n", - "is one of the world's most important and attractive cities, famed for its gastronomy, haute couture, painting, \n", - "literature, and intellectual community. Learn more about Paris in this article.\n", - "\n", - "|France | History, Maps, Flag, Population, Cities, Capital, & Facts \u001b[33m...\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/place/France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "France, a country of northwestern Europe, is historically and culturally among the most important countries in the \n", - "Western world. It has also played a highly significant role in international affairs for centuries. Its capital is \n", - "Paris, one of the most important cultural and commercial centers in the world.\n", - "\n", - "|Paris - Simple English Wikipedia, the free encyclopedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://simple.wikipedia.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris is the capital city and the largest city of France, with a population of about \u001b[1;36m2.15\u001b[0m million. It has a rich \n", - "history, many art museums, historical buildings, and a famous landmark, the Eiffel Tower.\n", - "\n", - "|What is the Capital of France? - \n", - "WorldAtlas\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.worldatlas.com/articles/what-is-the-capital-of-france.html\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the history, geography, economy, tourism, and administration of Paris, the capital city of France and \n", - "the country's largest city. Find out why Paris is called the City of Light and the City of Love.\n", - "\n", - "|List of capitals of France - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/List_of_capitals_of_France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the historical and current capitals of France, from Tournai to Paris. See the chronology of changes, \n", - "the reasons for relocations, and the provisional seats of the government.\n", - "\n", - "|Paris: Facts & Related Content - Encyclopedia Britannica\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.britannica.com/facts/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about Paris, the capital of France, and its history, culture, landmarks, and people. Find out why Paris is \n", - "called \u001b[32m\"the City of Light\"\u001b[0m and when it was founded, liberated, and attacked.\n", - "\n", - "|Capital of France - Simple English Wikipedia, the free \n", - "encyclopedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://simple.wikipedia.org/wiki/Capital_of_France\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about the history and current status of the capital of France, which is Paris. Find out which other cities \n", - "have been the national capital in different periods of time, from ancient to modern.\n", - "\n", - "|Paris - Kids | Britannica Kids | Homework Help\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://kids.britannica.com/kids/article/Paris/345991\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about Paris, the capital of France and one of western Europe's major centers of culture and business. \n", - "Discover its famous landmarks, history, economy, and population.\n", - "\n", - "|What is the Capital of France? - Mappr\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.mappr.co/capital-cities/france/\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Learn about Paris, the capital of France, and its rich history, culture, and geography. Discover its landmarks, \n", - "climate, population, and role as a global city.\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 1: Duration 3.40 seconds| Input tokens: 3,139 | Output tokens: 38]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 1: Duration 3.40 seconds| Input tokens: 3,139 | Output tokens: 38]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "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" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'Which city has the highest population in France?'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", - "\n" - ], - "text/plain": [ - "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", - "│ Calling tool: 'web_search' with arguments: {'query': 'Which city has the highest population in France?'} │\n", - "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Observations: ## Search Results\n", - "\n", - "|France Cities by Population 2024 - World Population Review](https://worldpopulationreview.com/cities/france)\n", - "France has 1 cities with more than a million people, 38 cities with between 100,000 and 1 million people, and 915 \n", - "cities with between 10,000 and 100,000 people. The largest city in France is Paris, with a population of 2,138,551 \n", - "people.\n", - "\n", - "|Top 10 largest cities of France by population - French \n", - "Moments](https://frenchmoments.eu/top-10-largest-cities-of-france-by-population/)\n", - "The population of France. Did you know France has a population of 67,795,000 (2018)? This includes 65 million in \n", - "metropolitan France (that is mainland France located in Europe). The country is the 20th most populous in the \n", - "world, representing 0.87% of the total world population. The top 10 largest cities in France\n", - "\n", - "|10 Largest Cities In France By Population](https://largest.org/geography/cities-in-france-by-population/)\n", - "Montpellier has firmly established itself as one of the best places to reside in all of Europe because of its \n", - "robust economy, vibrant cultural and social scene, and one of the most appealing real estate markets in France. The\n", - "city has achieved a balance between modernity and livability, which has allowed it to become the metropolitan \n", - "region in ...\n", - "\n", - "|15 Largest Cities in France, Ranked by Population](https://people.howstuffworks.com/largest-cities-in-france.htm)\n", - "Renowned for its rich history, art and cuisine, this iconic country is home to some of the most beautiful and \n", - "culturally significant cities and towns in the world. Each of the largest cities in France showcases a unique blend\n", - "of heritage, modernity and vibrant local traditions. From bustling metropolises to charming coastal hubs, these \n", - "communities reflect the diverse character of the nation.\n", - "\n", - "|List of communes in France with over 20,000 \n", - "inhabitants](https://en.wikipedia.org/wiki/List_of_communes_in_France_with_over_20,000_inhabitants)\n", - "Map of metropolitan France. As of January 2019, there were 473 communes in France (metropolitan territory and \n", - "overseas departments and regions) with population over 20,000, 280 communes with population over 30,000, 129 \n", - "communes with population over 50,000 and 42 communes with population over 100,000. |1] All figures reflect the \n", - "municipal population (French: population municipale), meaning ...\n", - "\n", - "|The biggest cities in France by population - Learn French With \n", - "Alexa](https://learnfrenchwithalexa.com/blog/the-biggest-cities-in-france-by-population)\n", - "Read on to discover France's ten largest cities. Paris (2.2 million people) It won't surprise you to learn that \n", - "Paris leads the list, with a population of over 2 million. That said, it's only the 10th largest city in Europe. \n", - "Istanbul, the largest, has nearly 16 million inhabitants! ...\n", - "\n", - "|Population of cities in France 2024 - \n", - "StatisticsTimes.com](https://statisticstimes.com/demographics/country/france-cities-population.php)\n", - "List of population cities in France based on the estimates and projections by United Nations. yearwise change in \n", - "population and population growth rate. ... Top 10 largest economies by GDP. See Also: ... » Countries by area; View\n", - "More Demographics Statistics; France cities population; City Population Share (%) Rank Change; 2023 2024 France ...\n", - "\n", - "|List of cities in France by \n", - "population](https://population-hub.com/en/fr/list-of-cities-in-france-by-population.html)\n", - "In total, there are 288 cities in France. The largest city is Paris with a population of 2 240 621 . The total \n", - "population of France is 68859599 people - 0.89% of the total population of the Earth.\n", - "\n", - "|The 20 largest cities in France - wanderlix.com](https://wanderlix.com/post/the-largest-cities-in-france/)\n", - "The 41st largest country in the world, France has 64.5 million inhabitants in 36,681 municipalities. What are the \n", - "20 largest cities in france? Press ESC to close\n", - "\n", - "|Paris - Wikipedia](https://en.wikipedia.org/wiki/Paris)\n", - "Paris (French pronunciation: ⓘ) is the capital and largest city of France.With an estimated population of 2,048,472\n", - "residents in January 2025 |3] in an area of more than 105 km 2 (41 sq mi), |4] Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in 2022. |5]\n", - "\n" - ], - "text/plain": [ - "Observations: ## Search Results\n", - "\n", - "|France Cities by Population \u001b[1;36m2024\u001b[0m - World Population Review\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://worldpopulationreview.com/cities/france\u001b[0m\u001b[4;94m)\u001b[0m\n", - "France has \u001b[1;36m1\u001b[0m cities with more than a million people, \u001b[1;36m38\u001b[0m cities with between \u001b[1;36m100\u001b[0m,\u001b[1;36m000\u001b[0m and \u001b[1;36m1\u001b[0m million people, and \u001b[1;36m915\u001b[0m \n", - "cities with between \u001b[1;36m10\u001b[0m,\u001b[1;36m000\u001b[0m and \u001b[1;36m100\u001b[0m,\u001b[1;36m000\u001b[0m people. The largest city in France is Paris, with a population of \u001b[1;36m2\u001b[0m,\u001b[1;36m138\u001b[0m,\u001b[1;36m551\u001b[0m \n", - "people.\n", - "\n", - "|Top \u001b[1;36m10\u001b[0m largest cities of France by population - French \n", - "Moments\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://frenchmoments.eu/top-10-largest-cities-of-france-by-population/\u001b[0m\u001b[4;94m)\u001b[0m\n", - "The population of France. Did you know France has a population of \u001b[1;36m67\u001b[0m,\u001b[1;36m795\u001b[0m,\u001b[1;36m000\u001b[0m \u001b[1m(\u001b[0m\u001b[1;36m2018\u001b[0m\u001b[1m)\u001b[0m? This includes \u001b[1;36m65\u001b[0m million in \n", - "metropolitan France \u001b[1m(\u001b[0mthat is mainland France located in Europe\u001b[1m)\u001b[0m. The country is the 20th most populous in the \n", - "world, representing \u001b[1;36m0.87\u001b[0m% of the total world population. The top \u001b[1;36m10\u001b[0m largest cities in France\n", - "\n", - "|\u001b[1;36m10\u001b[0m Largest Cities In France By Population\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://largest.org/geography/cities-in-france-by-population/\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Montpellier has firmly established itself as one of the best places to reside in all of Europe because of its \n", - "robust economy, vibrant cultural and social scene, and one of the most appealing real estate markets in France. The\n", - "city has achieved a balance between modernity and livability, which has allowed it to become the metropolitan \n", - "region in \u001b[33m...\u001b[0m\n", - "\n", - "|\u001b[1;36m15\u001b[0m Largest Cities in France, Ranked by Population\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://people.howstuffworks.com/largest-cities-in-france.htm\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Renowned for its rich history, art and cuisine, this iconic country is home to some of the most beautiful and \n", - "culturally significant cities and towns in the world. Each of the largest cities in France showcases a unique blend\n", - "of heritage, modernity and vibrant local traditions. From bustling metropolises to charming coastal hubs, these \n", - "communities reflect the diverse character of the nation.\n", - "\n", - "|List of communes in France with over \u001b[1;36m20\u001b[0m,\u001b[1;36m000\u001b[0m \n", - "inhabitants\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/List_of_communes_in_France_with_over_20,000_inhabitants\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Map of metropolitan France. As of January \u001b[1;36m2019\u001b[0m, there were \u001b[1;36m473\u001b[0m communes in France \u001b[1m(\u001b[0mmetropolitan territory and \n", - "overseas departments and regions\u001b[1m)\u001b[0m with population over \u001b[1;36m20\u001b[0m,\u001b[1;36m000\u001b[0m, \u001b[1;36m280\u001b[0m communes with population over \u001b[1;36m30\u001b[0m,\u001b[1;36m000\u001b[0m, \u001b[1;36m129\u001b[0m \n", - "communes with population over \u001b[1;36m50\u001b[0m,\u001b[1;36m000\u001b[0m and \u001b[1;36m42\u001b[0m communes with population over \u001b[1;36m100\u001b[0m,\u001b[1;36m000\u001b[0m. |\u001b[1;36m1\u001b[0m\u001b[1m]\u001b[0m All figures reflect the \n", - "municipal population \u001b[1m(\u001b[0mFrench: population municipale\u001b[1m)\u001b[0m, meaning \u001b[33m...\u001b[0m\n", - "\n", - "|The biggest cities in France by population - Learn French With \n", - "Alexa\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://learnfrenchwithalexa.com/blog/the-biggest-cities-in-france-by-population\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Read on to discover France's ten largest cities. Paris \u001b[1m(\u001b[0m\u001b[1;36m2.2\u001b[0m million people\u001b[1m)\u001b[0m It won't surprise you to learn that \n", - "Paris leads the list, with a population of over \u001b[1;36m2\u001b[0m million. That said, it's only the 10th largest city in Europe. \n", - "Istanbul, the largest, has nearly \u001b[1;36m16\u001b[0m million inhabitants! \u001b[33m...\u001b[0m\n", - "\n", - "|Population of cities in France \u001b[1;36m2024\u001b[0m - \n", - "StatisticsTimes.com\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://statisticstimes.com/demographics/country/france-cities-population.php\u001b[0m\u001b[4;94m)\u001b[0m\n", - "List of population cities in France based on the estimates and projections by United Nations. yearwise change in \n", - "population and population growth rate. \u001b[33m...\u001b[0m Top \u001b[1;36m10\u001b[0m largest economies by GDP. See Also: \u001b[33m...\u001b[0m » Countries by area; View\n", - "More Demographics Statistics; France cities population; City Population Share \u001b[1m(\u001b[0m%\u001b[1m)\u001b[0m Rank Change; \u001b[1;36m2023\u001b[0m \u001b[1;36m2024\u001b[0m France \u001b[33m...\u001b[0m\n", - "\n", - "|List of cities in France by \n", - "population\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://population-hub.com/en/fr/list-of-cities-in-france-by-population.html\u001b[0m\u001b[4;94m)\u001b[0m\n", - "In total, there are \u001b[1;36m288\u001b[0m cities in France. The largest city is Paris with a population of \u001b[1;36m2\u001b[0m \u001b[1;36m240\u001b[0m \u001b[1;36m621\u001b[0m . The total \n", - "population of France is \u001b[1;36m68859599\u001b[0m people - \u001b[1;36m0.89\u001b[0m% of the total population of the Earth.\n", - "\n", - "|The \u001b[1;36m20\u001b[0m largest cities in France - wanderlix.com\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://wanderlix.com/post/the-largest-cities-in-france/\u001b[0m\u001b[4;94m)\u001b[0m\n", - "The 41st largest country in the world, France has \u001b[1;36m64.5\u001b[0m million inhabitants in \u001b[1;36m36\u001b[0m,\u001b[1;36m681\u001b[0m municipalities. What are the \n", - "\u001b[1;36m20\u001b[0m largest cities in france? Press ESC to close\n", - "\n", - "|Paris - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/Paris\u001b[0m\u001b[4;94m)\u001b[0m\n", - "Paris \u001b[1m(\u001b[0mFrench pronunciation: ⓘ\u001b[1m)\u001b[0m is the capital and largest city of France.With an estimated population of \u001b[1;36m2\u001b[0m,\u001b[1;36m048\u001b[0m,\u001b[1;36m472\u001b[0m\n", - "residents in January \u001b[1;36m2025\u001b[0m |\u001b[1;36m3\u001b[0m\u001b[1m]\u001b[0m in an area of more than \u001b[1;36m105\u001b[0m km \u001b[1;36m2\u001b[0m \u001b[1m(\u001b[0m\u001b[1;36m41\u001b[0m sq mi\u001b[1m)\u001b[0m, |\u001b[1;36m4\u001b[0m\u001b[1m]\u001b[0m Paris is the fourth-most populous \n", - "city in the European Union, the ninth-most populous city in Europe and the 30th most densely populated city in the \n", - "world in \u001b[1;36m2022\u001b[0m. |\u001b[1;36m5\u001b[0m\u001b[1m]\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 2: Duration 3.77 seconds| Input tokens: 5,076 | Output tokens: 63]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 2: Duration 3.77 seconds| Input tokens: 5,076 | Output tokens: 63]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 4 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "text/plain": [ - "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m4\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Error in generating tool call with model:\n", - "'NoneType' object is not iterable\n", - "\n" - ], - "text/plain": [ - "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", - "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 3: Duration 1.63 seconds| Input tokens: 7,124 | Output tokens: 70]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 3: Duration 1.63 seconds| Input tokens: 7,124 | Output tokens: 70]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 5 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "text/plain": [ - "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m5\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Error in generating tool call with model:\n", - "'NoneType' object is not iterable\n", - "\n" - ], - "text/plain": [ - "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", - "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 4: Duration 2.45 seconds| Input tokens: 9,172 | Output tokens: 129]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 4: Duration 2.45 seconds| Input tokens: 9,172 | Output tokens: 129]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", - "\n" - ], - "text/plain": [ - "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m6\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
Error in generating tool call with model:\n", - "'NoneType' object is not iterable\n", - "\n" - ], - "text/plain": [ - "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", - "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "
[Step 5: Duration 1.93 seconds| Input tokens: 11,220 | Output tokens: 161]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 5: Duration 1.93 seconds| Input tokens: 11,220 | Output tokens: 161]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "Reached max steps.\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[1;31mReached max steps.\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/html": [
- "[Step 6: Duration 1.93 seconds| Input tokens: 12,524 | Output tokens: 169]\n",
- "
\n"
- ],
- "text/plain": [
- "\u001b[2m[Step 6: Duration 1.93 seconds| Input tokens: 12,524 | Output tokens: 169]\u001b[0m\n"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "data": {
- "text/plain": [
- "'The capital of France is Paris.'"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
+ "outputs": [],
"source": [
"agent.run(prompt)"
]
diff --git a/T1_WebSearch_Agent/web_search_agent_gui.ipynb b/T1_WebSearch_Agent/web_search_agent_gui.ipynb
new file mode 100644
index 0000000..b4bb130
--- /dev/null
+++ b/T1_WebSearch_Agent/web_search_agent_gui.ipynb
@@ -0,0 +1,695 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Install the Gradio by build the simple user interface"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Requirement already satisfied: gradio in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (5.17.1)\n",
+ "Requirement already satisfied: aiofiles<24.0,>=22.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (23.2.1)\n",
+ "Requirement already satisfied: anyio<5.0,>=3.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (4.6.2.post1)\n",
+ "Requirement already satisfied: fastapi<1.0,>=0.115.2 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (0.115.3)\n",
+ "Requirement already satisfied: ffmpy in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.5.0)\n",
+ "Requirement already satisfied: gradio-client==1.7.1 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (1.7.1)\n",
+ "Requirement already satisfied: httpx>=0.24.1 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.28.1)\n",
+ "Requirement already satisfied: huggingface-hub>=0.28.1 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.29.1)\n",
+ "Requirement already satisfied: jinja2<4.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (3.1.4)\n",
+ "Requirement already satisfied: markupsafe~=2.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (2.1.5)\n",
+ "Requirement already satisfied: numpy<3.0,>=1.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (1.26.4)\n",
+ "Requirement already satisfied: orjson~=3.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (3.10.0)\n",
+ "Requirement already satisfied: packaging in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (24.1)\n",
+ "Requirement already satisfied: pandas<3.0,>=1.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (2.2.3)\n",
+ "Requirement already satisfied: pillow<12.0,>=8.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (11.1.0)\n",
+ "Requirement already satisfied: pydantic>=2.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (2.9.2)\n",
+ "Requirement already satisfied: pydub in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.25.1)\n",
+ "Requirement already satisfied: python-multipart>=0.0.18 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.0.20)\n",
+ "Requirement already satisfied: pyyaml<7.0,>=5.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (6.0.2)\n",
+ "Requirement already satisfied: ruff>=0.9.3 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.9.7)\n",
+ "Requirement already satisfied: safehttpx<0.2.0,>=0.1.6 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (0.1.6)\n",
+ "Requirement already satisfied: semantic-version~=2.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from gradio) (2.10.0)\n",
+ "Requirement already satisfied: starlette<1.0,>=0.40.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (0.41.0)\n",
+ "Requirement already satisfied: tomlkit<0.14.0,>=0.12.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (0.13.2)\n",
+ "Requirement already satisfied: typer<1.0,>=0.12 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (0.12.5)\n",
+ "Requirement already satisfied: typing-extensions~=4.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (4.12.2)\n",
+ "Requirement already satisfied: uvicorn>=0.14.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio) (0.32.0)\n",
+ "Requirement already satisfied: fsspec in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio-client==1.7.1->gradio) (2024.10.0)\n",
+ "Requirement already satisfied: websockets<15.0,>=10.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from gradio-client==1.7.1->gradio) (13.1)\n",
+ "Requirement already satisfied: idna>=2.8 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from anyio<5.0,>=3.0->gradio) (3.10)\n",
+ "Requirement already satisfied: sniffio>=1.1 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from anyio<5.0,>=3.0->gradio) (1.3.1)\n",
+ "Requirement already satisfied: certifi in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from httpx>=0.24.1->gradio) (2024.8.30)\n",
+ "Requirement already satisfied: httpcore==1.* in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from httpx>=0.24.1->gradio) (1.0.6)\n",
+ "Requirement already satisfied: h11<0.15,>=0.13 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from httpcore==1.*->httpx>=0.24.1->gradio) (0.14.0)\n",
+ "Requirement already satisfied: filelock in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from huggingface-hub>=0.28.1->gradio) (3.16.1)\n",
+ "Requirement already satisfied: requests in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from huggingface-hub>=0.28.1->gradio) (2.32.3)\n",
+ "Requirement already satisfied: tqdm>=4.42.1 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from huggingface-hub>=0.28.1->gradio) (4.66.5)\n",
+ "Requirement already satisfied: python-dateutil>=2.8.2 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from pandas<3.0,>=1.0->gradio) (2.9.0.post0)\n",
+ "Requirement already satisfied: pytz>=2020.1 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from pandas<3.0,>=1.0->gradio) (2024.2)\n",
+ "Requirement already satisfied: tzdata>=2022.7 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from pandas<3.0,>=1.0->gradio) (2024.2)\n",
+ "Requirement already satisfied: annotated-types>=0.6.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from pydantic>=2.0->gradio) (0.7.0)\n",
+ "Requirement already satisfied: pydantic-core==2.23.4 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from pydantic>=2.0->gradio) (2.23.4)\n",
+ "Requirement already satisfied: click>=8.0.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from typer<1.0,>=0.12->gradio) (8.1.8)\n",
+ "Requirement already satisfied: shellingham>=1.3.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from typer<1.0,>=0.12->gradio) (1.5.4)\n",
+ "Requirement already satisfied: rich>=10.11.0 in c:\\users\\wingp\\anaconda3\\envs\\smolagent\\lib\\site-packages (from typer<1.0,>=0.12->gradio) (13.9.4)\n",
+ "Requirement already satisfied: colorama in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from click>=8.0.0->typer<1.0,>=0.12->gradio) (0.4.6)\n",
+ "Requirement already satisfied: six>=1.5 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from python-dateutil>=2.8.2->pandas<3.0,>=1.0->gradio) (1.16.0)\n",
+ "Requirement already satisfied: markdown-it-py>=2.2.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (3.0.0)\n",
+ "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (2.18.0)\n",
+ "Requirement already satisfied: charset-normalizer<4,>=2 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from requests->huggingface-hub>=0.28.1->gradio) (3.4.0)\n",
+ "Requirement already satisfied: urllib3<3,>=1.21.1 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from requests->huggingface-hub>=0.28.1->gradio) (2.2.3)\n",
+ "Requirement already satisfied: mdurl~=0.1 in c:\\users\\wingp\\appdata\\roaming\\python\\python312\\site-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0,>=0.12->gradio) (0.1.2)\n"
+ ]
+ },
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "[notice] A new release of pip is available: 24.3.1 -> 25.0.1\n",
+ "[notice] To update, run: python.exe -m pip install --upgrade pip\n"
+ ]
+ }
+ ],
+ "source": [
+ "!pip install gradio"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Tutorial Start"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Import the modules of smolagent"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "C:\\Users\\wingp\\AppData\\Roaming\\Python\\Python312\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
+ " from .autonotebook import tqdm as notebook_tqdm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from typing import Optional\n",
+ "\n",
+ "from smolagents import HfApiModel, LiteLLMModel, TransformersModel, tool\n",
+ "from smolagents.agents import CodeAgent, ToolCallingAgent\n",
+ "from smolagents import DuckDuckGoSearchTool"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "import gradio as gr"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Get the LLM model from ollama"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "model = LiteLLMModel(\n",
+ " model_id=\"ollama_chat/llama3.1\",\n",
+ " api_base=\"http://localhost:11434\", # replace with remote open-ai compatible server if necessary\n",
+ " #api_key=\"your-api-key\", # replace with API key if necessary\n",
+ " #num_ctx=8192, # ollama default is 2048 which will often fail horribly. 8192 works for easy tasks, more is better. Check https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator to calculate how much VRAM this will need for the selected model.\n",
+ " )"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Assign the tools and model to agent"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "agent = ToolCallingAgent(tools=[DuckDuckGoSearchTool()], model=model)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Create the web search Agent function"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def webSearcher(prompt: str) -> str:\n",
+ " return agent.run(prompt)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "Create the User inferface with Gradio"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "demo = gr.Interface(\n",
+ " fn=webSearcher, \n",
+ " inputs=[\n",
+ " gr.Textbox(label=\"Enter your search query\", placeholder=\"who is the current world champion in football?\")\n",
+ " ],\n",
+ " outputs=[\n",
+ " gr.Textbox(label=\"Search Result\")\n",
+ " ],\n",
+ " title=\"Web Search Agent\",\n",
+ " description=\"This is a web search agent that can answer your questions\",\n",
+ ")\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "* Running on local URL: http://127.0.0.1:7860\n",
+ "\n",
+ "To create a public link, set `share=True` in `launch()`.\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ ""
+ ],
+ "text/plain": [
+ "╭──────────────────────────────────────────────────── New run ────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ who is the current world cup winner │\n", + "│ │\n", + "╰─ LiteLLMModel - ollama_chat/llama3.1 ───────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "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[1mwho is the current world cup winner\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 LiteLLMModel - ollama_chat/llama3.1 \u001b[0m\u001b[38;2;212;183;2m──────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;212;183;2m─╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "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" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ Calling tool: 'web_search' with arguments: {'query': 'Current FIFA World Cup winner'} │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ Calling tool: 'web_search' with arguments: {'query': 'Current FIFA World Cup winner'} │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Observations: ## Search Results\n", + "\n", + "|List of FIFA World Cup finals - Wikipedia](https://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals)\n", + "Football tournament FIFA World Cup final Founded 1930 ; 95 years ago (1930) Current champions Argentina (3rd title)\n", + "Most successful team(s) Brazil (5 titles) The FIFA World Cup is an international association football competition \n", + "contested by the senior men's national teams of the Fédération Internationale de Football Association (FIFA), the \n", + "sport's global governing body. The championship ...\n", + "\n", + "|World Cup Football Winners List - Topend Sports](https://www.topendsports.com/events/worldcupsoccer/winners.htm)\n", + "The first African country that is going to win the world cup trophy is Zimbabwe; Sergemweze (2014) African,Asian or\n", + "north American representatives are not yet at the level of winning FIFA World cup, It doesn't matter the last \n", + "result,Spain will win it. The Final game will be SPAIN V. NEDERLAND. Gerard sergemweze (2014)\n", + "\n", + "|World Cup » Champions - worldfootball.net](https://www.worldfootball.net/winner/wm/)\n", + "List of World Cup champions.\n", + "\n", + "|FIFA World Cup - Wikipedia](https://en.wikipedia.org/wiki/FIFA_World_Cup)\n", + "FIFA U-20 World Cup FIFA U-17 World Cup: Current champions ... two layers of semi-precious malachite while the \n", + "bottom side of the trophy bears the engraved year and name of each FIFA World Cup winner since 1974. |62] The \n", + "description of the trophy by Gazzaniga was: \"The lines spring out from the base, rising in spirals, stretching out \n", + "to receive ...\n", + "\n", + "|World Cup winners from 1982, 1986, 1990, 1994, 1998, 2002, 2006 ... - \n", + "FIFA](https://www.fifa.com/en/articles/world-cup-champions-1982-2022-italy-argentina-germany-brazil-france-spain)\n", + "FIFA details the World Cup winners from the past 11 tournaments including Italy, Argentina, West Germany, Brazil, \n", + "France, Spain and Germany.\n", + "\n", + "|FIFA World Cup Winners List from 1930-2022, Complete List and \n", + "Hosts](https://currentaffairs.adda247.com/fifa-world-cup-winners-list-from-1930-to-2022/)\n", + "FIFA World Cup Winners Argentina. What a great match! Undoubtedly, it was one of the best finals ever. But in the \n", + "end Argentina defeated France by 4-2 in penalty shootout after the match drawn 3-3 in the normal time to win FIFA \n", + "World Cup 2022 title. Kylian Mbappe from France was the top goal scorer in FIFA World Cup 2022, he scored 7 \n", + "goals.France forward Kylian Mbappe became the first ...\n", + "\n", + "|Complete FIFA World Cup Winners List: Every Winner Since \n", + "1930](https://soccermavericks.com/fifa-world-cup-winners-list/)\n", + "In this post, we'll go through every FIFA World Cup winner since 1930. So let's get started! Read our article on \n", + "the countries with the most FIFA World Cup wins. List of All The FIFA World Cup Winners. Here is the list of all \n", + "the FIFA World Cup winners. It has winners from the start of the tournament in 1930 to the most recent one in 2022.\n", + "\n", + "|History of WC - FIFA World Cup Results](https://www.fifaworldcupnews.com/world-cup-results/)\n", + "The tournament has taken place organized every four years, except in 1942 and 1946, when the competition was \n", + "canceled due to World War II. France is the current FIFA World Cup, champion team. The final of the 21st FIFA World\n", + "Cup was held in Russia. The match was contested by France and Croatia. Antoine Griezmann was Men of the match of \n", + "the ...\n", + "\n", + "|FIFA World Cup records and statistics - \n", + "Wikipedia](https://en.wikipedia.org/wiki/FIFA_World_Cup_records_and_statistics)\n", + "As of the 2022 FIFA World Cup, 80 national teams have competed at the finals of the FIFA World Cup. |1] Brazil is \n", + "the only team to have appeared in all 22 tournaments to date, with Germany having participated in 20, Italy and \n", + "Argentina in 18 and Mexico in 17. |2] Eight nations have won the tournament. The inaugural winners in 1930 were \n", + "Uruguay; the current champions are Argentina.\n", + "\n", + "|List of FIFA World Cup Winners from 1930 to 2022, Champions List \n", + "Updated](https://www.studyiq.com/articles/fifa-world-cup-winners-list/)\n", + "This event has 32 teams in it altogether. 64 matches were played as 32 teams competed for a place on the FIFA World\n", + "Cup winners list. On December 18, 2022, when the two greatest teams compete for the title, the FIFA World Cup 2022 \n", + "winner will be selected. Below is a detailed analysis of the FIFA World Cup winners by year from 1930 to 2022.\n", + "\n" + ], + "text/plain": [ + "Observations: ## Search Results\n", + "\n", + "|List of FIFA World Cup finals - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/List_of_FIFA_World_Cup_finals\u001b[0m\u001b[4;94m)\u001b[0m\n", + "Football tournament FIFA World Cup final Founded \u001b[1;36m1930\u001b[0m ; \u001b[1;36m95\u001b[0m years ago \u001b[1m(\u001b[0m\u001b[1;36m1930\u001b[0m\u001b[1m)\u001b[0m Current champions Argentina \u001b[1m(\u001b[0m3rd title\u001b[1m)\u001b[0m\n", + "Most successful \u001b[1;35mteam\u001b[0m\u001b[1m(\u001b[0ms\u001b[1m)\u001b[0m Brazil \u001b[1m(\u001b[0m\u001b[1;36m5\u001b[0m titles\u001b[1m)\u001b[0m The FIFA World Cup is an international association football competition \n", + "contested by the senior men's national teams of the Fédération Internationale de Football Association \u001b[1m(\u001b[0mFIFA\u001b[1m)\u001b[0m, the \n", + "sport's global governing body. The championship \u001b[33m...\u001b[0m\n", + "\n", + "|World Cup Football Winners List - Topend Sports\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.topendsports.com/events/worldcupsoccer/winners.htm\u001b[0m\u001b[4;94m)\u001b[0m\n", + "The first African country that is going to win the world cup trophy is Zimbabwe; Sergemweze \u001b[1m(\u001b[0m\u001b[1;36m2014\u001b[0m\u001b[1m)\u001b[0m African,Asian or\n", + "north American representatives are not yet at the level of winning FIFA World cup, It doesn't matter the last \n", + "result,Spain will win it. The Final game will be SPAIN V. NEDERLAND. Gerard sergemweze \u001b[1m(\u001b[0m\u001b[1;36m2014\u001b[0m\u001b[1m)\u001b[0m\n", + "\n", + "|World Cup » Champions - worldfootball.net\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.worldfootball.net/winner/wm/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "List of World Cup champions.\n", + "\n", + "|FIFA World Cup - Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/FIFA_World_Cup\u001b[0m\u001b[4;94m)\u001b[0m\n", + "FIFA U-\u001b[1;36m20\u001b[0m World Cup FIFA U-\u001b[1;36m17\u001b[0m World Cup: Current champions \u001b[33m...\u001b[0m two layers of semi-precious malachite while the \n", + "bottom side of the trophy bears the engraved year and name of each FIFA World Cup winner since \u001b[1;36m1974\u001b[0m. |\u001b[1;36m62\u001b[0m\u001b[1m]\u001b[0m The \n", + "description of the trophy by Gazzaniga was: \"The lines spring out from the base, rising in spirals, stretching out \n", + "to receive \u001b[33m...\u001b[0m\n", + "\n", + "|World Cup winners from \u001b[1;36m1982\u001b[0m, \u001b[1;36m1986\u001b[0m, \u001b[1;36m1990\u001b[0m, \u001b[1;36m1994\u001b[0m, \u001b[1;36m1998\u001b[0m, \u001b[1;36m2002\u001b[0m, \u001b[1;36m2006\u001b[0m \u001b[33m...\u001b[0m - \n", + "FIFA\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.fifa.com/en/articles/world-cup-champions-1982-2022-italy-argentina-germany-brazil-france-spain\u001b[0m\u001b[4;94m)\u001b[0m\n", + "FIFA details the World Cup winners from the past \u001b[1;36m11\u001b[0m tournaments including Italy, Argentina, West Germany, Brazil, \n", + "France, Spain and Germany.\n", + "\n", + "|FIFA World Cup Winners List from \u001b[1;36m1930\u001b[0m-\u001b[1;36m2022\u001b[0m, Complete List and \n", + "Hosts\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://currentaffairs.adda247.com/fifa-world-cup-winners-list-from-1930-to-2022/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "FIFA World Cup Winners Argentina. What a great match! Undoubtedly, it was one of the best finals ever. But in the \n", + "end Argentina defeated France by \u001b[1;36m4\u001b[0m-\u001b[1;36m2\u001b[0m in penalty shootout after the match drawn \u001b[1;36m3\u001b[0m-\u001b[1;36m3\u001b[0m in the normal time to win FIFA \n", + "World Cup \u001b[1;36m2022\u001b[0m title. Kylian Mbappe from France was the top goal scorer in FIFA World Cup \u001b[1;36m2022\u001b[0m, he scored \u001b[1;36m7\u001b[0m \n", + "goals.France forward Kylian Mbappe became the first \u001b[33m...\u001b[0m\n", + "\n", + "|Complete FIFA World Cup Winners List: Every Winner Since \n", + "\u001b[1;36m1930\u001b[0m\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://soccermavericks.com/fifa-world-cup-winners-list/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "In this post, we'll go through every FIFA World Cup winner since \u001b[1;36m1930\u001b[0m. So let's get started! Read our article on \n", + "the countries with the most FIFA World Cup wins. List of All The FIFA World Cup Winners. Here is the list of all \n", + "the FIFA World Cup winners. It has winners from the start of the tournament in \u001b[1;36m1930\u001b[0m to the most recent one in \u001b[1;36m2022\u001b[0m.\n", + "\n", + "|History of WC - FIFA World Cup Results\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.fifaworldcupnews.com/world-cup-results/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "The tournament has taken place organized every four years, except in \u001b[1;36m1942\u001b[0m and \u001b[1;36m1946\u001b[0m, when the competition was \n", + "canceled due to World War II. France is the current FIFA World Cup, champion team. The final of the 21st FIFA World\n", + "Cup was held in Russia. The match was contested by France and Croatia. Antoine Griezmann was Men of the match of \n", + "the \u001b[33m...\u001b[0m\n", + "\n", + "|FIFA World Cup records and statistics - \n", + "Wikipedia\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://en.wikipedia.org/wiki/FIFA_World_Cup_records_and_statistics\u001b[0m\u001b[4;94m)\u001b[0m\n", + "As of the \u001b[1;36m2022\u001b[0m FIFA World Cup, \u001b[1;36m80\u001b[0m national teams have competed at the finals of the FIFA World Cup. |\u001b[1;36m1\u001b[0m\u001b[1m]\u001b[0m Brazil is \n", + "the only team to have appeared in all \u001b[1;36m22\u001b[0m tournaments to date, with Germany having participated in \u001b[1;36m20\u001b[0m, Italy and \n", + "Argentina in \u001b[1;36m18\u001b[0m and Mexico in \u001b[1;36m17\u001b[0m. |\u001b[1;36m2\u001b[0m\u001b[1m]\u001b[0m Eight nations have won the tournament. The inaugural winners in \u001b[1;36m1930\u001b[0m were \n", + "Uruguay; the current champions are Argentina.\n", + "\n", + "|List of FIFA World Cup Winners from \u001b[1;36m1930\u001b[0m to \u001b[1;36m2022\u001b[0m, Champions List \n", + "Updated\u001b[1m]\u001b[0m\u001b[1m(\u001b[0m\u001b[4;94mhttps://www.studyiq.com/articles/fifa-world-cup-winners-list/\u001b[0m\u001b[4;94m)\u001b[0m\n", + "This event has \u001b[1;36m32\u001b[0m teams in it altogether. \u001b[1;36m64\u001b[0m matches were played as \u001b[1;36m32\u001b[0m teams competed for a place on the FIFA World\n", + "Cup winners list. On December \u001b[1;36m18\u001b[0m, \u001b[1;36m2022\u001b[0m, when the two greatest teams compete for the title, the FIFA World Cup \u001b[1;36m2022\u001b[0m \n", + "winner will be selected. Below is a detailed analysis of the FIFA World Cup winners by year from \u001b[1;36m1930\u001b[0m to \u001b[1;36m2022\u001b[0m.\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 0: Duration 3.60 seconds| Input tokens: 1,110 | Output tokens: 29]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 0: Duration 3.60 seconds| Input tokens: 1,110 | Output tokens: 29]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 2 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "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" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Error in generating tool call with model:\n", + "'NoneType' object is not iterable\n", + "\n" + ], + "text/plain": [ + "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", + "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 1: Duration 4.37 seconds| Input tokens: 2,136 | Output tokens: 420]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 1: Duration 4.37 seconds| Input tokens: 2,136 | Output tokens: 420]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 3 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "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" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Error in generating tool call with model:\n", + "'NoneType' object is not iterable\n", + "\n" + ], + "text/plain": [ + "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", + "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 2: Duration 1.12 seconds| Input tokens: 3,162 | Output tokens: 486]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 2: Duration 1.12 seconds| Input tokens: 3,162 | Output tokens: 486]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 4 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "text/plain": [ + "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m4\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Error in generating tool call with model:\n", + "'NoneType' object is not iterable\n", + "\n" + ], + "text/plain": [ + "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", + "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 3: Duration 3.60 seconds| Input tokens: 4,188 | Output tokens: 705]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 3: Duration 3.60 seconds| Input tokens: 4,188 | Output tokens: 705]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 5 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "text/plain": [ + "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m5\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Error in generating tool call with model:\n", + "'NoneType' object is not iterable\n", + "\n" + ], + "text/plain": [ + "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", + "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 4: Duration 2.76 seconds| Input tokens: 5,214 | Output tokens: 939]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 4: Duration 2.76 seconds| Input tokens: 5,214 | Output tokens: 939]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 6 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n", + "\n" + ], + "text/plain": [ + "\u001b[38;2;212;183;2m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ \u001b[0m\u001b[1mStep \u001b[0m\u001b[1;36m6\u001b[0m\u001b[38;2;212;183;2m ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Error in generating tool call with model:\n", + "'NoneType' object is not iterable\n", + "\n" + ], + "text/plain": [ + "\u001b[1;31mError in generating tool call with model:\u001b[0m\n", + "\u001b[1;31m'NoneType'\u001b[0m\u001b[1;31m object is not iterable\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
[Step 5: Duration 1.88 seconds| Input tokens: 6,240 | Output tokens: 1,084]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 5: Duration 1.88 seconds| Input tokens: 6,240 | Output tokens: 1,084]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "Reached max steps.\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[1;31mReached max steps.\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "[Step 6: Duration 1.88 seconds| Input tokens: 7,699 | Output tokens: 1,144]\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2m[Step 6: Duration 1.88 seconds| Input tokens: 7,699 | Output tokens: 1,144]\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "demo.launch()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "smolagent",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.12.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}