import{s as Ce,n as ue,o as me}from"../chunks/scheduler.f6319a2a.js";import{S as he,i as be,g as a,s as n,r as i,A as Je,h as y,f as t,c as M,j as de,u as p,x as o,k as Nl,y as Te,a as s,v as U,d as r,t as j,w as c}from"../chunks/index.85aa684c.js";import{C as w}from"../chunks/CodeBlock.3400fc53.js";import{D as ge}from"../chunks/DocNotebookDropdown.3fc3604b.js";import{H as Yl,E as Ae}from"../chunks/getInferenceSnippets.0233181f.js";function fe(Ll){let d,sl,el,nl,u,Ml,m,al,h,zl="In this notebook we will make a <strong>multi-agent web browser: an agentic system with several agents collaborating to solve problems using the web!</strong>",yl,b,Fl="It will be a simple hierarchy:",ol,J,il,T,ql="Let’s set up this system.",pl,g,Pl="Run the line below to install the required dependencies:",Ul,A,rl,f,Dl="Let’s login to HF in order to call Inference Providers:",jl,I,cl,B,Kl='⚡️ Our agent will be powered by <a href="https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct" rel="nofollow">Qwen/Qwen2.5-Coder-32B-Instruct</a> using <code>InferenceClientModel</code> class that uses HF’s Inference API: the Inference API allows to quickly and easily run any OS model.',wl,C,Ol='<p>Inference Providers give access to hundreds of models, powered by serverless inference partners. A list of supported providers can be found <a href="https://huggingface.co/docs/inference-providers/index" rel="nofollow">here</a>.</p>',dl,k,Cl,Z,ul,v,le='For web browsing, we can already use our native <a href="/docs/smolagents/v1.22.0/en/reference/default_tools#smolagents.WebSearchTool">WebSearchTool</a> tool to provide a Google search equivalent.',ml,G,ee=`But then we will also need to be able to peak into the page found by the <code>WebSearchTool</code>.
To do so, we could import the library’s built-in <code>VisitWebpageTool</code>, but we will build it again to see how it’s done.`,hl,W,te="So let’s create our <code>VisitWebpageTool</code> tool from scratch using <code>markdownify</code>.",bl,S,Jl,V,se="Ok, now let’s initialize and test our tool!",Tl,E,gl,$,Al,Q,ne="Now that we have all the tools <code>search</code> and <code>visit_webpage</code>, we can use them to create the web agent.",fl,_,Me="Which configuration to choose for this agent?",Il,H,ae="<li>Web browsing is a single-timeline task that does not require parallel tool calls, so JSON tool calling works well for that. We thus choose a <code>ToolCallingAgent</code>.</li> <li>Also, since sometimes web search requires exploring many pages before finding the correct answer, we prefer to increase the number of <code>max_steps</code> to 10.</li>",Bl,x,kl,R,ye="Note that we gave this agent attributes <code>name</code> and <code>description</code>, mandatory attributes to make this agent callable by its manager agent.",Zl,X,oe="Then we create a manager agent, and upon initialization we pass our managed agent to it in its <code>managed_agents</code> argument.",vl,N,ie="Since this agent is the one tasked with the planning and thinking, advanced reasoning will be beneficial, so a <code>CodeAgent</code> will work well.",Gl,Y,pe="Also, we want to ask a question that involves the current year and does additional data calculations: so let us add <code>additional_authorized_imports=[&quot;time&quot;, &quot;numpy&quot;, &quot;pandas&quot;]</code>, just in case the agent needs these packages.",Wl,L,Sl,z,Ue="That’s all! Now let’s run our system! We select a question that requires both some calculation and research:",Vl,F,El,q,re="We get this report as the answer:",$l,P,Ql,D,je='Seems like we’ll need some sizeable powerplants if the <a href="https://gwern.net/scaling-hypothesis" rel="nofollow">scaling hypothesis</a> continues to hold true.',_l,K,ce="Our agents managed to efficiently collaborate towards solving the task! ✅",Hl,O,we="💡 You can easily extend this orchestration to more agents: one does the code execution, one the web search, one handles file loadings…",xl,ll,Rl,tl,Xl;return u=new Yl({props:{title:"Orchestrate a multi-agent system 🤖🤝🤖",local:"orchestrate-a-multi-agent-system-",headingTag:"h1"}}),m=new ge({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/multiagents.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/pytorch/multiagents.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/tensorflow/multiagents.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/multiagents.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/pytorch/multiagents.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/tensorflow/multiagents.ipynb"}]}}),J=new w({props:{code:"JTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTJCLS0tLS0tLS0tLS0tLS0tLSUyQiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QyUyME1hbmFnZXIlMjBhZ2VudCUyMCUyMCU3QyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyQi0tLS0tLS0tLS0tLS0tLS0lMkIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0MlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBfX19fX19fX19fX19fX18lN0NfX19fX19fX19fX19fXyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QyUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QyUwQUNvZGUlMjBJbnRlcnByZXRlciUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyQi0tLS0tLS0tLS0tLS0tLS0tLSUyQiUwQSUyMCUyMCUyMCUyMHRvb2wlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0MlMjBXZWIlMjBTZWFyY2glMjBhZ2VudCUyMCU3QyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyQi0tLS0tLS0tLS0tLS0tLS0tLSUyQiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QyUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFdlYiUyMFNlYXJjaCUyMHRvb2wlMjAlMjAlMjAlMjAlMjAlN0MlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBWaXNpdCUyMHdlYnBhZ2UlMjB0b29s",highlighted:`              +----------------+
              |<span class="hljs-string"> Manager agent  </span>|
              +----------------+
                       |<span class="hljs-string">
        _______________</span>|______________
       |<span class="hljs-string">                              </span>|
Code Interpreter            +------------------+
    tool                    |<span class="hljs-string"> Web Search agent </span>|
                            +------------------+
                               |<span class="hljs-string">            </span>|
                        Web Search tool     |<span class="hljs-string">
                                   Visit webpage tool</span>`,wrap:!1}}),A=new w({props:{code:"IXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QnRvb2xraXQlNUQnJTIwLS11cGdyYWRlJTIwLXE=",highlighted:'!pip install <span class="hljs-string">&#x27;smolagents[toolkit]&#x27;</span> --upgrade -q',wrap:!1}}),I=new w({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTBBJTBBbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login

login()`,wrap:!1}}),k=new w({props:{code:"bW9kZWxfaWQlMjAlM0QlMjAlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjI=",highlighted:'model_id = <span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>',wrap:!1}}),Z=new Yl({props:{title:"🔍 Create a web search tool",local:"-create-a-web-search-tool",headingTag:"h2"}}),S=new w({props:{code:"aW1wb3J0JTIwcmUlMEFpbXBvcnQlMjByZXF1ZXN0cyUwQWZyb20lMjBtYXJrZG93bmlmeSUyMGltcG9ydCUyMG1hcmtkb3duaWZ5JTBBZnJvbSUyMHJlcXVlc3RzLmV4Y2VwdGlvbnMlMjBpbXBvcnQlMjBSZXF1ZXN0RXhjZXB0aW9uJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjB0b29sJTBBJTBBJTBBJTQwdG9vbCUwQWRlZiUyMHZpc2l0X3dlYnBhZ2UodXJsJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJWaXNpdHMlMjBhJTIwd2VicGFnZSUyMGF0JTIwdGhlJTIwZ2l2ZW4lMjBVUkwlMjBhbmQlMjByZXR1cm5zJTIwaXRzJTIwY29udGVudCUyMGFzJTIwYSUyMG1hcmtkb3duJTIwc3RyaW5nLiUwQSUwQSUyMCUyMCUyMCUyMEFyZ3MlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB1cmwlM0ElMjBUaGUlMjBVUkwlMjBvZiUyMHRoZSUyMHdlYnBhZ2UlMjB0byUyMHZpc2l0LiUwQSUwQSUyMCUyMCUyMCUyMFJldHVybnMlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjB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AlMjAlMjAlMjByZXR1cm4lMjBtYXJrZG93bl9jb250ZW50JTBBJTBBJTIwJTIwJTIwJTIwZXhjZXB0JTIwUmVxdWVzdEV4Y2VwdGlvbiUyMGFzJTIwZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJFcnJvciUyMGZldGNoaW5nJTIwdGhlJTIwd2VicGFnZSUzQSUyMCU3QnN0cihlKSU3RCUyMiUwQSUyMCUyMCUyMCUyMGV4Y2VwdCUyMEV4Y2VwdGlvbiUyMGFzJTIwZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJBbiUyMHVuZXhwZWN0ZWQlMjBlcnJvciUyMG9jY3VycmVkJTNBJTIwJTdCc3RyKGUpJTdEJTIy",highlighted:`<span class="hljs-keyword">import</span> re
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">from</span> markdownify <span class="hljs-keyword">import</span> markdownify
<span class="hljs-keyword">from</span> requests.exceptions <span class="hljs-keyword">import</span> RequestException
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> tool


<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">visit_webpage</span>(<span class="hljs-params">url: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Visits a webpage at the given URL and returns its content as a markdown string.

    Args:
        url: The URL of the webpage to visit.

    Returns:
        The content of the webpage converted to Markdown, or an error message if the request fails.
    &quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># Send a GET request to the URL</span>
        response = requests.get(url)
        response.raise_for_status()  <span class="hljs-comment"># Raise an exception for bad status codes</span>

        <span class="hljs-comment"># Convert the HTML content to Markdown</span>
        markdown_content = markdownify(response.text).strip()

        <span class="hljs-comment"># Remove multiple line breaks</span>
        markdown_content = re.sub(<span class="hljs-string">r&quot;\\n{3,}&quot;</span>, <span class="hljs-string">&quot;\\n\\n&quot;</span>, markdown_content)

        <span class="hljs-keyword">return</span> markdown_content

    <span class="hljs-keyword">except</span> RequestException <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Error fetching the webpage: <span class="hljs-subst">{<span class="hljs-built_in">str</span>(e)}</span>&quot;</span>
    <span class="hljs-keyword">except</span> Exception <span class="hljs-keyword">as</span> e:
        <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;An unexpected error occurred: <span class="hljs-subst">{<span class="hljs-built_in">str</span>(e)}</span>&quot;</span>`,wrap:!1}}),E=new w({props:{code:"cHJpbnQodmlzaXRfd2VicGFnZSglMjJodHRwcyUzQSUyRiUyRmVuLndpa2lwZWRpYS5vcmclMkZ3aWtpJTJGSHVnZ2luZ19GYWNlJTIyKSU1QiUzQTUwMCU1RCk=",highlighted:'<span class="hljs-built_in">print</span>(visit_webpage(<span class="hljs-string">&quot;https://en.wikipedia.org/wiki/Hugging_Face&quot;</span>)[:<span class="hljs-number">500</span>])',wrap:!1}}),$=new Yl({props:{title:"Build our multi-agent system 🤖🤝🤖",local:"build-our-multi-agent-system-",headingTag:"h2"}}),x=new w({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjAoJTBBJTIwJTIwJTIwJTIwQ29kZUFnZW50JTJDJTBBJTIwJTIwJTIwJTIwVG9vbENhbGxpbmdBZ2VudCUyQyUwQSUyMCUyMCUyMCUyMEluZmVyZW5jZUNsaWVudE1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwV2ViU2VhcmNoVG9vbCUyQyUwQSUyMCUyMCUyMCUyMExpdGVMTE1Nb2RlbCUyQyUwQSklMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKG1vZGVsX2lkJTNEbW9kZWxfaWQpJTBBJTBBd2ViX2FnZW50JTIwJTNEJTIwVG9vbENhbGxpbmdBZ2VudCglMEElMjAlMjAlMjAlMjB0b29scyUzRCU1QldlYlNlYXJjaFRvb2woKSUyQyUyMHZpc2l0X3dlYnBhZ2UlNUQlMkMlMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3N0ZXBzJTNEMTAlMkMlMEElMjAlMjAlMjAlMjBuYW1lJTNEJTIyd2ViX3NlYXJjaF9hZ2VudCUyMiUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEJTIyUnVucyUyMHdlYiUyMHNlYXJjaGVzJTIwZm9yJTIweW91LiUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> (
    CodeAgent,
    ToolCallingAgent,
    InferenceClientModel,
    WebSearchTool,
    LiteLLMModel,
)

model = InferenceClientModel(model_id=model_id)

web_agent = ToolCallingAgent(
    tools=[WebSearchTool(), visit_webpage],
    model=model,
    max_steps=<span class="hljs-number">10</span>,
    name=<span class="hljs-string">&quot;web_search_agent&quot;</span>,
    description=<span class="hljs-string">&quot;Runs web searches for you.&quot;</span>,
)`,wrap:!1}}),L=new w({props:{code:"bWFuYWdlcl9hZ2VudCUyMCUzRCUyMENvZGVBZ2VudCglMEElMjAlMjAlMjAlMjB0b29scyUzRCU1QiU1RCUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBtYW5hZ2VkX2FnZW50cyUzRCU1QndlYl9hZ2VudCU1RCUyQyUwQSUyMCUyMCUyMCUyMGFkZGl0aW9uYWxfYXV0aG9yaXplZF9pbXBvcnRzJTNEJTVCJTIydGltZSUyMiUyQyUyMCUyMm51bXB5JTIyJTJDJTIwJTIycGFuZGFzJTIyJTVEJTJDJTBBKQ==",highlighted:`manager_agent = CodeAgent(
    tools=[],
    model=model,
    managed_agents=[web_agent],
    additional_authorized_imports=[<span class="hljs-string">&quot;time&quot;</span>, <span class="hljs-string">&quot;numpy&quot;</span>, <span class="hljs-string">&quot;pandas&quot;</span>],
)`,wrap:!1}}),F=new w({props:{code:"YW5zd2VyJTIwJTNEJTIwbWFuYWdlcl9hZ2VudC5ydW4oJTIySWYlMjBMTE0lMjB0cmFpbmluZyUyMGNvbnRpbnVlcyUyMHRvJTIwc2NhbGUlMjB1cCUyMGF0JTIwdGhlJTIwY3VycmVudCUyMHJoeXRobSUyMHVudGlsJTIwMjAzMCUyQyUyMHdoYXQlMjB3b3VsZCUyMGJlJTIwdGhlJTIwZWxlY3RyaWMlMjBwb3dlciUyMGluJTIwR1clMjByZXF1aXJlZCUyMHRvJTIwcG93ZXIlMjB0aGUlMjBiaWdnZXN0JTIwdHJhaW5pbmclMjBydW5zJTIwYnklMjAyMDMwJTNGJTIwV2hhdCUyMHdvdWxkJTIwdGhhdCUyMGNvcnJlc3BvbmQlMjB0byUyQyUyMGNvbXBhcmVkJTIwdG8lMjBzb21lJTIwY291bnRyaWVzJTNGJTIwUGxlYXNlJTIwcHJvdmlkZSUyMGElMjBzb3VyY2UlMjBmb3IlMjBhbnklMjBudW1iZXJzJTIwdXNlZC4lMjIp",highlighted:'answer = manager_agent.run(<span class="hljs-string">&quot;If LLM training continues to scale up at the current rhythm until 2030, what would be the electric power in GW required to power the biggest training runs by 2030? What would that correspond to, compared to some countries? Please provide a source for any numbers used.&quot;</span>)',wrap:!1}}),P=new w({props:{code:"QmFzZWQlMjBvbiUyMGN1cnJlbnQlMjBncm93dGglMjBwcm9qZWN0aW9ucyUyMGFuZCUyMGVuZXJneSUyMGNvbnN1bXB0aW9uJTIwZXN0aW1hdGVzJTJDJTIwaWYlMjBMTE0lMjB0cmFpbmluZ3MlMjBjb250aW51ZSUyMHRvJTIwc2NhbGUlMjB1cCUyMGF0JTIwdGhlJTIwJTBBY3VycmVudCUyMHJoeXRobSUyMHVudGlsJTIwMjAzMCUzQSUwQSUwQTEuJTIwVGhlJTIwZWxlY3RyaWMlMjBwb3dlciUyMHJlcXVpcmVkJTIwdG8lM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ENFTyUyME1hdHQlMjBHYXJtYW4uJTBBJTIwJTIwJTIwLSUyMFRoZSUyMGdyb3d0aCUyMHByb2plY3Rpb24lMjB1c2VkJTIwYSUyMENBR1IlMjBvZiUyMDc5LjgwJTI1JTIwZnJvbSUyMG1hcmtldCUyMHJlc2VhcmNoJTIwYnklMjBTcHJpbmdzLiUwQSUyMCUyMCUyMC0lMjBDb3VudHJ5JTIwZWxlY3RyaWNpdHklMjBjb25zdW1wdGlvbiUyMGRhdGElMjBpcyUyMGZyb20lMjB0aGUlMjBVLlMuJTIwRW5lcmd5JTIwSW5mb3JtYXRpb24lMjBBZG1pbmlzdHJhdGlvbiUyQyUyMHByaW1hcmlseSUyMGZvciUyMHRoZSUyMHllYXIlMjAlMEEyMDIxLg==",highlighted:`Based <span class="hljs-keyword">on</span> current growth projections <span class="hljs-keyword">and</span> energy consumption estimates, <span class="hljs-keyword">if</span> LLM trainings <span class="hljs-keyword">continue</span> <span class="hljs-keyword">to</span> scale up <span class="hljs-keyword">at</span> <span class="hljs-keyword">the</span> 
current rhythm <span class="hljs-keyword">until</span> <span class="hljs-number">2030</span>:

<span class="hljs-number">1.</span> The electric power required <span class="hljs-keyword">to</span> power <span class="hljs-keyword">the</span> biggest training runs <span class="hljs-keyword">by</span> <span class="hljs-number">2030</span> would be approximately <span class="hljs-number">303.74</span> GW, which 
translates <span class="hljs-keyword">to</span> <span class="hljs-keyword">about</span> <span class="hljs-number">2</span>,<span class="hljs-number">660</span>,<span class="hljs-number">762</span> GWh/<span class="hljs-built_in">year</span>.

<span class="hljs-number">2.</span> Comparing this <span class="hljs-keyword">to</span> countries&#x27; electricity consumption:
   - It would be equivalent <span class="hljs-keyword">to</span> <span class="hljs-keyword">about</span> <span class="hljs-number">34</span>% <span class="hljs-keyword">of</span> China&#x27;s total electricity consumption.
   - It would exceed <span class="hljs-keyword">the</span> total electricity consumption <span class="hljs-keyword">of</span> India (<span class="hljs-number">184</span>%), Russia (<span class="hljs-number">267</span>%), <span class="hljs-keyword">and</span> Japan (<span class="hljs-number">291</span>%).
   - It would be nearly <span class="hljs-number">9</span> <span class="hljs-keyword">times</span> <span class="hljs-keyword">the</span> electricity consumption <span class="hljs-keyword">of</span> countries like Italy <span class="hljs-keyword">or</span> Mexico.

<span class="hljs-number">3.</span> Source <span class="hljs-keyword">of</span> numbers:
   - The initial estimate <span class="hljs-keyword">of</span> <span class="hljs-number">5</span> GW <span class="hljs-keyword">for</span> future LLM training comes <span class="hljs-keyword">from</span> AWS CEO Matt Garman.
   - The growth projection used a CAGR <span class="hljs-keyword">of</span> <span class="hljs-number">79.80</span>% <span class="hljs-keyword">from</span> market research <span class="hljs-keyword">by</span> Springs.
   - Country electricity consumption data <span class="hljs-keyword">is</span> <span class="hljs-keyword">from</span> <span class="hljs-keyword">the</span> U.S. Energy Information Administration, primarily <span class="hljs-keyword">for</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">year</span> 
<span class="hljs-number">2021.</span>`,wrap:!1}}),ll=new Ae({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/examples/multiagents.md"}}),{c(){d=a("meta"),sl=n(),el=a("p"),nl=n(),i(u.$$.fragment),Ml=n(),i(m.$$.fragment),al=n(),h=a("p"),h.innerHTML=zl,yl=n(),b=a("p"),b.textContent=Fl,ol=n(),i(J.$$.fragment),il=n(),T=a("p"),T.textContent=ql,pl=n(),g=a("p"),g.textContent=Pl,Ul=n(),i(A.$$.fragment),rl=n(),f=a("p"),f.textContent=Dl,jl=n(),i(I.$$.fragment),cl=n(),B=a("p"),B.innerHTML=Kl,wl=n(),C=a("blockquote"),C.innerHTML=Ol,dl=n(),i(k.$$.fragment),Cl=n(),i(Z.$$.fragment),ul=n(),v=a("p"),v.innerHTML=le,ml=n(),G=a("p"),G.innerHTML=ee,hl=n(),W=a("p"),W.innerHTML=te,bl=n(),i(S.$$.fragment),Jl=n(),V=a("p"),V.textContent=se,Tl=n(),i(E.$$.fragment),gl=n(),i($.$$.fragment),Al=n(),Q=a("p"),Q.innerHTML=ne,fl=n(),_=a("p"),_.textContent=Me,Il=n(),H=a("ul"),H.innerHTML=ae,Bl=n(),i(x.$$.fragment),kl=n(),R=a("p"),R.innerHTML=ye,Zl=n(),X=a("p"),X.innerHTML=oe,vl=n(),N=a("p"),N.innerHTML=ie,Gl=n(),Y=a("p"),Y.innerHTML=pe,Wl=n(),i(L.$$.fragment),Sl=n(),z=a("p"),z.textContent=Ue,Vl=n(),i(F.$$.fragment),El=n(),q=a("p"),q.textContent=re,$l=n(),i(P.$$.fragment),Ql=n(),D=a("p"),D.innerHTML=je,_l=n(),K=a("p"),K.textContent=ce,Hl=n(),O=a("p"),O.textContent=we,xl=n(),i(ll.$$.fragment),Rl=n(),tl=a("p"),this.h()},l(l){const e=Je("svelte-u9bgzb",document.head);d=y(e,"META",{name:!0,content:!0}),e.forEach(t),sl=M(l),el=y(l,"P",{}),de(el).forEach(t),nl=M(l),p(u.$$.fragment,l),Ml=M(l),p(m.$$.fragment,l),al=M(l),h=y(l,"P",{"data-svelte-h":!0}),o(h)!=="svelte-45abwn"&&(h.innerHTML=zl),yl=M(l),b=y(l,"P",{"data-svelte-h":!0}),o(b)!=="svelte-1f6nia6"&&(b.textContent=Fl),ol=M(l),p(J.$$.fragment,l),il=M(l),T=y(l,"P",{"data-svelte-h":!0}),o(T)!=="svelte-1occiln"&&(T.textContent=ql),pl=M(l),g=y(l,"P",{"data-svelte-h":!0}),o(g)!=="svelte-ofrdjq"&&(g.textContent=Pl),Ul=M(l),p(A.$$.fragment,l),rl=M(l),f=y(l,"P",{"data-svelte-h":!0}),o(f)!=="svelte-gkovew"&&(f.textContent=Dl),jl=M(l),p(I.$$.fragment,l),cl=M(l),B=y(l,"P",{"data-svelte-h":!0}),o(B)!=="svelte-16hajs3"&&(B.innerHTML=Kl),wl=M(l),C=y(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),o(C)!=="svelte-1lti5bi"&&(C.innerHTML=Ol),dl=M(l),p(k.$$.fragment,l),Cl=M(l),p(Z.$$.fragment,l),ul=M(l),v=y(l,"P",{"data-svelte-h":!0}),o(v)!=="svelte-6hbbyh"&&(v.innerHTML=le),ml=M(l),G=y(l,"P",{"data-svelte-h":!0}),o(G)!=="svelte-128rf40"&&(G.innerHTML=ee),hl=M(l),W=y(l,"P",{"data-svelte-h":!0}),o(W)!=="svelte-1ms2uj2"&&(W.innerHTML=te),bl=M(l),p(S.$$.fragment,l),Jl=M(l),V=y(l,"P",{"data-svelte-h":!0}),o(V)!=="svelte-hbvg5t"&&(V.textContent=se),Tl=M(l),p(E.$$.fragment,l),gl=M(l),p($.$$.fragment,l),Al=M(l),Q=y(l,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-5768lo"&&(Q.innerHTML=ne),fl=M(l),_=y(l,"P",{"data-svelte-h":!0}),o(_)!=="svelte-noa5rw"&&(_.textContent=Me),Il=M(l),H=y(l,"UL",{"data-svelte-h":!0}),o(H)!=="svelte-cg2xmz"&&(H.innerHTML=ae),Bl=M(l),p(x.$$.fragment,l),kl=M(l),R=y(l,"P",{"data-svelte-h":!0}),o(R)!=="svelte-fbxoqx"&&(R.innerHTML=ye),Zl=M(l),X=y(l,"P",{"data-svelte-h":!0}),o(X)!=="svelte-wtigy3"&&(X.innerHTML=oe),vl=M(l),N=y(l,"P",{"data-svelte-h":!0}),o(N)!=="svelte-1lmitd7"&&(N.innerHTML=ie),Gl=M(l),Y=y(l,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-1ezr7oa"&&(Y.innerHTML=pe),Wl=M(l),p(L.$$.fragment,l),Sl=M(l),z=y(l,"P",{"data-svelte-h":!0}),o(z)!=="svelte-90lagx"&&(z.textContent=Ue),Vl=M(l),p(F.$$.fragment,l),El=M(l),q=y(l,"P",{"data-svelte-h":!0}),o(q)!=="svelte-tvhx1x"&&(q.textContent=re),$l=M(l),p(P.$$.fragment,l),Ql=M(l),D=y(l,"P",{"data-svelte-h":!0}),o(D)!=="svelte-19s7crl"&&(D.innerHTML=je),_l=M(l),K=y(l,"P",{"data-svelte-h":!0}),o(K)!=="svelte-ollz3q"&&(K.textContent=ce),Hl=M(l),O=y(l,"P",{"data-svelte-h":!0}),o(O)!=="svelte-rvy62f"&&(O.textContent=we),xl=M(l),p(ll.$$.fragment,l),Rl=M(l),tl=y(l,"P",{}),de(tl).forEach(t),this.h()},h(){Nl(d,"name","hf:doc:metadata"),Nl(d,"content",Ie),Nl(C,"class","tip")},m(l,e){Te(document.head,d),s(l,sl,e),s(l,el,e),s(l,nl,e),U(u,l,e),s(l,Ml,e),U(m,l,e),s(l,al,e),s(l,h,e),s(l,yl,e),s(l,b,e),s(l,ol,e),U(J,l,e),s(l,il,e),s(l,T,e),s(l,pl,e),s(l,g,e),s(l,Ul,e),U(A,l,e),s(l,rl,e),s(l,f,e),s(l,jl,e),U(I,l,e),s(l,cl,e),s(l,B,e),s(l,wl,e),s(l,C,e),s(l,dl,e),U(k,l,e),s(l,Cl,e),U(Z,l,e),s(l,ul,e),s(l,v,e),s(l,ml,e),s(l,G,e),s(l,hl,e),s(l,W,e),s(l,bl,e),U(S,l,e),s(l,Jl,e),s(l,V,e),s(l,Tl,e),U(E,l,e),s(l,gl,e),U($,l,e),s(l,Al,e),s(l,Q,e),s(l,fl,e),s(l,_,e),s(l,Il,e),s(l,H,e),s(l,Bl,e),U(x,l,e),s(l,kl,e),s(l,R,e),s(l,Zl,e),s(l,X,e),s(l,vl,e),s(l,N,e),s(l,Gl,e),s(l,Y,e),s(l,Wl,e),U(L,l,e),s(l,Sl,e),s(l,z,e),s(l,Vl,e),U(F,l,e),s(l,El,e),s(l,q,e),s(l,$l,e),U(P,l,e),s(l,Ql,e),s(l,D,e),s(l,_l,e),s(l,K,e),s(l,Hl,e),s(l,O,e),s(l,xl,e),U(ll,l,e),s(l,Rl,e),s(l,tl,e),Xl=!0},p:ue,i(l){Xl||(r(u.$$.fragment,l),r(m.$$.fragment,l),r(J.$$.fragment,l),r(A.$$.fragment,l),r(I.$$.fragment,l),r(k.$$.fragment,l),r(Z.$$.fragment,l),r(S.$$.fragment,l),r(E.$$.fragment,l),r($.$$.fragment,l),r(x.$$.fragment,l),r(L.$$.fragment,l),r(F.$$.fragment,l),r(P.$$.fragment,l),r(ll.$$.fragment,l),Xl=!0)},o(l){j(u.$$.fragment,l),j(m.$$.fragment,l),j(J.$$.fragment,l),j(A.$$.fragment,l),j(I.$$.fragment,l),j(k.$$.fragment,l),j(Z.$$.fragment,l),j(S.$$.fragment,l),j(E.$$.fragment,l),j($.$$.fragment,l),j(x.$$.fragment,l),j(L.$$.fragment,l),j(F.$$.fragment,l),j(P.$$.fragment,l),j(ll.$$.fragment,l),Xl=!1},d(l){l&&(t(sl),t(el),t(nl),t(Ml),t(al),t(h),t(yl),t(b),t(ol),t(il),t(T),t(pl),t(g),t(Ul),t(rl),t(f),t(jl),t(cl),t(B),t(wl),t(C),t(dl),t(Cl),t(ul),t(v),t(ml),t(G),t(hl),t(W),t(bl),t(Jl),t(V),t(Tl),t(gl),t(Al),t(Q),t(fl),t(_),t(Il),t(H),t(Bl),t(kl),t(R),t(Zl),t(X),t(vl),t(N),t(Gl),t(Y),t(Wl),t(Sl),t(z),t(Vl),t(El),t(q),t($l),t(Ql),t(D),t(_l),t(K),t(Hl),t(O),t(xl),t(Rl),t(tl)),t(d),c(u,l),c(m,l),c(J,l),c(A,l),c(I,l),c(k,l),c(Z,l),c(S,l),c(E,l),c($,l),c(x,l),c(L,l),c(F,l),c(P,l),c(ll,l)}}}const Ie='{"title":"Orchestrate a multi-agent system 🤖🤝🤖","local":"orchestrate-a-multi-agent-system-","sections":[{"title":"🔍 Create a web search tool","local":"-create-a-web-search-tool","sections":[],"depth":2},{"title":"Build our multi-agent system 🤖🤝🤖","local":"build-our-multi-agent-system-","sections":[],"depth":2}],"depth":1}';function Be(Ll){return me(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Se extends he{constructor(d){super(),be(this,d,Be,fe,Ce,{})}}export{Se as component};
