import{s as Vs,o as Ys,n as C}from"../chunks/scheduler.505acc25.js";import{S as Qs,i as _s,e as b,s as J,c as w,h as Fs,a as I,d as p,b as h,f as Ns,g as y,j as f,k as Us,l as Ss,m as c,n as m,t as d,o as u,p as T}from"../chunks/index.fbb49fb4.js";import{C as xs}from"../chunks/CopyLLMTxtMenu.564b44fd.js";import{C as B}from"../chunks/CodeBlock.7f0851b7.js";import{H as L}from"../chunks/Heading.511e0027.js";import{H as bs,a as g}from"../chunks/HfOption.7b46941a.js";import{E as zs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8c19e80e.js";function Hs(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoVG9vbCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBEdWNrRHVja0dvJTIwc2VhcmNoJTIwdG9vbCUwQXNlYXJjaF90b29sJTIwJTNEJTIwRHVja0R1Y2tHb1NlYXJjaFRvb2woKSUwQSUwQSUyMyUyMEV4YW1wbGUlMjB1c2FnZSUwQXJlc3VsdHMlMjAlM0QlMjBzZWFyY2hfdG9vbCglMjJXaG8ncyUyMHRoZSUyMGN1cnJlbnQlMjBQcmVzaWRlbnQlMjBvZiUyMEZyYW5jZSUzRiUyMiklMEFwcmludChyZXN1bHRzKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> DuckDuckGoSearchTool

<span class="hljs-comment"># Initialize the DuckDuckGo search tool</span>
search_tool = DuckDuckGoSearchTool()

<span class="hljs-comment"># Example usage</span>
results = search_tool(<span class="hljs-string">&quot;Who&#x27;s the current President of France?&quot;</span>)
<span class="hljs-built_in">print</span>(results)`,wrap:!1}}),e=new B({props:{code:"VGhlJTIwY3VycmVudCUyMFByZXNpZGVudCUyMG9mJTIwRnJhbmNlJTIwaW4lMjBFbW1hbnVlbCUyME1hY3Jvbi4=",highlighted:'The current President <span class="hljs-keyword">of</span> France in Emmanuel Macron.',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function qs(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLmR1Y2tkdWNrZ28lMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoVG9vbFNwZWMlMEFmcm9tJTIwbGxhbWFfaW5kZXguY29yZS50b29scyUyMGltcG9ydCUyMEZ1bmN0aW9uVG9vbCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBEdWNrRHVja0dvJTIwc2VhcmNoJTIwdG9vbCUwQXRvb2xfc3BlYyUyMCUzRCUyMER1Y2tEdWNrR29TZWFyY2hUb29sU3BlYygpJTBBJTBBc2VhcmNoX3Rvb2wlMjAlM0QlMjBGdW5jdGlvblRvb2wuZnJvbV9kZWZhdWx0cyh0b29sX3NwZWMuZHVja2R1Y2tnb19mdWxsX3NlYXJjaCklMEElMjMlMjBFeGFtcGxlJTIwdXNhZ2UlMEFyZXNwb25zZSUyMCUzRCUyMHNlYXJjaF90b29sKCUyMldobydzJTIwdGhlJTIwY3VycmVudCUyMFByZXNpZGVudCUyMG9mJTIwRnJhbmNlJTNGJTIyKSUwQXByaW50KHJlc3BvbnNlLnJhd19vdXRwdXQlNUItMSU1RCU1Qidib2R5JyU1RCk=",highlighted:`<span class="hljs-keyword">from</span> llama_index.tools.duckduckgo <span class="hljs-keyword">import</span> DuckDuckGoSearchToolSpec
<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool

<span class="hljs-comment"># Initialize the DuckDuckGo search tool</span>
tool_spec = DuckDuckGoSearchToolSpec()

search_tool = FunctionTool.from_defaults(tool_spec.duckduckgo_full_search)
<span class="hljs-comment"># Example usage</span>
response = search_tool(<span class="hljs-string">&quot;Who&#x27;s the current President of France?&quot;</span>)
<span class="hljs-built_in">print</span>(response.raw_output[-<span class="hljs-number">1</span>][<span class="hljs-string">&#x27;body&#x27;</span>])`,wrap:!1}}),e=new B({props:{code:"VGhlJTIwUHJlc2lkZW50JTIwb2YlMjB0aGUlMjBGcmVuY2glMjBSZXB1YmxpYyUyMGlzJTIwdGhlJTIwaGVhZCUyMG9mJTIwc3RhdGUlMjBvZiUyMEZyYW5jZS4lMjBUaGUlMjBjdXJyZW50JTIwUHJlc2lkZW50JTIwaXMlMjBFbW1hbnVlbCUyME1hY3JvbiUyMHNpbmNlJTIwMTQlMjBNYXklMjAyMDE3JTIwZGVmZWF0aW5nJTIwTWFyaW5lJTIwTGUlMjBQZW4lMjBpbiUyMHRoZSUyMHNlY29uZCUyMHJvdW5kJTIwb2YlMjB0aGUlMjBwcmVzaWRlbnRpYWwlMjBlbGVjdGlvbiUyMG9uJTIwNyUyME1heSUyMDIwMTcuJTIwTGlzdCUyMG9mJTIwRnJlbmNoJTIwcHJlc2lkZW50cyUyMChGaWZ0aCUyMFJlcHVibGljKSUyME4lQzIlQjAlMjBQb3J0cmFpdCUyME5hbWUlMjAuLi4=",highlighted:'The President <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> French Republic is <span class="hljs-keyword">the</span> head <span class="hljs-keyword">of</span> state <span class="hljs-keyword">of</span> France. The current President is Emmanuel Macron since <span class="hljs-number">14</span> May <span class="hljs-number">2017</span> defeating Marine Le Pen <span class="hljs-keyword">in</span> <span class="hljs-keyword">the</span> <span class="hljs-keyword">second</span> <span class="hljs-built_in">round</span> <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> presidential election <span class="hljs-keyword">on</span> <span class="hljs-title">7</span> <span class="hljs-title">May</span> <span class="hljs-title">2017</span>. <span class="hljs-title">List</span> <span class="hljs-title">of</span> <span class="hljs-title">French</span> <span class="hljs-title">presidents</span> (<span class="hljs-title">Fifth</span> <span class="hljs-title">Republic</span>) <span class="hljs-title">N</span>° <span class="hljs-title">Portrait</span> <span class="hljs-title">Name</span> ...',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function Ds(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkudG9vbHMlMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoUnVuJTBBJTBBc2VhcmNoX3Rvb2wlMjAlM0QlMjBEdWNrRHVja0dvU2VhcmNoUnVuKCklMEFyZXN1bHRzJTIwJTNEJTIwc2VhcmNoX3Rvb2wuaW52b2tlKCUyMldobydzJTIwdGhlJTIwY3VycmVudCUyMFByZXNpZGVudCUyMG9mJTIwRnJhbmNlJTNGJTIyKSUwQXByaW50KHJlc3VsdHMp",highlighted:`<span class="hljs-keyword">from</span> langchain_community.tools <span class="hljs-keyword">import</span> DuckDuckGoSearchRun

search_tool = DuckDuckGoSearchRun()
results = search_tool.invoke(<span class="hljs-string">&quot;Who&#x27;s the current President of France?&quot;</span>)
<span class="hljs-built_in">print</span>(results)`,wrap:!1}}),e=new B({props:{code:"RW1tYW51ZWwlMjBNYWNyb24lMjAoYm9ybiUyMERlY2VtYmVyJTIwMjElMkMlMjAxOTc3JTJDJTIwQW1pZW5zJTJDJTIwRnJhbmNlKSUyMGlzJTIwYSUyMEZyZW5jaCUyMGJhbmtlciUyMGFuZCUyMHBvbGl0aWNpYW4lMjB3aG8lMjB3YXMlMjBlbGVjdGVkJTIwcHJlc2lkZW50JTIwb2YlMjBGcmFuY2UlMjBpbiUyMDIwMTcuLi4=",highlighted:'<span class="hljs-attribute">Emmanuel</span> Macron (born December <span class="hljs-number">21</span>, <span class="hljs-number">1977</span>, Amiens, France) is a French banker and politician who was elected president of France in <span class="hljs-number">2017</span>...',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function Ks(U){let n,M,t,r,o,e;return n=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[Hs]},$$scope:{ctx:U}}}),t=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[qs]},$$scope:{ctx:U}}}),o=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Ds]},$$scope:{ctx:U}}}),{c(){w(n.$$.fragment),M=J(),w(t.$$.fragment),r=J(),w(o.$$.fragment)},l(l){y(n.$$.fragment,l),M=h(l),y(t.$$.fragment,l),r=h(l),y(o.$$.fragment,l)},m(l,s){m(n,l,s),c(l,M,s),m(t,l,s),c(l,r,s),m(o,l,s),e=!0},p(l,s){const j={};s&2&&(j.$$scope={dirty:s,ctx:l}),n.$set(j);const Z={};s&2&&(Z.$$scope={dirty:s,ctx:l}),t.$set(Z);const G={};s&2&&(G.$$scope={dirty:s,ctx:l}),o.$set(G)},i(l){e||(d(n.$$.fragment,l),d(t.$$.fragment,l),d(o.$$.fragment,l),e=!0)},o(l){u(n.$$.fragment,l),u(t.$$.fragment,l),u(o.$$.fragment,l),e=!1},d(l){l&&(p(M),p(r)),T(n,l),T(t,l),T(o,l)}}}function Ls(U){let n,M;return n=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBaW1wb3J0JTIwcmFuZG9tJTBBJTBBY2xhc3MlMjBXZWF0aGVySW5mb1Rvb2woVG9vbCklM0ElMEElMjAlMjAlMjAlMjBuYW1lJTIwJTNEJTIwJTIyd2VhdGhlcl9pbmZvJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJGZXRjaGVzJTIwZHVtbXklMjB3ZWF0aGVyJTIwaW5mb3JtYXRpb24lMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMEElMjAlMjAlMjAlMjBpbnB1dHMlMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsb2NhdGlvbiUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJzdHJpbmclMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJkZXNjcmlwdGlvbiUyMiUzQSUyMCUyMlRoZSUyMGxvY2F0aW9uJTIwdG8lMjBnZXQlMjB3ZWF0aGVyJTIwaW5mb3JtYXRpb24lMjBmb3IuJTIyJTBBJTIwJ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ByZXR1cm4lMjBmJTIyV2VhdGhlciUyMGluJTIwJTdCbG9jYXRpb24lN0QlM0ElMjAlN0JkYXRhJTVCJ2NvbmRpdGlvbiclNUQlN0QlMkMlMjAlN0JkYXRhJTVCJ3RlbXBfYyclNUQlN0QlQzIlQjBDJTIyJTBBJTBBJTIzJTIwSW5pdGlhbGl6ZSUyMHRoZSUyMHRvb2wlMEF3ZWF0aGVyX2luZm9fdG9vbCUyMCUzRCUyMFdlYXRoZXJJbmZvVG9vbCgp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Tool
<span class="hljs-keyword">import</span> random

<span class="hljs-keyword">class</span> <span class="hljs-title class_">WeatherInfoTool</span>(<span class="hljs-title class_ inherited__">Tool</span>):
    name = <span class="hljs-string">&quot;weather_info&quot;</span>
    description = <span class="hljs-string">&quot;Fetches dummy weather information for a given location.&quot;</span>
    inputs = {
        <span class="hljs-string">&quot;location&quot;</span>: {
            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
            <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;The location to get weather information for.&quot;</span>
        }
    }
    output_type = <span class="hljs-string">&quot;string&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, location: <span class="hljs-built_in">str</span></span>):
        <span class="hljs-comment"># Dummy weather data</span>
        weather_conditions = [
            {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Rainy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">15</span>},
            {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Clear&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">25</span>},
            {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Windy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
        ]
        <span class="hljs-comment"># Randomly select a weather condition</span>
        data = random.choice(weather_conditions)
        <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Weather in <span class="hljs-subst">{location}</span>: <span class="hljs-subst">{data[<span class="hljs-string">&#x27;condition&#x27;</span>]}</span>, <span class="hljs-subst">{data[<span class="hljs-string">&#x27;temp_c&#x27;</span>]}</span>°C&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
weather_info_tool = WeatherInfoTool()`,wrap:!1}}),{c(){w(n.$$.fragment)},l(t){y(n.$$.fragment,t)},m(t,r){m(n,t,r),M=!0},p:C,i(t){M||(d(n.$$.fragment,t),M=!0)},o(t){u(n.$$.fragment,t),M=!1},d(t){T(n,t)}}}function Ps(U){let n,M;return n=new B({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEElMEFkZWYlMjBnZXRfd2VhdGhlcl9pbmZvKGxvY2F0aW9uJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJGZXRjaGVzJTIwZHVtbXklMjB3ZWF0aGVyJTIwaW5mb3JtYXRpb24lMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjAlMjMlMjBEdW1teSUyMHdlYXRoZXIlMjBkYXRhJTBBJTIwJTIwJTIwJTIwd2VhdGhlcl9jb25kaXRpb25zJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIyY29uZGl0aW9uJTIyJTNBJTIwJTIyUmFpbnklMjIlMkMlMjAlMjJ0ZW1wX2MlMjIlM0ElMjAxNSU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMmNvbmRpdGlvbiUyMiUzQSUyMCUyMkNsZWFyJTIyJTJDJTIwJTIydGVtcF9jJTIyJTNBJTIwMjUlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJjb25kaXRpb24lMjIlM0ElMjAlMjJXaW5keSUyMiUyQyUyMCUyMnRlbXBfYyUyMiUzQSUyMDIwJTdEJTBBJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTIzJTIwUmFuZG9tbHklMjBzZWxlY3QlMjBhJTIwd2VhdGhlciUyMGNvbmRpdGlvbiUwQSUyMCUyMCUyMCUyMGRhdGElMjAlM0QlMjByYW5kb20uY2hvaWNlKHdlYXRoZXJfY29uZGl0aW9ucyklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyV2VhdGhlciUyMGluJTIwJTdCbG9jYXRpb24lN0QlM0ElMjAlN0JkYXRhJTVCJ2NvbmRpdGlvbiclNUQlN0QlMkMlMjAlN0JkYXRhJTVCJ3RlbXBfYyclNUQlN0QlQzIlQjBDJTIyJTBBJTBBJTIzJTIwSW5pdGlhbGl6ZSUyMHRoZSUyMHRvb2wlMEF3ZWF0aGVyX2luZm9fdG9vbCUyMCUzRCUyMEZ1bmN0aW9uVG9vbC5mcm9tX2RlZmF1bHRzKGdldF93ZWF0aGVyX2luZm8p",highlighted:`<span class="hljs-keyword">import</span> random
<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_weather_info</span>(<span class="hljs-params">location: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Fetches dummy weather information for a given location.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Dummy weather data</span>
    weather_conditions = [
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Rainy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">15</span>},
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Clear&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">25</span>},
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Windy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
    ]
    <span class="hljs-comment"># Randomly select a weather condition</span>
    data = random.choice(weather_conditions)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Weather in <span class="hljs-subst">{location}</span>: <span class="hljs-subst">{data[<span class="hljs-string">&#x27;condition&#x27;</span>]}</span>, <span class="hljs-subst">{data[<span class="hljs-string">&#x27;temp_c&#x27;</span>]}</span>°C&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
weather_info_tool = FunctionTool.from_defaults(get_weather_info)`,wrap:!1}}),{c(){w(n.$$.fragment)},l(t){y(n.$$.fragment,t)},m(t,r){m(n,t,r),M=!0},p:C,i(t){M||(d(n.$$.fragment,t),M=!0)},o(t){u(n.$$.fragment,t),M=!1},d(t){T(n,t)}}}function Os(U){let n,M;return n=new B({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi50b29scyUyMGltcG9ydCUyMFRvb2wlMEFpbXBvcnQlMjByYW5kb20lMEElMEFkZWYlMjBnZXRfd2VhdGhlcl9pbmZvKGxvY2F0aW9uJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJGZXRjaGVzJTIwZHVtbXklMjB3ZWF0aGVyJTIwaW5mb3JtYXRpb24lMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjAlMjMlMjBEdW1teSUyMHdlYXRoZXIlMjBkYXRhJTBBJTIwJTIwJTIwJTIwd2VhdGhlcl9jb25kaXRpb25zJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIyY29uZGl0aW9uJTIyJT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keyword">from</span> langchain.tools <span class="hljs-keyword">import</span> Tool
<span class="hljs-keyword">import</span> random

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_weather_info</span>(<span class="hljs-params">location: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Fetches dummy weather information for a given location.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Dummy weather data</span>
    weather_conditions = [
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Rainy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">15</span>},
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Clear&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">25</span>},
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Windy&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
    ]
    <span class="hljs-comment"># Randomly select a weather condition</span>
    data = random.choice(weather_conditions)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Weather in <span class="hljs-subst">{location}</span>: <span class="hljs-subst">{data[<span class="hljs-string">&#x27;condition&#x27;</span>]}</span>, <span class="hljs-subst">{data[<span class="hljs-string">&#x27;temp_c&#x27;</span>]}</span>°C&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
weather_info_tool = Tool(
    name=<span class="hljs-string">&quot;get_weather_info&quot;</span>,
    func=get_weather_info,
    description=<span class="hljs-string">&quot;Fetches dummy weather information for a given location.&quot;</span>
)`,wrap:!1}}),{c(){w(n.$$.fragment)},l(t){y(n.$$.fragment,t)},m(t,r){m(n,t,r),M=!0},p:C,i(t){M||(d(n.$$.fragment,t),M=!0)},o(t){u(n.$$.fragment,t),M=!1},d(t){T(n,t)}}}function sl(U){let n,M,t,r,o,e;return n=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[Ls]},$$scope:{ctx:U}}}),t=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Ps]},$$scope:{ctx:U}}}),o=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Os]},$$scope:{ctx:U}}}),{c(){w(n.$$.fragment),M=J(),w(t.$$.fragment),r=J(),w(o.$$.fragment)},l(l){y(n.$$.fragment,l),M=h(l),y(t.$$.fragment,l),r=h(l),y(o.$$.fragment,l)},m(l,s){m(n,l,s),c(l,M,s),m(t,l,s),c(l,r,s),m(o,l,s),e=!0},p(l,s){const j={};s&2&&(j.$$scope={dirty:s,ctx:l}),n.$set(j);const Z={};s&2&&(Z.$$scope={dirty:s,ctx:l}),t.$set(Z);const G={};s&2&&(G.$$scope={dirty:s,ctx:l}),o.$set(G)},i(l){e||(d(n.$$.fragment,l),d(t.$$.fragment,l),d(o.$$.fragment,l),e=!0)},o(l){u(n.$$.fragment,l),u(t.$$.fragment,l),u(o.$$.fragment,l),e=!1},d(l){l&&(p(M),p(r)),T(n,l),T(t,l),T(o,l)}}}function ll(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfbW9kZWxzJTBBJTBBY2xhc3MlMjBIdWJTdGF0c1Rvb2woVG9vbCklM0ElMEElMjAlMjAlMjAlMjBuYW1lJTIwJTNEJTIwJTIyaHViX3N0YXRzJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJGZXRjaGVzJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGZyb20lMjBhJTIwc3BlY2lmaWMlMjBhdXRob3IlMjBvbiUyMHRoZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViLiUyMiUwQSUyMCUyMCUyMCUyMGlucHV0cyUyMCUzRCUyMCU3Qi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TIwJTIzJTIwRXhhbXBsZSUzQSUyMEdldCUyMHRoZSUyMG1vc3QlMjBkb3dubG9hZGVkJTIwbW9kZWwlMjBieSUyMEZhY2Vib29r",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Tool
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

<span class="hljs-keyword">class</span> <span class="hljs-title class_">HubStatsTool</span>(<span class="hljs-title class_ inherited__">Tool</span>):
    name = <span class="hljs-string">&quot;hub_stats&quot;</span>
    description = <span class="hljs-string">&quot;Fetches the most downloaded model from a specific author on the Hugging Face Hub.&quot;</span>
    inputs = {
        <span class="hljs-string">&quot;author&quot;</span>: {
            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
            <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;The username of the model author/organization to find models from.&quot;</span>
        }
    }
    output_type = <span class="hljs-string">&quot;string&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, author: <span class="hljs-built_in">str</span></span>):
        <span class="hljs-keyword">try</span>:
            <span class="hljs-comment"># List models from the specified author, sorted by downloads</span>
            models = <span class="hljs-built_in">list</span>(list_models(author=author, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>, limit=<span class="hljs-number">1</span>))
            
            <span class="hljs-keyword">if</span> models:
                model = models[<span class="hljs-number">0</span>]
                <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;The most downloaded model by <span class="hljs-subst">{author}</span> is <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> with <span class="hljs-subst">{model.downloads:,}</span> downloads.&quot;</span>
            <span class="hljs-keyword">else</span>:
                <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;No models found for author <span class="hljs-subst">{author}</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;Error fetching models for <span class="hljs-subst">{author}</span>: <span class="hljs-subst">{<span class="hljs-built_in">str</span>(e)}</span>&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
