import{s as vl,o as Yl,n as C}from"../chunks/scheduler.37c15a92.js";import{S as xl,i as Sl,g as b,s as j,r as y,A as Nl,h as I,f as p,c as J,j as Xl,u as U,x as f,k as Tl,y as _l,a as c,v as d,d as w,t as m,w as T,m as hl,n as bl}from"../chunks/index.2bf4358c.js";import{T as Rl}from"../chunks/Tip.363c041f.js";import{C as B}from"../chunks/CodeBlock.4e987730.js";import{H as O}from"../chunks/Heading.8ada512a.js";import{H as ml,a as g}from"../chunks/HfOption.02c8e375.js";import{E as Fl}from"../chunks/getInferenceSnippets.d4d07d1e.js";function ql(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoVG9vbCUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUyMGRlJTIwcmVjaGVyY2hlJTIwRHVja0R1Y2tHbyUwQXNlYXJjaF90b29sJTIwJTNEJTIwRHVja0R1Y2tHb1NlYXJjaFRvb2woKSUwQSUwQSUyMyUyMEV4ZW1wbGUlMjBkJ3VzYWdlJTBBcmVzdWx0cyUyMCUzRCUyMHNlYXJjaF90b29sKCUyMlF1aSUyMGVzdCUyMGwnYWN0dWVsJTIwUHIlQzMlQTlzaWRlbnQlMjBkZSUyMGxhJTIwRnJhbmNlJTIwJTNGJTIyKSUwQXByaW50KHJlc3VsdHMp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> DuckDuckGoSearchTool

<span class="hljs-comment"># Initialiser l&#x27;outil de recherche DuckDuckGo</span>
search_tool = DuckDuckGoSearchTool()

<span class="hljs-comment"># Exemple d&#x27;usage</span>
results = search_tool(<span class="hljs-string">&quot;Qui est l&#x27;actuel Président de la France ?&quot;</span>)
<span class="hljs-built_in">print</span>(results)`,wrap:!1}}),o=new B({props:{code:"TCdhY3R1ZWwlMjBQciVDMyVBOXNpZGVudCUyMGRlJTIwbGElMjBGcmFuY2UlMjBlc3QlMjBFbW1hbnVlbCUyME1hY3Jvbi4=",highlighted:'<span class="hljs-keyword">L</span>&#x27;actuel <span class="hljs-keyword">Pr</span>ésident <span class="hljs-keyword">de</span> <span class="hljs-keyword">la</span> France <span class="hljs-keyword">est</span> Emmanuel Macron.',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function Hl(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLmR1Y2tkdWNrZ28lMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoVG9vbFNwZWMlMEFmcm9tJTIwbGxhbWFfaW5kZXguY29yZS50b29scyUyMGltcG9ydCUyMEZ1bmN0aW9uVG9vbCUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUyMGRlJTIwcmVjaGVyY2hlJTIwRHVja0R1Y2tHbyUwQXRvb2xfc3BlYyUyMCUzRCUyMER1Y2tEdWNrR29TZWFyY2hUb29sU3BlYygpJTBBJTBBc2VhcmNoX3Rvb2wlMjAlM0QlMjBGdW5jdGlvblRvb2wuZnJvbV9kZWZhdWx0cyh0b29sX3NwZWMuZHVja2R1Y2tnb19mdWxsX3NlYXJjaCklMEElMjMlMjBFeGVtcGxlJTIwZCd1c2FnZSUwQXJlc3BvbnNlJTIwJTNEJTIwc2VhcmNoX3Rvb2woJTIyUXVpJTIwZXN0JTIwbCdhY3R1ZWwlMjBQciVDMyVBOXNpZGVudCUyMGRlJTIwbGElMjBGcmFuY2UlMjAlM0YlMjIpJTBBcHJpbnQocmVzcG9uc2UucmF3X291dHB1dCU1Qi0xJTVEJTVCJ2JvZHknJTVEKQ==",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"># Initialiser l&#x27;outil de recherche DuckDuckGo</span>
tool_spec = DuckDuckGoSearchToolSpec()

search_tool = FunctionTool.from_defaults(tool_spec.duckduckgo_full_search)
<span class="hljs-comment"># Exemple d&#x27;usage</span>
response = search_tool(<span class="hljs-string">&quot;Qui est l&#x27;actuel Président de la 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}}),o=new B({props:{code:"TGUlMjBQciVDMyVBOXNpZGVudCUyMGRlJTIwbGElMjBSJUMzJUE5cHVibGlxdWUlMjBmcmFuJUMzJUE3YWlzZSUyMGVzdCUyMGxlJTIwY2hlZiUyMGQnJUMzJTg5dGF0JTIwZGUlMjBsYSUyMEZyYW5jZS4lMjBMJ2FjdHVlbCUyMFByJUMzJUE5c2lkZW50JTIwZXN0JTIwRW1tYW51ZWwlMjBNYWNyb24lMjBkZXB1aXMlMjBsZSUyMDE0JTIwbWFpJTIwMjAxNyUyMGFwciVDMyVBOHMlMjBhdm9pciUyMGJhdHR1JTIwTWFyaW5lJTIwTGUlMjBQZW4lMjBhdSUyMHNlY29uZCUyMHRvdXIlMjBkZSUyMGwnJUMzJUE5bGVjdGlvbiUyMHByJUMzJUE5c2lkZW50aWVsbGUlMjBsZSUyMDclMjBtYWklMjAyMDE3LiUyMExpc3RlJTIwZGVzJTIwcHIlQzMlQTlzaWRlbnRzJTIwZnJhbiVDMyVBN2FpcyUyMChDaW5xdWklQzMlQThtZSUyMFIlQzMlQTlwdWJsaXF1ZSklMjBOJUMyJUIwJTIwUG9ydHJhaXQlMjBOb20lMjAuLi4=",highlighted:'Le <span class="hljs-keyword">Pr</span>ésident <span class="hljs-keyword">de</span> <span class="hljs-keyword">la</span> République française <span class="hljs-keyword">est</span> le chef <span class="hljs-keyword">d</span>&#x27;État <span class="hljs-keyword">de</span> <span class="hljs-keyword">la</span> France. <span class="hljs-keyword">L</span>&#x27;actuel <span class="hljs-keyword">Pr</span>ésident <span class="hljs-keyword">est</span> Emmanuel Macron depuis le 14 mai 2017 après avoir battu Marine Le Pen au second tour <span class="hljs-keyword">de</span> <span class="hljs-keyword">l</span>&#x27;élection <span class="hljs-keyword">pr</span>ésidentielle le 7 mai 2017. Liste <span class="hljs-keyword">des</span> <span class="hljs-keyword">pr</span>ésidents français (Cinquième République) <span class="hljs-keyword">N</span>° Portrait Nom ...',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function Dl(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkudG9vbHMlMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoUnVuJTBBJTBBc2VhcmNoX3Rvb2wlMjAlM0QlMjBEdWNrRHVja0dvU2VhcmNoUnVuKCklMEFyZXN1bHRzJTIwJTNEJTIwc2VhcmNoX3Rvb2wuaW52b2tlKCUyMlF1aSUyMGVzdCUyMGwnYWN0dWVsJTIwUHIlQzMlQTlzaWRlbnQlMjBkZSUyMGxhJTIwRnJhbmNlJTIwJTNGJTIyKSUwQXByaW50KHJlc3VsdHMp",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;Qui est l&#x27;actuel Président de la France ?&quot;</span>)
<span class="hljs-built_in">print</span>(results)`,wrap:!1}}),o=new B({props:{code:"RW1tYW51ZWwlMjBNYWNyb24lMjAobiVDMyVBOSUyMGxlJTIwMjElMjBkJUMzJUE5Y2VtYnJlJTIwMTk3NyUyMCVDMyVBMCUyMEFtaWVucyUyQyUyMEZyYW5jZSklMjBlc3QlMjB1biUyMGJhbnF1aWVyJTIwZXQlMjBob21tZSUyMHBvbGl0aXF1ZSUyMGZyYW4lQzMlQTdhaXMlMjBxdWklMjBhJTIwJUMzJUE5dCVDMyVBOSUyMCVDMyVBOWx1JTIwcHIlQzMlQTlzaWRlbnQlMjBkZSUyMGxhJTIwRnJhbmNlJTIwZW4lMjAyMDE3Li4u",highlighted:'Emmanuel Macron (<span class="hljs-keyword">n</span>é le 21 <span class="hljs-keyword">d</span>écembre 1977 à Amiens, France) <span class="hljs-keyword">est</span> un banquier et homme politique français <span class="hljs-keyword">qui</span> a été élu <span class="hljs-keyword">pr</span>ésident <span class="hljs-keyword">de</span> <span class="hljs-keyword">la</span> France <span class="hljs-keyword">en</span> 2017...',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function Ol(h){let e,t,n,r,M,o;return e=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ql]},$$scope:{ctx:h}}}),n=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Hl]},$$scope:{ctx:h}}}),M=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Dl]},$$scope:{ctx:h}}}),{c(){y(e.$$.fragment),t=j(),y(n.$$.fragment),r=j(),y(M.$$.fragment)},l(s){U(e.$$.fragment,s),t=J(s),U(n.$$.fragment,s),r=J(s),U(M.$$.fragment,s)},m(s,l){d(e,s,l),c(s,t,l),d(n,s,l),c(s,r,l),d(M,s,l),o=!0},p(s,l){const i={};l&2&&(i.$$scope={dirty:l,ctx:s}),e.$set(i);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),n.$set(G);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),M.$set(Z)},i(s){o||(w(e.$$.fragment,s),w(n.$$.fragment,s),w(M.$$.fragment,s),o=!0)},o(s){m(e.$$.fragment,s),m(n.$$.fragment,s),m(M.$$.fragment,s),o=!1},d(s){s&&(p(t),p(r)),T(e,s),T(n,s),T(M,s)}}}function Ll(h){let e,t,n="l'Unité 1",r;return{c(){e=hl("Par souci de simplicité, nous utilisons une API météorologique factice pour cet exemple. Si vous voulez utiliser une vraie API météorologique, vous pourriez implémenter un outil météorologique qui utilise l'*API OpenWeatherMap*, comme dans "),t=b("a"),t.textContent=n,r=hl("."),this.h()},l(M){e=bl(M,"Par souci de simplicité, nous utilisons une API météorologique factice pour cet exemple. Si vous voulez utiliser une vraie API météorologique, vous pourriez implémenter un outil météorologique qui utilise l'*API OpenWeatherMap*, comme dans "),t=I(M,"A",{href:!0,"data-svelte-h":!0}),f(t)!=="svelte-17x00k5"&&(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cmV0dXJuJTIwZiUyMk0lQzMlQTl0JUMzJUE5byUyMCVDMyVBMCUyMCU3QmxvY2F0aW9uJTdEJTNBJTIwJTdCZGF0YSU1Qidjb25kaXRpb24nJTVEJTdEJTJDJTIwJTdCZGF0YSU1Qid0ZW1wX2MnJTVEJTdEJUMyJUIwQyUyMiUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUwQXdlYXRoZXJfaW5mb190b29sJTIwJTNEJTIwV2VhdGhlckluZm9Ub29sKCk=",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;Récupère des informations météorologiques factices pour un lieu donné.&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;Le lieu pour lequel obtenir les informations météorologiques.&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"># Données météorologiques factices</span>
        weather_conditions = [
            {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Pluvieux&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;Clair&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;Venteux&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
        ]
        <span class="hljs-comment"># Sélectionner aléatoirement une condition météorologique</span>
        data = random.choice(weather_conditions)
        <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Météo à <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"># Initialiser l&#x27;outil</span>
weather_info_tool = WeatherInfoTool()`,wrap:!1}}),{c(){y(e.$$.fragment)},l(n){U(e.$$.fragment,n)},m(n,r){d(e,n,r),t=!0},p:C,i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){m(e.$$.fragment,n),t=!1},d(n){T(e,n)}}}function Kl(h){let e,t;return e=new B({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEElMEFkZWYlMjBnZXRfd2VhdGhlcl9pbmZvKGxvY2F0aW9uJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJSJUMzJUE5Y3VwJUMzJUE4cmUlMjBkZXMlMjBpbmZvcm1hdGlvbnMlMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ2lxdWVzJTIwZmFjdGljZXMlMjBwb3VyJTIwdW4lMjBsaWV1JTIwZG9ubiVDMyVBOS4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjAlMjMlMjBEb25uJUMzJUE5ZXMlMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ2lxdWVzJTIwZmFjdGljZXMlMEElMjAlMjAlMjAlMjB3ZWF0aGVyX2NvbmRpdGlvbnMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJjb25kaXRpb24lMjIlM0ElMjAlMjJQbHV2aWV1eCUyMiUyQyUyMCUyMnRlbXBfYyUyMiUzQSUyMDE1JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIyY29uZGl0aW9uJTIyJTNBJTIwJTIyQ2xhaXIlMjIlMkMlMjAlMjJ0ZW1wX2MlMjIlM0ElMjAyNSU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMmNvbmRpdGlvbiUyMiUzQSUyMCUyMlZlbnRldXglMjIlMkMlMjAlMjJ0ZW1wX2MlMjIlM0ElMjAyMCU3RCUwQSUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCUyMyUyMFMlQzMlQTlsZWN0aW9ubmVyJTIwYWwlQzMlQTlhdG9pcmVtZW50JTIwdW5lJTIwY29uZGl0aW9uJTIwbSVDMyVBOXQlQzMlQTlvcm9sb2dpcXVlJTBBJTIwJTIwJTIwJTIwZGF0YSUyMCUzRCUyMHJhbmRvbS5jaG9pY2Uod2VhdGhlcl9jb25kaXRpb25zKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJNJUMzJUE5dCVDMyVBOW8lMjAlQzMlQTAlMjAlN0Jsb2NhdGlvbiU3RCUzQSUyMCU3QmRhdGElNUInY29uZGl0aW9uJyU1RCU3RCUyQyUyMCU3QmRhdGElNUIndGVtcF9jJyU1RCU3RCVDMiVCMEMlMjIlMEElMEElMjMlMjBJbml0aWFsaXNlciUyMGwnb3V0aWwlMEF3ZWF0aGVyX2luZm9fdG9vbCUyMCUzRCUyMEZ1bmN0aW9uVG9vbC5mcm9tX2RlZmF1bHRzKGdldF93ZWF0aGVyX2luZm8p",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;Récupère des informations météorologiques factices pour un lieu donné.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Données météorologiques factices</span>
    weather_conditions = [
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Pluvieux&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;Clair&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;Venteux&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
    ]
    <span class="hljs-comment"># Sélectionner aléatoirement une condition météorologique</span>
    data = random.choice(weather_conditions)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Météo à <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"># Initialiser l&#x27;outil</span>
weather_info_tool = FunctionTool.from_defaults(get_weather_info)`,wrap:!1}}),{c(){y(e.$$.fragment)},l(n){U(e.$$.fragment,n)},m(n,r){d(e,n,r),t=!0},p:C,i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){m(e.$$.fragment,n),t=!1},d(n){T(e,n)}}}function ls(h){let e,t;return e=new B({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi50b29scyUyMGltcG9ydCUyMFRvb2wlMEFpbXBvcnQlMjByYW5kb20lMEElMEFkZWYlMjBnZXRfd2VhdGhlcl9pbmZvKGxvY2F0aW9uJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJSJUMzJUE5Y3VwJUMzJUE4cmUlMj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aW9uJyU1RCU3RCUyQyUyMCU3QmRhdGElNUIndGVtcF9jJyU1RCU3RCVDMiVCMEMlMjIlMEElMEElMjMlMjBJbml0aWFsaXNlciUyMGwnb3V0aWwlMEF3ZWF0aGVyX2luZm9fdG9vbCUyMCUzRCUyMFRvb2woJTBBJTIwJTIwJTIwJTIwbmFtZSUzRCUyMmdldF93ZWF0aGVyX2luZm8lMjIlMkMlMEElMjAlMjAlMjAlMjBmdW5jJTNEZ2V0X3dlYXRoZXJfaW5mbyUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEJTIyUiVDMyVBOWN1cCVDMyVBOHJlJTIwZGVzJTIwaW5mb3JtYXRpb25zJTIwbSVDMyVBOXQlQzMlQTlvcm9sb2dpcXVlcyUyMGZhY3RpY2VzJTIwcG91ciUyMHVuJTIwbGlldSUyMGRvbm4lQzMlQTkuJTIyJTBBKQ==",highlighted:`<span class="hljs-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;Récupère des informations météorologiques factices pour un lieu donné.&quot;&quot;&quot;</span>
    <span class="hljs-comment"># Données météorologiques factices</span>
    weather_conditions = [
        {<span class="hljs-string">&quot;condition&quot;</span>: <span class="hljs-string">&quot;Pluvieux&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;Clair&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;Venteux&quot;</span>, <span class="hljs-string">&quot;temp_c&quot;</span>: <span class="hljs-number">20</span>}
    ]
    <span class="hljs-comment"># Sélectionner aléatoirement une condition météorologique</span>
    data = random.choice(weather_conditions)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Météo à <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"># Initialiser l&#x27;outil</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;Récupère des informations météorologiques factices pour un lieu donné.&quot;</span>
)`,wrap:!1}}),{c(){y(e.$$.fragment)},l(n){U(e.$$.fragment,n)},m(n,r){d(e,n,r),t=!0},p:C,i(n){t||(w(e.$$.fragment,n),t=!0)},o(n){m(e.$$.fragment,n),t=!1},d(n){T(e,n)}}}function ss(h){let e,t,n,r,M,o;return e=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[Pl]},$$scope:{ctx:h}}}),n=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Kl]},$$scope:{ctx:h}}}),M=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[ls]},$$scope:{ctx:h}}}),{c(){y(e.$$.fragment),t=j(),y(n.$$.fragment),r=j(),y(M.$$.fragment)},l(s){U(e.$$.fragment,s),t=J(s),U(n.$$.fragment,s),r=J(s),U(M.$$.fragment,s)},m(s,l){d(e,s,l),c(s,t,l),d(n,s,l),c(s,r,l),d(M,s,l),o=!0},p(s,l){const i={};l&2&&(i.$$scope={dirty:l,ctx:s}),e.$set(i);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),n.$set(G);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),M.$set(Z)},i(s){o||(w(e.$$.fragment,s),w(n.$$.fragment,s),w(M.$$.fragment,s),o=!0)},o(s){m(e.$$.fragment,s),m(n.$$.fragment,s),m(M.$$.fragment,s),o=!1},d(s){s&&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CbW9kZWwuaWQlN0QlMjBhdmVjJTIwJTdCbW9kZWwuZG93bmxvYWRzJTNBJTJDJTdEJTIwdCVDMyVBOWwlQzMlQTljaGFyZ2VtZW50cy4lMjIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbHNlJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwZiUyMkF1Y3VuJTIwbW9kJUMzJUE4bGUlMjB0cm91diVDMyVBOSUyMHBvdXIlMjBsJ2F1dGV1ciUyMCU3QmF1dGhvciU3RC4lMjIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBleGNlcHQlMjBFeGNlcHRpb24lMjBhcyUyMGUlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyRXJyZXVyJTIwbG9ycyUyMGRlJTIwbGElMjByJUMzJUE5Y3VwJUMzJUE5cmF0aW9uJTIwZGVzJTIwbW9kJUMzJUE4bGVzJTIwcG91ciUyMCU3QmF1dGhvciU3RCUzQSUyMCU3QnN0cihlKSU3RCUyMiUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUwQWh1Yl9zdGF0c190b29sJTIwJTNEJTIwSHViU3RhdHNUb29sKCklMEElMEElMjMlMjBFeGVtcGxlJTIwZCd1c2FnZSUwQXByaW50KGh1Yl9zdGF0c190b29sKCUyMmZhY2Vib29rJTIyKSklMjAlMjMlMjBFeGVtcGxlJTIwJTNBJTIwT2J0ZW5pciUyMGxlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2s=",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;Récupère le modèle le plus téléchargé d&#x27;un auteur spécifique sur le 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;Le nom d&#x27;utilisateur de l&#x27;auteur/organisation du modèle pour trouver des modèles.&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"># Lister les modèles de l&#x27;auteur spécifié, triés par téléchargements</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;Le modèle le plus téléchargé par <span class="hljs-subst">{author}</span> est <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> avec <span class="hljs-subst">{model.downloads:,}</span> téléchargements.&quot;</span>
            <span class="hljs-keyword">else</span>:
                <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Aucun modèle trouvé pour l&#x27;auteur <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;Erreur lors de la récupération des modèles pour <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"># Initialiser l&#x27;outil</span>
hub_stats_tool = HubStatsTool()

<span class="hljs-comment"># Exemple d&#x27;usage</span>
<span class="hljs-built_in">print</span>(hub_stats_tool(<span class="hljs-string">&quot;facebook&quot;</span>)) <span class="hljs-comment"># Exemple : Obtenir le modèle le plus téléchargé par Facebook</span>`,wrap:!1}}),o=new B({props:{code:"TGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBwYXIlMjBmYWNlYm9vayUyMGVzdCUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMGF2ZWMlMjAxMiUyQzU0NCUyQzU1MCUyMHQlQzMlQTlsJUMzJUE5Y2hhcmdlbWVudHMu",highlighted:'<span class="hljs-keyword">Le</span> <span class="hljs-built_in">mod</span>è<span class="hljs-keyword">le</span> <span class="hljs-keyword">le</span> plus téléchargé par facebook est facebook/esmfold_v1 avec <span class="hljs-number">12</span>,<span class="hljs-number">544</span>,<span class="hljs-number">550</span> téléchargements.',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function as(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEFmcm9tJT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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;Récupère le modèle le plus téléchargé d&#x27;un auteur spécifique sur le Hugging Face Hub.&quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># Lister les modèles de l&#x27;auteur spécifié, triés par téléchargements</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;Le modèle le plus téléchargé par <span class="hljs-subst">{author}</span> est <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> avec <span class="hljs-subst">{model.downloads:,}</span> téléchargements.&quot;</span>
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Aucun modèle trouvé pour l&#x27;auteur <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;Erreur lors de la récupération des modèles pour <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"># Initialiser l&#x27;outil</span>
hub_stats_tool = FunctionTool.from_defaults(get_hub_stats)

<span class="hljs-comment"># Exemple d&#x27;usage</span>
<span class="hljs-built_in">print</span>(hub_stats_tool(<span class="hljs-string">&quot;facebook&quot;</span>)) <span class="hljs-comment"># Exemple : Obtenir le modèle le plus téléchargé par Facebook</span>`,wrap:!1}}),o=new B({props:{code:"TGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBwYXIlMjBmYWNlYm9vayUyMGVzdCUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMGF2ZWMlMjAxMiUyQzU0NCUyQzU1MCUyMHQlQzMlQTlsJUMzJUE5Y2hhcmdlbWVudHMu",highlighted:'<span class="hljs-keyword">Le</span> <span class="hljs-built_in">mod</span>è<span class="hljs-keyword">le</span> <span class="hljs-keyword">le</span> plus téléchargé par facebook est facebook/esmfold_v1 avec <span class="hljs-number">12</span>,<span class="hljs-number">544</span>,<span class="hljs-number">550</span> téléchargements.',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function ns(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi50b29scyUyMGltcG9ydCUyMFRvb2wlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwbGlzdF9tb2RlbHMlMEElMEFkZWYlMjBnZXRfaHViX3N0YXRzKGF1dGhvciUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyUiVDMyVBOWN1cCVDMyVBOHJlJTIwbGUlMjBtb2QlQzMlQThsZ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W9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2s=",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;Récupère le modèle le plus téléchargé d&#x27;un auteur spécifique sur le Hugging Face Hub.&quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-comment"># Lister les modèles de l&#x27;auteur spécifié, triés par téléchargements</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;Le modèle le plus téléchargé par <span class="hljs-subst">{author}</span> est <span class="hljs-subst">{model.<span class="hljs-built_in">id</span>}</span> avec <span class="hljs-subst">{model.downloads:,}</span> téléchargements.&quot;</span>
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;Aucun modèle trouvé pour l&#x27;auteur <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;Erreur lors de la récupération des modèles pour <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"># Initialiser l&#x27;outil</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;Récupère le modèle le plus téléchargé d&#x27;un auteur spécifique sur le Hugging Face Hub.&quot;</span>
)

<span class="hljs-comment"># Exemple d&#x27;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"># Exemple : Obtenir le modèle le plus téléchargé par Facebook</span>`,wrap:!1}}),o=new B({props:{code:"TGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBwYXIlMjBmYWNlYm9vayUyMGVzdCUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMGF2ZWMlMjAxMyUyQzEwOSUyQzg2MSUyMHQlQzMlQTlsJUMzJUE5Y2hhcmdlbWVudHMu",highlighted:'<span class="hljs-keyword">Le</span> <span class="hljs-built_in">mod</span>è<span class="hljs-keyword">le</span> <span class="hljs-keyword">le</span> plus téléchargé par facebook est facebook/esmfold_v1 avec <span class="hljs-number">13</span>,<span class="hljs-number">109</span>,<span class="hljs-number">861</span> téléchargements.',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function ts(h){let e,t,n,r,M,o;return e=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[es]},$$scope:{ctx:h}}}),n=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[as]},$$scope:{ctx:h}}}),M=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[ns]},$$scope:{ctx:h}}}),{c(){y(e.$$.fragment),t=j(),y(n.$$.fragment),r=j(),y(M.$$.fragment)},l(s){U(e.$$.fragment,s),t=J(s),U(n.$$.fragment,s),r=J(s),U(M.$$.fragment,s)},m(s,l){d(e,s,l),c(s,t,l),d(n,s,l),c(s,r,l),d(M,s,l),o=!0},p(s,l){const i={};l&2&&(i.$$scope={dirty:l,ctx:s}),e.$set(i);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),n.$set(G);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),M.$set(Z)},i(s){o||(w(e.$$.fragment,s),w(n.$$.fragment,s),w(M.$$.fragment,s),o=!0)},o(s){m(e.$$.fragment,s),m(n.$$.fragment,s),m(M.$$.fragment,s),o=!1},d(s){s&&(p(t),p(r)),T(e,s),T(n,s),T(M,s)}}}function Ms(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbGUlMjBtb2QlQzMlQThsZSUyMEh1Z2dpbmclMjBGYWNlJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBJTBBJTIzJTIwQ3IlQzMlQTllciUyMEFsZnJlZCUyMGF2ZWMlMjB0b3VzJTIwbGVzJTIwb3V0aWxzJTBBYWxmcmVkJTIwJTNEJTIwQ29kZUFnZW50KCUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEJTVCc2VhcmNoX3Rvb2wlMkMlMjB3ZWF0aGVyX2luZm9fdG9vbCUyQyUyMGh1Yl9zdGF0c190b29sJTVEJTJDJTIwJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUwQSklMEElMEElMjMlMjBFeGVtcGxlJTIwZGUlMjByZXF1JUMzJUFBdGUlMjBxdSdBbGZyZWQlMjBwb3VycmFpdCUyMHJlY2V2b2lyJTIwcGVuZGFudCUyMGxlJTIwZ2FsYSUwQXJlc3BvbnNlJTIwJTNEJTIwYWxmcmVkLnJ1biglMjJRdSdlc3QtY2UlMjBxdWUlMjBGYWNlYm9vayUyMGV0JTIwcXVlbCUyMGVzdCUyMGxldXIlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHBvcHVsYWlyZSUyMCUzRiUyMiklMEElMEFwcmludCglMjIlRjAlOUYlOEUlQTklMjBSJUMzJUE5cG9uc2UlMjBkJ0FsZnJlZCUyMCUzQSUyMiklMEFwcmludChyZXNwb25zZSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

<span class="hljs-comment"># Initialiser le modèle Hugging Face</span>
model = InferenceClientModel()

<span class="hljs-comment"># Créer Alfred avec tous les outils</span>
alfred = CodeAgent(
    tools=[search_tool, weather_info_tool, hub_stats_tool], 
    model=model
)

<span class="hljs-comment"># Exemple de requête qu&#x27;Alfred pourrait recevoir pendant le gala</span>
response = alfred.run(<span class="hljs-string">&quot;Qu&#x27;est-ce que Facebook et quel est leur modèle le plus populaire ?&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Réponse d&#x27;Alfred :&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),o=new B({props:{code:"JUYwJTlGJThFJUE5JTIwUiVDMyVBOXBvbnNlJTIwZCdBbGZyZWQlMjAlM0ElMEFGYWNlYm9vayUyMGVzdCUyMHVuJTIwc2l0ZSUyMHdlYiUyMGRlJTIwciVDMyVBOXNlYXUlMjBzb2NpYWwlMjBvJUMzJUI5JTIwbGVzJTIwdXRpbGlzYXRldXJzJTIwcGV1dmVudCUyMHNlJTIwY29ubmVjdGVyJTJDJTIwcGFydGFnZXIlMjBkZXMlMjBpbmZvcm1hdGlvbnMlMjBldCUyMGludGVyYWdpciUyMGF2ZWMlMjBkJ2F1dHJlcy4lMjBMZSUyMG1vZCVDMyVBOGxlJTIwbGUlMjBwbHVzJTIwdCVDMyVBOWwlQzMlQTljaGFyZyVDMyVBOSUyMHBhciUyMEZhY2Vib29rJTIwc3VyJTIwbGUlMjBIdWdnaW5nJTIwRmFjZSUyMEh1YiUyMGVzdCUyMEVTTUZvbGRfdjEu",highlighted:`🎩 Réponse <span class="hljs-keyword">d</span>&#x27;Alfred :
Facebook <span class="hljs-keyword">est</span> un site web <span class="hljs-keyword">de</span> réseau social où les utilisateurs peuvent <span class="hljs-keyword">se</span> connecter, partager <span class="hljs-keyword">des</span> informations et interagir avec <span class="hljs-keyword">d</span>&#x27;autres. Le modèle le plus té<span class="hljs-keyword">l</span>échargé par Facebook sur le Hugging Face Hub <span class="hljs-keyword">est</span> ESMFold_v1.`,wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function os(h){let e,t,n,r="Sortie attendue :",M,o,s;return e=new B({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUuYWdlbnQud29ya2Zsb3clMjBpbXBvcnQlMjBBZ2VudFdvcmtmbG93JTBBZnJvbSUyMGxsYW1hX2luZGV4LmxsbXMuaHVnZ2luZ2ZhY2VfYXBpJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEklMEElMEElMjMlMjBJbml0aWFsaXNlciUyMGxlJTIwbW9kJUMzJUE4bGUlMjBIdWdnaW5nJTIwRmFjZSUwQWxsbSUyMCUzRCUyMEh1Z2dpbmdGYWNlSW5mZXJlbmNlQVBJKG1vZGVsX25hbWUlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIpJTBBJTIzJTIwQ3IlQzMlQTllciUyMEFsZnJlZCUyMGF2ZWMlMjB0b3VzJTIwbGVzJTIwb3V0aWxzJTBBYWxmcmVkJTIwJTNEJTIwQWdlbnRXb3JrZmxvdy5mcm9tX3Rvb2xzX29yX2Z1bmN0aW9ucyglMEElMjAlMjAlMjAlMjAlNUJzZWFyY2hfdG9vbCUyQyUyMHdlYXRoZXJfaW5mb190b29sJTJDJTIwaHViX3N0YXRzX3Rvb2wlNUQlMkMlMEElMjAlMjAlMjAlMjBsbG0lM0RsbG0lMEEpJTBBJTBBJTIzJTIwRXhlbXBsZSUyMGRlJTIwcmVxdSVDMyVBQXRlJTIwcXUnQWxmcmVkJTIwcG91cnJhaXQlMjByZWNldm9pciUyMHBlbmRhbnQlMjBsZSUyMGdhbGElMEFyZXNwb25zZSUyMCUzRCUyMGF3YWl0JTIwYWxmcmVkLnJ1biglMjJRdSdlc3QtY2UlMjBxdWUlMjBGYWNlYm9vayUyMGV0JTIwcXVlbCUyMGVzdCUyMGxldXIlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHBvcHVsYWlyZSUyMCUzRiUyMiklMEElMEFwcmludCglMjIlRjAlOUYlOEUlQTklMjBSJUMzJUE5cG9uc2UlMjBkJ0FsZnJlZCUyMCUzQSUyMiklMEFwcmludChyZXNwb25zZSk=",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"># Initialiser le modèle Hugging Face</span>
llm = HuggingFaceInferenceAPI(model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>)
<span class="hljs-comment"># Créer Alfred avec tous les outils</span>
alfred = AgentWorkflow.from_tools_or_functions(
    [search_tool, weather_info_tool, hub_stats_tool],
    llm=llm
)

<span class="hljs-comment"># Exemple de requête qu&#x27;Alfred pourrait recevoir pendant le gala</span>
response = <span class="hljs-keyword">await</span> alfred.run(<span class="hljs-string">&quot;Qu&#x27;est-ce que Facebook et quel est leur modèle le plus populaire ?&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Réponse d&#x27;Alfred :&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),o=new B({props:{code:"JUYwJTlGJThFJUE5JTIwUiVDMyVBOXBvbnNlJTIwZCdBbGZyZWQlMjAlM0ElMEFGYWNlYm9vayUyMGVzdCUyMHVuJTIwc2VydmljZSUyMGRlJTIwciVDMyVBOXNlYXUlMjBzb2NpYWwlMjBldCUyMHVuZSUyMGVudHJlcHJpc2UlMjB0ZWNobm9sb2dpcXVlJTIwYmFzJUMzJUE5ZSUyMCVDMyVBMCUyME1lbmxvJTIwUGFyayUyQyUyMGVuJTIwQ2FsaWZvcm5pZS4lMjBFbGxlJTIwYSUyMCVDMyVBOXQlQzMlQTklMjBmb25kJUMzJUE5ZSUyMHBhciUyME1hcmslMjBadWNrZXJiZXJnJTIwZXQlMjBwZXJtZXQlMjBhdXglMjBnZW5zJTIwZGUlMjBjciVDMyVBOWVyJTIwZGVzJTIwcHJvZmlscyUyQyUyMHNlJTIwY29ubmVjdGVyJTIwYXZlYyUyMGRlcyUyMGFtaXMlMjBldCUyMGxhJTIwZmFtaWxsZSUyQyUyMHBhcnRhZ2VyJTIwZGVzJTIwcGhvdG9zJTIwZXQlMjB2aWQlQzMlQTlvcyUyQyUyMGV0JTIwcmVqb2luZHJlJTIwZGVzJTIwZ3JvdXBlcyUyMGJhcyVDMyVBOXMlMjBzdXIlMjBkZXMlMjBpbnQlQzMlQTlyJUMzJUFBdHMlMjBwYXJ0YWclQzMlQTlzLiUyMExlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjBwb3B1bGFpcmUlMjBwYXIlMjBGYWNlYm9vayUyMHN1ciUyMGxlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlMjBlc3QlMjAlNjBmYWNlYm9vayUyRmVzbWZvbGRfdjElNjAlMjBhdmVjJTIwMTMlMkMxMDklMkM4NjElMjB0JUMzJUE5bCVDMyVBOWNoYXJnZW1lbnRzLg==",highlighted:'🎩 Réponse <span class="hljs-keyword">d</span>&#x27;Alfred :\nFacebook <span class="hljs-keyword">est</span> un service <span class="hljs-keyword">de</span> réseau social et une entreprise technologique basé<span class="hljs-keyword">e</span> à Menlo Park, <span class="hljs-keyword">en</span> Californie. Elle a été fondé<span class="hljs-keyword">e</span> par <span class="hljs-keyword">Mark</span> Zuckerberg et permet aux gens <span class="hljs-keyword">de</span> créer <span class="hljs-keyword">des</span> profils, <span class="hljs-keyword">se</span> connecter avec <span class="hljs-keyword">des</span> amis et <span class="hljs-keyword">la</span> famille, partager <span class="hljs-keyword">des</span> photos et vidéos, et rejoindre <span class="hljs-keyword">des</span> groupes basés sur <span class="hljs-keyword">des</span> intérêts partagés. Le modèle le plus populaire par Facebook sur le Hugging Face Hub <span class="hljs-keyword">est</span> `facebook/esmfold_v1` avec 13,109,861 té<span class="hljs-keyword">l</span>échargements.',wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.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ZXMlMjIlM0ElMjBtZXNzYWdlcyU3RCklMEElMEFwcmludCglMjIlRjAlOUYlOEUlQTklMjBSJUMzJUE5cG9uc2UlMjBkJ0FsZnJlZCUyMCUzQSUyMiklMEFwcmludChyZXNwb25zZSU1QidtZXNzYWdlcyclNUQlNUItMSU1RC5jb250ZW50KQ==",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"># Générer l&#x27;interface de chat, incluant les outils</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"># Générer l&#x27;AgentState et le graphe d&#x27;agent</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">## Le graphe</span>
builder = StateGraph(AgentState)

<span class="hljs-comment"># Définir les nœuds : ils font le travail</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"># Définir les arêtes : elles déterminent comment le flux de contrôle se déplace</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"># Si le dernier message nécessite un outil, router vers les outils</span>
    <span class="hljs-comment"># Sinon, fournir une réponse directe</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;Qui est Facebook et quel est leur modèle le plus populaire ?&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;🎩 Réponse d&#x27;Alfred :&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}}),o=new B({props:{code:"JUYwJTlGJThFJUE5JTIwUiVDMyVBOXBvbnNlJTIwZCdBbGZyZWQlMjAlM0ElMEFGYWNlYm9vayUyMGVzdCUyMHVuZSUyMGVudHJlcHJpc2UlMjBkZSUyMG0lQzMlQTlkaWFzJTIwc29jaWF1eCUyMGNvbm51ZSUyMHBvdXIlMjBzb24lMjBzaXRlJTIwZGUlMjByJUMzJUE5c2VhdSUyMHNvY2lhbCUyQyUyMEZhY2Vib29rJTJDJTIwYWluc2klMjBxdWUlMjBkJ2F1dHJlcyUyMHNlcnZpY2VzJTIwY29tbWUlMjBJbnN0YWdyYW0lMjBldCUyMFdoYXRzQXBwLiUyMExlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2slMjBzdXIlMjBsZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViJTIwZXN0JTIwZmFjZWJvb2slMkZlc21mb2xkX3YxJTIwYXZlYyUyMDEzJTJDMjAyJTJDMzIxJTIwdCVDMyVBOWwlQzMlQTljaGFyZ2VtZW50cy4=",highlighted:`🎩 Réponse <span class="hljs-keyword">d</span>&#x27;Alfred :
Facebook <span class="hljs-keyword">est</span> une entreprise <span class="hljs-keyword">de</span> <span class="hljs-keyword">m</span>édias sociaux connue pour son site <span class="hljs-keyword">de</span> réseau social, Facebook, ainsi <span class="hljs-keyword">que</span> <span class="hljs-keyword">d</span>&#x27;autres services comme Instagram et WhatsApp. Le modèle le plus té<span class="hljs-keyword">l</span>échargé par Facebook sur le Hugging Face Hub <span class="hljs-keyword">est</span> facebook/esmfold_v1 avec 13,202,321 té<span class="hljs-keyword">l</span>échargements.`,wrap:!1}}),{c(){y(e.$$.fragment),t=j(),n=b("p"),n.textContent=r,M=j(),y(o.$$.fragment)},l(l){U(e.$$.fragment,l),t=J(l),n=I(l,"P",{"data-svelte-h":!0}),f(n)!=="svelte-cs180i"&&(n.textContent=r),M=J(l),U(o.$$.fragment,l)},m(l,i){d(e,l,i),c(l,t,i),c(l,n,i),c(l,M,i),d(o,l,i),s=!0},p:C,i(l){s||(w(e.$$.fragment,l),w(o.$$.fragment,l),s=!0)},o(l){m(e.$$.fragment,l),m(o.$$.fragment,l),s=!1},d(l){l&&(p(t),p(n),p(M)),T(e,l),T(o,l)}}}function cs(h){let e,t,n,r,M,o;return e=new g({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[Ms]},$$scope:{ctx:h}}}),n=new g({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[os]},$$scope:{ctx:h}}}),M=new g({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[ps]},$$scope:{ctx:h}}}),{c(){y(e.$$.fragment),t=j(),y(n.$$.fragment),r=j(),y(M.$$.fragment)},l(s){U(e.$$.fragment,s),t=J(s),U(n.$$.fragment,s),r=J(s),U(M.$$.fragment,s)},m(s,l){d(e,s,l),c(s,t,l),d(n,s,l),c(s,r,l),d(M,s,l),o=!0},p(s,l){const i={};l&2&&(i.$$scope={dirty:l,ctx:s}),e.$set(i);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),n.$set(G);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),M.$set(Z)},i(s){o||(w(e.$$.fragment,s),w(n.$$.fragment,s),w(M.$$.fragment,s),o=!0)},o(s){m(e.$$.fragment,s),m(n.$$.fragment,s),m(M.$$.fragment,s),o=!1},d(s){s&&(p(t),p(r)),T(e,s),T(n,s),T(M,s)}}}function rs(h){let e,t,n="Quand vous avez terminé, implémentez vos outils personnalisés dans le fichier <code>tools.py</code>.";return{c(){e=hl(`Essayez d'implémenter un outil qui peut être utilisé pour obtenir les dernières nouvelles sur un sujet spécifique.
`),t=b("p"),t.innerHTML=n},l(r){e=bl(r,`Essayez d'implémenter un outil qui peut être utilisé pour obtenir les dernières nouvelles sur un sujet spécifique.
`),t=I(r,"P",{"data-svelte-h":!0}),f(t)!=="svelte-n02kus"&&(t.innerHTML=n)},m(r,M){c(r,e,M),c(r,t,M)},p:C,d(r){r&&(p(e),p(t))}}}function is(h){let e,t,n,r,M,o,s,l=`Dans cette section, nous allons donner à Alfred l’accès au web, lui permettant de trouver les dernières nouvelles et mises à jour mondiales.
De plus, il aura accès aux données météorologiques et aux statistiques de téléchargement de modèles <em>Hugging Face Hub</em>, pour qu’il puisse faire des conversations pertinentes sur des sujets frais.`,i,G,Z,z,Il="Rappelez-vous que nous voulons qu’Alfred établisse sa présence comme un véritable hôte de la renaissance, avec une connaissance approfondie du monde.",P,A,fl="Pour ce faire, nous devons nous assurer qu’Alfred a accès aux dernières nouvelles et informations sur le monde.",K,X,Bl="Commençons par créer un outil de recherche web pour Alfred !",ll,V,sl,R,el,v,Gl="Le gala parfait aurait des feux d’artifice dans un ciel clair, nous devons nous assurer que les feux d’artifice ne sont pas annulés à cause du mauvais temps.",al,Y,Zl="Créons un outil personnalisé qui peut être utilisé pour appeler une API météorologique externe et obtenir les informations météorologiques pour un lieu donné.",nl,Q,tl,$,Ml,x,ol,S,Cl="En présence au gala se trouvent le gratin des constructeurs d’IA. Alfred veut les impressionner en discutant de leurs modèles, jeux de données et <em>spaces</em> les plus populaires. Nous créerons un outil pour récupérer les statistiques de modèles du <em>Hugging Face Hub</em> basées sur un nom d’utilisateur.",pl,k,cl,N,gl="Avec l’outil de statistiques <em>Hub</em>, Alfred peut maintenant impressionner les constructeurs d’IA influents en discutant de leurs modèles les plus populaires.",rl,_,il,F,Vl="Maintenant que nous avons tous les outils, intégrons-les dans l’agent d’Alfred :",ul,E,jl,q,Jl,H,Ql="En intégrant ces outils, Alfred est maintenant équipé pour gérer une variété de tâches, des recherches web aux mises à jour météorologiques et aux statistiques de modèles. Cela garantit qu’il reste l’hôte le plus informé et engageant du gala.",yl,W,Ul,D,dl,L,wl;return M=new O({props:{title:"Construction et intégration d’outils pour votre agent",local:"construction-et-intégration-doutils-pour-votre-agent",headingTag:"h1"}}),G=new O({props:{title:"Donnez à votre agent l’accès au web",local:"donnez-à-votre-agent-laccès-au-web",headingTag:"h2"}}),V=new ml({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[Ol]},$$scope:{ctx:h}}}),R=new O({props:{title:"Création d’un outil personnalisé pour les informations météorologiques afin de programmer les feux d’artifice",local:"création-dun-outil-personnalisé-pour-les-informations-météorologiques-afin-de-programmer-les-feux-dartifice",headingTag:"h2"}}),Q=new Rl({props:{$$slots:{default:[Ll]},$$scope:{ctx:h}}}),$=new ml({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[ss]},$$scope:{ctx:h}}}),x=new O({props:{title:"Création d’un outil de statistiques Hub pour les constructeurs d’IA influents",local:"création-dun-outil-de-statistiques-hub-pour-les-constructeurs-dia-influents",headingTag:"h2"}}),k=new ml({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[ts]},$$scope:{ctx:h}}}),_=new O({props:{title:"Intégration des outils avec Alfred",local:"intégration-des-outils-avec-alfred",headingTag:"h2"}}),E=new ml({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[cs]},$$scope:{ctx:h}}}),q=new O({props:{title:"Conclusion",local:"conclusion",headingTag:"h2"}}),W=new Rl({props:{$$slots:{default:[rs]},$$scope:{ctx:h}}}),D=new Fl({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/fr/unit3/agentic-rag/tools.mdx"}}),{c(){e=b("meta"),t=j(),n=b("p"),r=j(),y(M.$$.fragment),o=j(),s=b("p"),s.innerHTML=l,i=j(),y(G.$$.fragment),Z=j(),z=b("p"),z.textContent=Il,P=j(),A=b("p"),A.textContent=fl,K=j(),X=b("p"),X.textContent=Bl,ll=j(),y(V.$$.fragment),sl=j(),y(R.$$.fragment),el=j(),v=b("p"),v.textContent=Gl,al=j(),Y=b("p"),Y.textContent=Zl,nl=j(),y(Q.$$.fragment),tl=j(),y($.$$.fragment),Ml=j(),y(x.$$.fragment),ol=j(),S=b("p"),S.innerHTML=Cl,pl=j(),y(k.$$.fragment),cl=j(),N=b("p"),N.innerHTML=gl,rl=j(),y(_.$$.fragment),il=j(),F=b("p"),F.textContent=Vl,ul=j(),y(E.$$.fragment),jl=j(),y(q.$$.fragment),Jl=j(),H=b("p"),H.textContent=Ql,yl=j(),y(W.$$.fragment),Ul=j(),y(D.$$.fragment),dl=j(),L=b("p"),this.h()},l(a){const u=Nl("svelte-u9bgzb",document.head);e=I(u,"META",{name:!0,content:!0}),u.forEach(p),t=J(a),n=I(a,"P",{}),Xl(n).forEach(p),r=J(a),U(M.$$.fragment,a),o=J(a),s=I(a,"P",{"data-svelte-h":!0}),f(s)!=="svelte-19c61s5"&&(s.innerHTML=l),i=J(a),U(G.$$.fragment,a),Z=J(a),z=I(a,"P",{"data-svelte-h":!0}),f(z)!=="svelte-1c94rbt"&&(z.textContent=Il),P=J(a),A=I(a,"P",{"data-svelte-h":!0}),f(A)!=="svelte-6fw3vm"&&(A.textContent=fl),K=J(a),X=I(a,"P",{"data-svelte-h":!0}),f(X)!=="svelte-1008e7z"&&(X.textContent=Bl),ll=J(a),U(V.$$.fragment,a),sl=J(a),U(R.$$.fragment,a),el=J(a),v=I(a,"P",{"data-svelte-h":!0}),f(v)!=="svelte-vgm03n"&&(v.textContent=Gl),al=J(a),Y=I(a,"P",{"data-svelte-h":!0}),f(Y)!=="svelte-tbrv1w"&&(Y.textContent=Zl),nl=J(a),U(Q.$$.fragment,a),tl=J(a),U($.$$.fragment,a),Ml=J(a),U(x.$$.fragment,a),ol=J(a),S=I(a,"P",{"data-svelte-h":!0}),f(S)!=="svelte-vtabzj"&&(S.innerHTML=Cl),pl=J(a),U(k.$$.fragment,a),cl=J(a),N=I(a,"P",{"data-svelte-h":!0}),f(N)!=="svelte-1sdiz8t"&&(N.innerHTML=gl),rl=J(a),U(_.$$.fragment,a),il=J(a),F=I(a,"P",{"data-svelte-h":!0}),f(F)!=="svelte-9w8iuq"&&(F.textContent=Vl),ul=J(a),U(E.$$.fragment,a),jl=J(a),U(q.$$.fragment,a),Jl=J(a),H=I(a,"P",{"data-svelte-h":!0}),f(H)!=="svelte-u34lyp"&&(H.textContent=Ql),yl=J(a),U(W.$$.fragment,a),Ul=J(a),U(D.$$.fragment,a),dl=J(a),L=I(a,"P",{}),Xl(L).forEach(p),this.h()},h(){Tl(e,"name","hf:doc:metadata"),Tl(e,"content",us)},m(a,u){_l(document.head,e),c(a,t,u),c(a,n,u),c(a,r,u),d(M,a,u),c(a,o,u),c(a,s,u),c(a,i,u),d(G,a,u),c(a,Z,u),c(a,z,u),c(a,P,u),c(a,A,u),c(a,K,u),c(a,X,u),c(a,ll,u),d(V,a,u),c(a,sl,u),d(R,a,u),c(a,el,u),c(a,v,u),c(a,al,u),c(a,Y,u),c(a,nl,u),d(Q,a,u),c(a,tl,u),d($,a,u),c(a,Ml,u),d(x,a,u),c(a,ol,u),c(a,S,u),c(a,pl,u),d(k,a,u),c(a,cl,u),c(a,N,u),c(a,rl,u),d(_,a,u),c(a,il,u),c(a,F,u),c(a,ul,u),d(E,a,u),c(a,jl,u),d(q,a,u),c(a,Jl,u),c(a,H,u),c(a,yl,u),d(W,a,u),c(a,Ul,u),d(D,a,u),c(a,dl,u),c(a,L,u),wl=!0},p(a,[u]){const $l={};u&2&&($l.$$scope={dirty:u,ctx:a}),V.$set($l);const kl={};u&2&&(kl.$$scope={dirty:u,ctx:a}),Q.$set(kl);const El={};u&2&&(El.$$scope={dirty:u,ctx:a}),$.$set(El);const Wl={};u&2&&(Wl.$$scope={dirty:u,ctx:a}),k.$set(Wl);const zl={};u&2&&(zl.$$scope={dirty:u,ctx:a}),E.$set(zl);const Al={};u&2&&(Al.$$scope={dirty:u,ctx:a}),W.$set(Al)},i(a){wl||(w(M.$$.fragment,a),w(G.$$.fragment,a),w(V.$$.fragment,a),w(R.$$.fragment,a),w(Q.$$.fragment,a),w($.$$.fragment,a),w(x.$$.fragment,a),w(k.$$.fragment,a),w(_.$$.fragment,a),w(E.$$.fragment,a),w(q.$$.fragment,a),w(W.$$.fragment,a),w(D.$$.fragment,a),wl=!0)},o(a){m(M.$$.fragment,a),m(G.$$.fragment,a),m(V.$$.fragment,a),m(R.$$.fragment,a),m(Q.$$.fragment,a),m($.$$.fragment,a),m(x.$$.fragment,a),m(k.$$.fragment,a),m(_.$$.fragment,a),m(E.$$.fragment,a),m(q.$$.fragment,a),m(W.$$.fragment,a),m(D.$$.fragment,a),wl=!1},d(a){a&&(p(t),p(n),p(r),p(o),p(s),p(i),p(Z),p(z),p(P),p(A),p(K),p(X),p(ll),p(sl),p(el),p(v),p(al),p(Y),p(nl),p(tl),p(Ml),p(ol),p(S),p(pl),p(cl),p(N),p(rl),p(il),p(F),p(ul),p(jl),p(Jl),p(H),p(yl),p(Ul),p(dl),p(L)),p(e),T(M,a),T(G,a),T(V,a),T(R,a),T(Q,a),T($,a),T(x,a),T(k,a),T(_,a),T(E,a),T(q,a),T(W,a),T(D,a)}}}const us='{"title":"Construction et intégration d’outils pour votre agent","local":"construction-et-intégration-doutils-pour-votre-agent","sections":[{"title":"Donnez à votre agent l’accès au web","local":"donnez-à-votre-agent-laccès-au-web","sections":[],"depth":2},{"title":"Création d’un outil personnalisé pour les informations météorologiques afin de programmer les feux d’artifice","local":"création-dun-outil-personnalisé-pour-les-informations-météorologiques-afin-de-programmer-les-feux-dartifice","sections":[],"depth":2},{"title":"Création d’un outil de statistiques Hub pour les constructeurs d’IA influents","local":"création-dun-outil-de-statistiques-hub-pour-les-constructeurs-dia-influents","sections":[],"depth":2},{"title":"Intégration des outils avec Alfred","local":"intégration-des-outils-avec-alfred","sections":[],"depth":2},{"title":"Conclusion","local":"conclusion","sections":[],"depth":2}],"depth":1}';function js(h){return Yl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hs extends xl{constructor(e){super(),Sl(this,e,js,is,vl,{})}}export{hs as component};