hub_stats_tool = HubStatsTool()

<span class="hljs-comment"># Example usage</span>
<span class="hljs-built_in">print</span>(hub_stats_tool(<span class="hljs-string">&quot;facebook&quot;</span>)) <span class="hljs-comment"># Example: Get the most downloaded model by Facebook</span>`,wrap:!1}}),e=new B({props:{code:"VGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGJ5JTIwZmFjZWJvb2slMjBpcyUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMHdpdGglMjAxMiUyQzU0NCUyQzU1MCUyMGRvd25sb2Fkcy4=",highlighted:'<span class="hljs-attribute">The</span> most downloaded model by facebook is facebook/esmfold_v1 with <span class="hljs-number">12</span>,<span class="hljs-number">544</span>,<span class="hljs-number">550</span> downloads.',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function al(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwbGlzdF9tb2RlbHMlMEElMEFk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ElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyTm8lMjBtb2RlbHMlMjBmb3VuZCUyMGZvciUyMGF1dGhvciUyMCU3QmF1dGhvciU3RC4lMjIlMEElMjAlMjAlMjAlMjBleGNlcHQlMjBFeGNlcHRpb24lMjBhcyUyMGUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyRXJyb3IlMjBmZXRjaGluZyUyMG1vZGVscyUyMGZvciUyMCU3QmF1dGhvciU3RCUzQSUyMCU3QnN0cihlKSU3RCUyMiUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjB0b29sJTBBaHViX3N0YXRzX3Rvb2wlMjAlM0QlMjBGdW5jdGlvblRvb2wuZnJvbV9kZWZhdWx0cyhnZXRfaHViX3N0YXRzKSUwQSUwQSUyMyUyMEV4YW1wbGUlMjB1c2FnZSUwQXByaW50KGh1Yl9zdGF0c190b29sKCUyMmZhY2Vib29rJTIyKSklMjAlMjMlMjBFeGFtcGxlJTNBJTIwR2V0JTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGJ5JTIwRmFjZWJvb2s=",highlighted:`<span class="hljs-keyword">import</span> random
<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_hub_stats</span>(<span class="hljs-params">author: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Fetches the most downloaded model from a specific author on the Hugging Face Hub.&quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># List models from the specified author, sorted by downloads</span>
        models = <span class="hljs-built_in">list</span>(list_models(author=author, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>, limit=<span class="hljs-number">1</span>))

        <span class="hljs-keyword">if</span> models:
            model = models[<span class="hljs-number">0</span>]
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;The most downloaded model by <span class="hljs-subst">{author}</span> is <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> with <span class="hljs-subst">{model.downloads:,}</span> downloads.&quot;</span>
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;No models found for author <span class="hljs-subst">{author}</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;Error fetching models for <span class="hljs-subst">{author}</span>: <span class="hljs-subst">{<span class="hljs-built_in">str</span>(e)}</span>&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
hub_stats_tool = FunctionTool.from_defaults(get_hub_stats)

<span class="hljs-comment"># Example usage</span>
<span class="hljs-built_in">print</span>(hub_stats_tool(<span class="hljs-string">&quot;facebook&quot;</span>)) <span class="hljs-comment"># Example: Get the most downloaded model by Facebook</span>`,wrap:!1}}),e=new B({props:{code:"VGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGJ5JTIwZmFjZWJvb2slMjBpcyUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMHdpdGglMjAxMiUyQzU0NCUyQzU1MCUyMGRvd25sb2Fkcy4=",highlighted:'<span class="hljs-attribute">The</span> most downloaded model by facebook is facebook/esmfold_v1 with <span class="hljs-number">12</span>,<span class="hljs-number">544</span>,<span class="hljs-number">550</span> downloads.',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s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yUyMEV4YW1wbGUlMjB1c2FnZSUwQXByaW50KGh1Yl9zdGF0c190b29sLmludm9rZSglMjJmYWNlYm9vayUyMikpJTIwJTIzJTIwRXhhbXBsZSUzQSUyMEdldCUyMHRoZSUyMG1vc3QlMjBkb3dubG9hZGVkJTIwbW9kZWwlMjBieSUyMEZhY2Vib29r",highlighted:`<span class="hljs-keyword">from</span> langchain.tools <span class="hljs-keyword">import</span> Tool
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_hub_stats</span>(<span class="hljs-params">author: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Fetches the most downloaded model from a specific author on the Hugging Face Hub.&quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># List models from the specified author, sorted by downloads</span>
        models = <span class="hljs-built_in">list</span>(list_models(author=author, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>, limit=<span class="hljs-number">1</span>))

        <span class="hljs-keyword">if</span> models:
            model = models[<span class="hljs-number">0</span>]
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;The most downloaded model by <span class="hljs-subst">{author}</span> is <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> with <span class="hljs-subst">{model.downloads:,}</span> downloads.&quot;</span>
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;No models found for author <span class="hljs-subst">{author}</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;Error fetching models for <span class="hljs-subst">{author}</span>: <span class="hljs-subst">{<span class="hljs-built_in">str</span>(e)}</span>&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
hub_stats_tool = Tool(
    name=<span class="hljs-string">&quot;get_hub_stats&quot;</span>,
    func=get_hub_stats,
    description=<span class="hljs-string">&quot;Fetches the most downloaded model from a specific author on the Hugging Face Hub.&quot;</span>
)

<span class="hljs-comment"># Example usage</span>
<span class="hljs-built_in">print</span>(hub_stats_tool.invoke(<span class="hljs-string">&quot;facebook&quot;</span>)) <span class="hljs-comment"># Example: Get the most downloaded model by Facebook</span>`,wrap:!1}}),e=new B({props:{code:"VGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGJ5JTIwZmFjZWJvb2slMjBpcyUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMHdpdGglMjAxMyUyQzEwOSUyQzg2MSUyMGRvd25sb2Fkcy4=",highlighted:'<span class="hljs-attribute">The</span> most downloaded model by facebook is facebook/esmfold_v1 with <span class="hljs-number">13</span>,<span class="hljs-number">109</span>,<span class="hljs-number">861</span> downloads.',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function nl(U){let n,M,t,r,o,e;return n=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ll]},$$scope:{ctx:U}}}),t=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[al]},$$scope:{ctx:U}}}),o=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[tl]},$$scope:{ctx:U}}}),{c(){w(n.$$.fragment),M=J(),w(t.$$.fragment),r=J(),w(o.$$.fragment)},l(l){y(n.$$.fragment,l),M=h(l),y(t.$$.fragment,l),r=h(l),y(o.$$.fragment,l)},m(l,s){m(n,l,s),c(l,M,s),m(t,l,s),c(l,r,s),m(o,l,s),e=!0},p(l,s){const j={};s&2&&(j.$$scope={dirty:s,ctx:l}),n.$set(j);const Z={};s&2&&(Z.$$scope={dirty:s,ctx:l}),t.$set(Z);const G={};s&2&&(G.$$scope={dirty:s,ctx:l}),o.$set(G)},i(l){e||(d(n.$$.fragment,l),d(t.$$.fragment,l),d(o.$$.fragment,l),e=!0)},o(l){u(n.$$.fragment,l),u(t.$$.fragment,l),u(o.$$.fragment,l),e=!1},d(l){l&&(p(M),p(r)),T(n,l),T(t,l),T(o,l)}}}function el(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBIdWdnaW5nJTIwRmFjZSUyMG1vZGVsJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBJTBBJTIzJTIwQ3JlYXRlJTIwQWxmcmVkJTIwd2l0aCUyMGFsbCUyMHRoZSUyMHRvb2xzJTBBYWxmcmVkJTIwJTNEJTIwQ29kZUFnZW50KCUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEJTVCc2VhcmNoX3Rvb2wlMkMlMjB3ZWF0aGVyX2luZm9fdG9vbCUyQyUyMGh1Yl9zdGF0c190b29sJTVEJTJDJTIwJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUwQSklMEElMEElMjMlMjBFeGFtcGxlJTIwcXVlcnklMjBBbGZyZWQlMjBtaWdodCUyMHJlY2VpdmUlMjBkdXJpbmclMjB0aGUlMjBnYWxhJTBBcmVzcG9uc2UlMjAlM0QlMjBhbGZyZWQucnVuKCUyMldoYXQlMjBpcyUyMEZhY2Vib29rJTIwYW5kJTIwd2hhdCdzJTIwdGhlaXIlMjBtb3N0JTIwcG9wdWxhciUyMG1vZGVsJTNGJTIyKSUwQSUwQXByaW50KCUyMiVGMCU5RiU4RSVBOSUyMEFsZnJlZCdzJTIwUmVzcG9uc2UlM0ElMjIpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

<span class="hljs-comment"># Initialize the Hugging Face model</span>
model = InferenceClientModel()

<span class="hljs-comment"># Create Alfred with all the tools</span>
alfred = CodeAgent(
    tools=[search_tool, weather_info_tool, hub_stats_tool], 
    model=model
)

<span class="hljs-comment"># Example query Alfred might receive during the gala</span>
response = alfred.run(<span class="hljs-string">&quot;What is Facebook and what&#x27;s their most popular model?&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),e=new B({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUZhY2Vib29rJTIwaXMlMjBhJTIwc29jaWFsJTIwbmV0d29ya2luZyUyMHdlYnNpdGUlMjB3aGVyZSUyMHVzZXJzJTIwY2FuJTIwY29ubmVjdCUyQyUyMHNoYXJlJTIwaW5mb3JtYXRpb24lMkMlMjBhbmQlMjBpbnRlcmFjdCUyMHdpdGglMjBvdGhlcnMuJTIwVGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMGJ5JTIwRmFjZWJvb2slMjBvbiUyMHRoZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViJTIwaXMlMjBFU01Gb2xkX3YxLg==",highlighted:`🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>
Facebook <span class="hljs-built_in">is</span> a social networking website <span class="hljs-keyword">where</span> users can connect, share information, <span class="hljs-built_in">and</span> interact <span class="hljs-keyword">with</span> others. The most downloaded model <span class="hljs-keyword">by</span> Facebook <span class="hljs-keyword">on</span> the Hugging Face Hub <span class="hljs-built_in">is</span> ESMFold_v1.`,wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-zgvuej"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function ol(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUuYWdlbnQud29ya2Zsb3clMjBpbXBvcnQlMjBBZ2VudFdvcmtmbG93JTBBZnJvbSUyMGxsYW1hX2luZGV4LmxsbXMuaHVnZ2luZ2ZhY2VfYXBpJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEklMEElMEElMjMlMjBJbml0aWFsaXplJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBtb2RlbCUwQWxsbSUyMCUzRCUyMEh1Z2dpbmdGYWNlSW5mZXJlbmNlQVBJKG1vZGVsX25hbWUlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIpJTBBJTIzJTIwQ3JlYXRlJTIwQWxmcmVkJTIwd2l0aCUyMGFsbCUyMHRoZSUyMHRvb2xzJTBBYWxmcmVkJTIwJTNEJTIwQWdlbnRXb3JrZmxvdy5mcm9tX3Rvb2xzX29yX2Z1bmN0aW9ucyglMEElMjAlMjAlMjAlMjAlNUJzZWFyY2hfdG9vbCUyQyUyMHdlYXRoZXJfaW5mb190b29sJTJDJTIwaHViX3N0YXRzX3Rvb2wlNUQlMkMlMEElMjAlMjAlMjAlMjBsbG0lM0RsbG0lMEEpJTBBJTBBJTIzJTIwRXhhbXBsZSUyMHF1ZXJ5JTIwQWxmcmVkJTIwbWlnaHQlMjByZWNlaXZlJTIwZHVyaW5nJTIwdGhlJTIwZ2FsYSUwQXJlc3BvbnNlJTIwJTNEJTIwYXdhaXQlMjBhbGZyZWQucnVuKCUyMldoYXQlMjBpcyUyMEZhY2Vib29rJTIwYW5kJTIwd2hhdCdzJTIwdGhlaXIlMjBtb3N0JTIwcG9wdWxhciUyMG1vZGVsJTNGJTIyKSUwQSUwQXByaW50KCUyMiVGMCU5RiU4RSVBOSUyMEFsZnJlZCdzJTIwUmVzcG9uc2UlM0ElMjIpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-keyword">from</span> llama_index.core.agent.workflow <span class="hljs-keyword">import</span> AgentWorkflow
<span class="hljs-keyword">from</span> llama_index.llms.huggingface_api <span class="hljs-keyword">import</span> HuggingFaceInferenceAPI

<span class="hljs-comment"># Initialize the Hugging Face model</span>
llm = HuggingFaceInferenceAPI(model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>)
<span class="hljs-comment"># Create Alfred with all the tools</span>
alfred = AgentWorkflow.from_tools_or_functions(
    [search_tool, weather_info_tool, hub_stats_tool],
    llm=llm
)

<span class="hljs-comment"># Example query Alfred might receive during the gala</span>
response = <span class="hljs-keyword">await</span> alfred.run(<span class="hljs-string">&quot;What is Facebook and what&#x27;s their most popular model?&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),e=new B({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUZhY2Vib29rJTIwaXMlMjBhJTIwc29jaWFsJTIwbmV0d29ya2luZyUyMHNlcnZpY2UlMjBhbmQlMjB0ZWNobm9sb2d5JTIwY29tcGFueSUyMGJhc2VkJTIwaW4lMjBNZW5sbyUyMFBhcmslMkMlMjBDYWxpZm9ybmlhLiUyMEl0JTIwd2FzJTIwZm91bmRlZCUyMGJ5JTIwTWFyayUyMFp1Y2tlcmJlcmclMjBhbmQlMjBhbGxvd3MlMjBwZW9wbGUlMjB0byUyMGNyZWF0ZSUyMHByb2ZpbGVzJTJDJTIwY29ubmVjdCUyMHdpdGglMjBmcmllbmRzJTIwYW5kJTIwZmFtaWx5JTJDJTIwc2hhcmUlMjBwaG90b3MlMjBhbmQlMjB2aWRlb3MlMkMlMjBhbmQlMjBqb2luJTIwZ3JvdXBzJTIwYmFzZWQlMjBvbiUyMHNoYXJlZCUyMGludGVyZXN0cy4lMjBUaGUlMjBtb3N0JTIwcG9wdWxhciUyMG1vZGVsJTIwYnklMjBGYWNlYm9vayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlMjBpcyUyMCU2MGZhY2Vib29rJTJGZXNtZm9sZF92MSU2MCUyMHdpdGglMjAxMyUyQzEwOSUyQzg2MSUyMGRvd25sb2Fkcy4=",highlighted:'🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>\nFacebook <span class="hljs-built_in">is</span> a social networking service <span class="hljs-built_in">and</span> technology company based <span class="hljs-keyword">in</span> Menlo Park, California. It was founded <span class="hljs-keyword">by</span> Mark Zuckerberg <span class="hljs-built_in">and</span> allows people <span class="hljs-keyword">to</span> create profiles, connect <span class="hljs-keyword">with</span> friends <span class="hljs-built_in">and</span> family, share photos <span class="hljs-built_in">and</span> videos, <span class="hljs-built_in">and</span> <span class="hljs-keyword">join</span> groups based <span class="hljs-keyword">on</span> <span class="hljs-keyword">shared</span> interests. The most popular model <span class="hljs-keyword">by</span> Facebook <span class="hljs-keyword">on</span> the Hugging Face Hub <span class="hljs-built_in">is</span> `facebook/esmfold_v1` <span class="hljs-keyword">with</span> <span class="hljs-number">13</span>,<span class="hljs-number">109</span>,<span class="hljs-number">861</span> downloads.',wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-zgvuej"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function Ml(U){let n,M,t,r="Expected output:",o,e,l;return n=new B({props:{code:"ZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMFR5cGVkRGljdCUyQyUyMEFubm90YXRlZCUwQWZyb20lMjBsYW5nZ3JhcGguZ3JhcGgubWVzc2FnZSUyMGltcG9ydCUyMGFkZF9tZXNzYWdlcyUwQWZyb20lMjBsYW5nY2hhaW5fY29yZS5tZXNzYWdlcyUyMGltcG9ydCUyMEFueU1lc3NhZ2UlMkMlMjBIdW1hbk1lc3NhZ2UlMkMlMjBBSU1lc3NhZ2UlMEFmcm9tJTIwbGFuZ2dyYXBoLnByZWJ1aWx0JTIwaW1wb3J0JTIwVG9vbE5vZGUlMEFmcm9tJTIwbGFuZ2dyYXBoLmdyYXBoJTIwaW1wb3J0JTIwU1RBUlQlMkMlMjBTdGF0ZUdyYXBoJTBBZnJvbSUyMGxhbmdncmFwaC5wcmVidWlsdCUyMGltcG9ydCUyMHRvb2xzX2NvbmRpdGlvbiUwQWZyb20lMjBsYW5nY2hhaW5faHVnZ2luZ2ZhY2UlMjBpbXBvcnQlMjBIdWdnaW5nRmFjZUVuZHBvaW50JTJDJTIwQ2hhdEh1Z2dpbmdGYWNlJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjB0aGUlMjBjaGF0JTIwaW50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JTIwbW9zdCUyMHBvcHVsYXIlMjBtb2RlbCUzRiUyMiklNUQlMEFyZXNwb25zZSUyMCUzRCUyMGFsZnJlZC5pbnZva2UoJTdCJTIybWVzc2FnZXMlMjIlM0ElMjBtZXNzYWdlcyU3RCklMEElMEFwcmludCglMjIlRjAlOUYlOEUlQTklMjBBbGZyZWQncyUyMFJlc3BvbnNlJTNBJTIyKSUwQXByaW50KHJlc3BvbnNlJTVCJ21lc3NhZ2VzJyU1RCU1Qi0xJTVELmNvbnRlbnQp",highlighted:`<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> TypedDict, Annotated
<span class="hljs-keyword">from</span> langgraph.graph.message <span class="hljs-keyword">import</span> add_messages
<span class="hljs-keyword">from</span> langchain_core.messages <span class="hljs-keyword">import</span> AnyMessage, HumanMessage, AIMessage
<span class="hljs-keyword">from</span> langgraph.prebuilt <span class="hljs-keyword">import</span> ToolNode
<span class="hljs-keyword">from</span> langgraph.graph <span class="hljs-keyword">import</span> START, StateGraph
<span class="hljs-keyword">from</span> langgraph.prebuilt <span class="hljs-keyword">import</span> tools_condition
<span class="hljs-keyword">from</span> langchain_huggingface <span class="hljs-keyword">import</span> HuggingFaceEndpoint, ChatHuggingFace

<span class="hljs-comment"># Generate the chat interface, including the tools</span>
llm = HuggingFaceEndpoint(
    repo_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
    huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
)

chat = ChatHuggingFace(llm=llm, verbose=<span class="hljs-literal">True</span>)
tools = [search_tool, weather_info_tool, hub_stats_tool]
chat_with_tools = chat.bind_tools(tools)

<span class="hljs-comment"># Generate the AgentState and Agent graph</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">AgentState</span>(<span class="hljs-title class_ inherited__">TypedDict</span>):
    messages: Annotated[<span class="hljs-built_in">list</span>[AnyMessage], add_messages]

<span class="hljs-keyword">def</span> <span class="hljs-title function_">assistant</span>(<span class="hljs-params">state: AgentState</span>):
    <span class="hljs-keyword">return</span> {
        <span class="hljs-string">&quot;messages&quot;</span>: [chat_with_tools.invoke(state[<span class="hljs-string">&quot;messages&quot;</span>])],
    }

<span class="hljs-comment">## The graph</span>
builder = StateGraph(AgentState)

<span class="hljs-comment"># Define nodes: these do the work</span>
builder.add_node(<span class="hljs-string">&quot;assistant&quot;</span>, assistant)
builder.add_node(<span class="hljs-string">&quot;tools&quot;</span>, ToolNode(tools))

<span class="hljs-comment"># Define edges: these determine how the control flow moves</span>
builder.add_edge(START, <span class="hljs-string">&quot;assistant&quot;</span>)
builder.add_conditional_edges(
    <span class="hljs-string">&quot;assistant&quot;</span>,
    <span class="hljs-comment"># If the latest message requires a tool, route to tools</span>
    <span class="hljs-comment"># Otherwise, provide a direct response</span>
    tools_condition,
)
builder.add_edge(<span class="hljs-string">&quot;tools&quot;</span>, <span class="hljs-string">&quot;assistant&quot;</span>)
alfred = builder.<span class="hljs-built_in">compile</span>()

messages = [HumanMessage(content=<span class="hljs-string">&quot;Who is Facebook and what&#x27;s their most popular model?&quot;</span>)]
response = alfred.invoke({<span class="hljs-string">&quot;messages&quot;</span>: messages})

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response[<span class="hljs-string">&#x27;messages&#x27;</span>][-<span class="hljs-number">1</span>].content)`,wrap:!1}}),e=new B({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUZhY2Vib29rJTIwaXMlMjBhJTIwc29jaWFsJTIwbWVkaWElMjBjb21wYW55JTIwa25vd24lMjBmb3IlMjBpdHMlMjBzb2NpYWwlMjBuZXR3b3JraW5nJTIwc2l0ZSUyQyUyMEZhY2Vib29rJTJDJTIwYXMlMjB3ZWxsJTIwYXMlMjBvdGhlciUyMHNlcnZpY2VzJTIwbGlrZSUyMEluc3RhZ3JhbSUyMGFuZCUyMFdoYXRzQXBwLiUyMFRoZSUyMG1vc3QlMjBkb3dubG9hZGVkJTIwbW9kZWwlMjBieSUyMEZhY2Vib29rJTIwb24lMjB0aGUlMjBIdWdnaW5nJTIwRmFjZSUyMEh1YiUyMGlzJTIwZmFjZWJvb2slMkZlc21mb2xkX3YxJTIwd2l0aCUyMDEzJTJDMjAyJTJDMzIxJTIwZG93bmxvYWRzLg==",highlighted:`🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>
Facebook <span class="hljs-built_in">is</span> a social media company known <span class="hljs-keyword">for</span> its social networking site, Facebook, <span class="hljs-keyword">as</span> well <span class="hljs-keyword">as</span> other services <span class="hljs-built_in">like</span> Instagram <span class="hljs-built_in">and</span> WhatsApp. The most downloaded model <span class="hljs-keyword">by</span> Facebook <span class="hljs-keyword">on</span> the Hugging Face Hub <span class="hljs-built_in">is</span> facebook/esmfold_v1 <span class="hljs-keyword">with</span> <span class="hljs-number">13</span>,<span class="hljs-number">202</span>,<span class="hljs-number">321</span> downloads.`,wrap:!1}}),{c(){w(n.$$.fragment),M=J(),t=b("p"),t.textContent=r,o=J(),w(e.$$.fragment)},l(s){y(n.$$.fragment,s),M=h(s),t=I(s,"P",{"data-svelte-h":!0}),f(t)!=="svelte-15t3xg7"&&(t.textContent=r),o=h(s),y(e.$$.fragment,s)},m(s,j){m(n,s,j),c(s,M,j),c(s,t,j),c(s,o,j),m(e,s,j),l=!0},p:C,i(s){l||(d(n.$$.fragment,s),d(e.$$.fragment,s),l=!0)},o(s){u(n.$$.fragment,s),u(e.$$.fragment,s),l=!1},d(s){s&&(p(M),p(t),p(o)),T(n,s),T(e,s)}}}function pl(U){let n,M,t,r,o,e;return n=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[el]},$$scope:{ctx:U}}}),t=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[ol]},$$scope:{ctx:U}}}),o=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Ml]},$$scope:{ctx:U}}}),{c(){w(n.$$.fragment),M=J(),w(t.$$.fragment),r=J(),w(o.$$.fragment)},l(l){y(n.$$.fragment,l),M=h(l),y(t.$$.fragment,l),r=h(l),y(o.$$.fragment,l)},m(l,s){m(n,l,s),c(l,M,s),m(t,l,s),c(l,r,s),m(o,l,s),e=!0},p(l,s){const j={};s&2&&(j.$$scope={dirty:s,ctx:l}),n.$set(j);const Z={};s&2&&(Z.$$scope={dirty:s,ctx:l}),t.$set(Z);const G={};s&2&&(G.$$scope={dirty:s,ctx:l}),o.$set(G)},i(l){e||(d(n.$$.fragment,l),d(t.$$.fragment,l),d(o.$$.fragment,l),e=!0)},o(l){u(n.$$.fragment,l),u(t.$$.fragment,l),u(o.$$.fragment,l),e=!1},d(l){l&&(p(M),p(r)),T(n,l),T(t,l),T(o,l)}}}function cl(U){let n,M,t,r,o,e,l,s,j,Z=`In this section, we’ll grant Alfred access to the web, enabling him to find the latest news and global updates.
Additionally, he’ll have access to weather data and Hugging Face hub model download statistics, so that he can make relevant conversation about fresh topics.`,G,v,O,X,Is="Remember that we want Alfred to establish his presence as a true renaissance host, with a deep knowledge of the world.",ss,N,fs="To do so, we need to make sure that Alfred has access to the latest news and information about the world.",ls,V,Bs="Let’s start by creating a web search tool for Alfred!",as,$,ts,Y,ns,Q,Gs="The perfect gala would have fireworks over a clear sky, we need to make sure the fireworks are not cancelled due to bad weather.",es,_,Zs="Let’s create a custom tool that can be used to call an external weather API and get the weather information for a given location.",os,k,gs='<p>For the sake of simplicity, we’re using a dummy weather API for this example. If you want to use a real weather API, you could implement a weather tool that uses the OpenWeatherMap API, like in <a href="../../unit1/tutorial">Unit 1</a>.</p>',Ms,W,ps,F,cs,S,Cs="In attendance at the gala are the who’s who of AI builders. Alfred wants to impress them by discussing their most popular models, datasets, and spaces. We’ll create a tool to fetch model statistics from the Hugging Face Hub based on a username.",js,R,is,x,$s="With the Hub Stats Tool, Alfred can now impress influential AI builders by discussing their most popular models.",rs,z,Js,H,ks="Now that we have all the tools, let’s integrate them into Alfred’s agent:",hs,A,ws,q,ys,D,Ws="By integrating these tools, Alfred is now equipped to handle a variety of tasks, from web searches to weather updates and model statistics. This ensures he remains the most informed and engaging host at the gala.",ms,E,Rs="<p>Try implementing a tool that can be used to get the latest news about a specific topic.</p> <p>When you’re done, implement your custom tools in the <code>tools.py</code> file.</p>",ds,K,us,P,Ts;return o=new xs({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),l=new L({props:{title:"Building and Integrating Tools for Your Agent",local:"building-and-integrating-tools-for-your-agent",headingTag:"h1"}}),v=new L({props:{title:"Give Your Agent Access to the Web",local:"give-your-agent-access-to-the-web",headingTag:"h2"}}),$=new bs({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[Ks]},$$scope:{ctx:U}}}),Y=new L({props:{title:"Creating a Custom Tool for Weather Information to Schedule the Fireworks",local:"creating-a-custom-tool-for-weather-information-to-schedule-the-fireworks",headingTag:"h2"}}),W=new bs({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[sl]},$$scope:{ctx:U}}}),F=new L({props:{title:"Creating a Hub Stats Tool for Influential AI Builders",local:"creating-a-hub-stats-tool-for-influential-ai-builders",headingTag:"h2"}}),R=new bs({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[nl]},$$scope:{ctx:U}}}),z=new L({props:{title:"Integrating Tools with Alfred",local:"integrating-tools-with-alfred",headingTag:"h2"}}),A=new bs({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[pl]},$$scope:{ctx:U}}}),q=new L({props:{title:"Conclusion",local:"conclusion",headingTag:"h2"}}),K=new zs({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit3/agentic-rag/tools.mdx"}}),{c(){n=b("meta"),M=J(),t=b("p"),r=J(),w(o.$$.fragment),e=J(),w(l.$$.fragment),s=J(),j=b("p"),j.textContent=Z,G=J(),w(v.$$.fragment),O=J(),X=b("p"),X.textContent=Is,ss=J(),N=b("p"),N.textContent=fs,ls=J(),V=b("p"),V.textContent=Bs,as=J(),w($.$$.fragment),ts=J(),w(Y.$$.fragment),ns=J(),Q=b("p"),Q.textContent=Gs,es=J(),_=b("p"),_.textContent=Zs,os=J(),k=b("blockquote"),k.innerHTML=gs,Ms=J(),w(W.$$.fragment),ps=J(),w(F.$$.fragment),cs=J(),S=b("p"),S.textContent=Cs,js=J(),w(R.$$.fragment),is=J(),x=b("p"),x.textContent=$s,rs=J(),w(z.$$.fragment),Js=J(),H=b("p"),H.textContent=ks,hs=J(),w(A.$$.fragment),ws=J(),w(q.$$.fragment),ys=J(),D=b("p"),D.textContent=Ws,ms=J(),E=b("blockquote"),E.innerHTML=Rs,ds=J(),w(K.$$.fragment),us=J(),P=b("p"),this.h()},l(a){const i=Fs("svelte-u9bgzb",document.head);n=I(i,"META",{name:!0,content:!0}),i.forEach(p),M=h(a),t=I(a,"P",{}),Ns(t).forEach(p),r=h(a),y(o.$$.fragment,a),e=h(a),y(l.$$.fragment,a),s=h(a),j=I(a,"P",{"data-svelte-h":!0}),f(j)!=="svelte-1321hri"&&(j.textContent=Z),G=h(a),y(v.$$.fragment,a),O=h(a),X=I(a,"P",{"data-svelte-h":!0}),f(X)!=="svelte-15rhug1"&&(X.textContent=Is),ss=h(a),N=I(a,"P",{"data-svelte-h":!0}),f(N)!=="svelte-451rqo"&&(N.textContent=fs),ls=h(a),V=I(a,"P",{"data-svelte-h":!0}),f(V)!=="svelte-hoxfy6"&&(V.textContent=Bs),as=h(a),y($.$$.fragment,a),ts=h(a),y(Y.$$.fragment,a),ns=h(a),Q=I(a,"P",{"data-svelte-h":!0}),f(Q)!=="svelte-1832d8g"&&(Q.textContent=Gs),es=h(a),_=I(a,"P",{"data-svelte-h":!0}),f(_)!=="svelte-1vieuj"&&(_.textContent=Zs),os=h(a),k=I(a,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),f(k)!=="svelte-1fclgog"&&(k.innerHTML=gs),Ms=h(a),y(W.$$.fragment,a),ps=h(a),y(F.$$.fragment,a),cs=h(a),S=I(a,"P",{"data-svelte-h":!0}),f(S)!=="svelte-1crb2we"&&(S.textContent=Cs),js=h(a),y(R.$$.fragment,a),is=h(a),x=I(a,"P",{"data-svelte-h":!0}),f(x)!=="svelte-1k2iwrw"&&(x.textContent=$s),rs=h(a),y(z.$$.fragment,a),Js=h(a),H=I(a,"P",{"data-svelte-h":!0}),f(H)!=="svelte-qd7lv7"&&(H.textContent=ks),hs=h(a),y(A.$$.fragment,a),ws=h(a),y(q.$$.fragment,a),ys=h(a),D=I(a,"P",{"data-svelte-h":!0}),f(D)!=="svelte-1wo13by"&&(D.textContent=Ws),ms=h(a),E=I(a,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),f(E)!=="svelte-l3i7pz"&&(E.innerHTML=Rs),ds=h(a),y(K.$$.fragment,a),us=h(a),P=I(a,"P",{}),Ns(P).forEach(p),this.h()},h(){Us(n,"name","hf:doc:metadata"),Us(n,"content",jl),Us(k,"class","tip"),Us(E,"class","tip")},m(a,i){Ss(document.head,n),c(a,M,i),c(a,t,i),c(a,r,i),m(o,a,i),c(a,e,i),m(l,a,i),c(a,s,i),c(a,j,i),c(a,G,i),m(v,a,i),c(a,O,i),c(a,X,i),c(a,ss,i),c(a,N,i),c(a,ls,i),c(a,V,i),c(a,as,i),m($,a,i),c(a,ts,i),m(Y,a,i),c(a,ns,i),c(a,Q,i),c(a,es,i),c(a,_,i),c(a,os,i),c(a,k,i),c(a,Ms,i),m(W,a,i),c(a,ps,i),m(F,a,i),c(a,cs,i),c(a,S,i),c(a,js,i),m(R,a,i),c(a,is,i),c(a,x,i),c(a,rs,i),m(z,a,i),c(a,Js,i),c(a,H,i),c(a,hs,i),m(A,a,i),c(a,ws,i),m(q,a,i),c(a,ys,i),c(a,D,i),c(a,ms,i),c(a,E,i),c(a,ds,i),m(K,a,i),c(a,us,i),c(a,P,i),Ts=!0},p(a,[i]){const As={};i&2&&(As.$$scope={dirty:i,ctx:a}),$.$set(As);const Es={};i&2&&(Es.$$scope={dirty:i,ctx:a}),W.$set(Es);const vs={};i&2&&(vs.$$scope={dirty:i,ctx:a}),R.$set(vs);const Xs={};i&2&&(Xs.$$scope={dirty:i,ctx:a}),A.$set(Xs)},i(a){Ts||(d(o.$$.fragment,a),d(l.$$.fragment,a),d(v.$$.fragment,a),d($.$$.fragment,a),d(Y.$$.fragment,a),d(W.$$.fragment,a),d(F.$$.fragment,a),d(R.$$.fragment,a),d(z.$$.fragment,a),d(A.$$.fragment,a),d(q.$$.fragment,a),d(K.$$.fragment,a),Ts=!0)},o(a){u(o.$$.fragment,a),u(l.$$.fragment,a),u(v.$$.fragment,a),u($.$$.fragment,a),u(Y.$$.fragment,a),u(W.$$.fragment,a),u(F.$$.fragment,a),u(R.$$.fragment,a),u(z.$$.fragment,a),u(A.$$.fragment,a),u(q.$$.fragment,a),u(K.$$.fragment,a),Ts=!1},d(a){a&&(p(M),p(t),p(r),p(e),p(s),p(j),p(G),p(O),p(X),p(ss),p(N),p(ls),p(V),p(as),p(ts),p(ns),p(Q),p(es),p(_),p(os),p(k),p(Ms),p(ps),p(cs),p(S),p(js),p(is),p(x),p(rs),p(Js),p(H),p(hs),p(ws),p(ys),p(D),p(ms),p(E),p(ds),p(us),p(P)),p(n),T(o,a),T(l,a),T(v,a),T($,a),T(Y,a),T(W,a),T(F,a),T(R,a),T(z,a),T(A,a),T(q,a),T(K,a)}}}const jl='{"title":"Building and Integrating Tools for Your Agent","local":"building-and-integrating-tools-for-your-agent","sections":[{"title":"Give Your Agent Access to the Web","local":"give-your-agent-access-to-the-web","sections":[],"depth":2},{"title":"Creating a Custom Tool for Weather Information to Schedule the Fireworks","local":"creating-a-custom-tool-for-weather-information-to-schedule-the-fireworks","sections":[],"depth":2},{"title":"Creating a Hub Stats Tool for Influential AI Builders","local":"creating-a-hub-stats-tool-for-influential-ai-builders","sections":[],"depth":2},{"title":"Integrating Tools with Alfred","local":"integrating-tools-with-alfred","sections":[],"depth":2},{"title":"Conclusion","local":"conclusion","sections":[],"depth":2}],"depth":1}';function il(U){return Ys(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ul extends Qs{constructor(n){super(),_s(this,n,il,cl,Vs,{})}}export{ul as component};
