import{s as Rl,o as vl,n as V}from"../chunks/scheduler.505acc25.js";import{S as xl,i as Yl,e as b,s as u,c as y,h as Sl,a as I,d as o,b as J,f as Xl,g as U,j as B,k as hl,l as Nl,m as c,n as d,t as w,o as m,p as T}from"../chunks/index.b1175496.js";import{C as Fl,H as L}from"../chunks/Heading.988e52fa.js";import{C as f}from"../chunks/CodeBlock.ed64aebc.js";import{H as bl,a as C}from"../chunks/HfOption.ccfd750e.js";import{E as _l}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.3d47a398.js";function ql(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function Hl(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function Dl(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function Ol(h){let n,p,e,j,M,t;return n=new C({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ql]},$$scope:{ctx:h}}}),e=new C({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Hl]},$$scope:{ctx:h}}}),M=new C({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Dl]},$$scope:{ctx:h}}}),{c(){y(n.$$.fragment),p=u(),y(e.$$.fragment),j=u(),y(M.$$.fragment)},l(s){U(n.$$.fragment,s),p=J(s),U(e.$$.fragment,s),j=J(s),U(M.$$.fragment,s)},m(s,l){d(n,s,l),c(s,p,l),d(e,s,l),c(s,j,l),d(M,s,l),t=!0},p(s,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:s}),n.$set(r);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),e.$set(Z);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),M.$set(G)},i(s){t||(w(n.$$.fragment,s),w(e.$$.fragment,s),w(M.$$.fragment,s),t=!0)},o(s){m(n.$$.fragment,s),m(e.$$.fragment,s),m(M.$$.fragment,s),t=!1},d(s){s&&(o(p),o(j)),T(n,s),T(e,s),T(M,s)}}}function Ll(h){let n,p;return n=new f({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBaW1wb3J0JTIwcmFuZG9tJTBBJTBBY2xhc3MlMjBXZWF0aGVySW5mb1Rvb2woVG9vbCklM0ElMEElMjAlMjAlMjAlMjBuYW1lJTIwJTNEJTIwJTIyd2VhdGhlcl9pbmZvJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJSJUMzJUE5Y3VwJUMzJUE4cmUlMjBkZXMlMjBpbmZvcm1hdGlvbnMlMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ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MjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJjb25kaXRpb24lMjIlM0ElMjAlMjJDbGFpciUyMiUyQyUyMCUyMnRlbXBfYyUyMiUzQSUyMDI1JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIyY29uZGl0aW9uJTIyJTNBJTIwJTIyVmVudGV1eCUyMiUyQyUyMCUyMnRlbXBfYyUyMiUzQSUyMDIwJTdEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwUyVDMyVBOWxlY3Rpb25uZXIlMjBhbCVDMyVBOWF0b2lyZW1lbnQlMjB1bmUlMjBjb25kaXRpb24lMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ2lxdWUlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBkYXRhJTIwJTNEJTIwcmFuZG9tLmNob2ljZSh3ZWF0aGVyX2NvbmRpdGlvbnMpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwZiUyMk0lQzMlQTl0JUMzJUE5byUyMCVDMyVBMCUyMCU3QmxvY2F0aW9uJTdEJTNBJTIwJTdCZGF0YSU1Qidjb25kaXRpb24nJTVEJTdEJTJDJTIwJTdCZGF0YSU1Qid0ZW1wX2MnJTVEJTdEJUMyJUIwQyUyMiUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUwQXdlYXRoZXJfaW5mb190b29sJTIwJTNEJTIwV2VhdGhlckluZm9Ub29sKCk=",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(n.$$.fragment)},l(e){U(n.$$.fragment,e)},m(e,j){d(n,e,j),p=!0},p:V,i(e){p||(w(n.$$.fragment,e),p=!0)},o(e){m(n.$$.fragment,e),p=!1},d(e){T(n,e)}}}function Kl(h){let n,p;return n=new f({props:{code:"aW1w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bSVDMyVBOXQlQzMlQTlvcm9sb2dpcXVlJTBBJTIwJTIwJTIwJTIwZGF0YSUyMCUzRCUyMHJhbmRvbS5jaG9pY2Uod2VhdGhlcl9jb25kaXRpb25zKSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJNJUMzJUE5dCVDMyVBOW8lMjAlQzMlQTAlMjAlN0Jsb2NhdGlvbiU3RCUzQSUyMCU3QmRhdGElNUInY29uZGl0aW9uJyU1RCU3RCUyQyUyMCU3QmRhdGElNUIndGVtcF9jJyU1RCU3RCVDMiVCMEMlMjIlMEElMEElMjMlMjBJbml0aWFsaXNlciUyMGwnb3V0aWwlMEF3ZWF0aGVyX2luZm9fdG9vbCUyMCUzRCUyMEZ1bmN0aW9uVG9vbC5mcm9tX2RlZmF1bHRzKGdldF93ZWF0aGVyX2luZm8p",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(n.$$.fragment)},l(e){U(n.$$.fragment,e)},m(e,j){d(n,e,j),p=!0},p:V,i(e){p||(w(n.$$.fragment,e),p=!0)},o(e){m(n.$$.fragment,e),p=!1},d(e){T(n,e)}}}function Pl(h){let n,p;return n=new f({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi50b29scyUyMGltcG9ydCUyMFRvb2wlMEFpbXBvcnQlMjByYW5kb20lMEElMEFkZWYlMjBnZXRfd2VhdGhlcl9pbmZvKGxvY2F0aW9uJTNBJTIwc3RyKSUyMC0lM0UlMjBzdHIlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJSJUMzJUE5Y3VwJUMzJUE4cmUlMjBkZXMlMjBpbmZvcm1hdGlvbnMlMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ2lxdWVzJTIwZmFjdGljZXMlMjBwb3VyJTIwdW4lMjBsaWV1JTIwZG9ubiVDMyVBOS4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjAlMjMlMjBEb25uJUMzJUE5ZXMlMjBtJUMzJUE5dCVDMyVBOW9yb2xvZ2lxdWVzJTIwZmFjdGljZXMlMEElMjAlMjAlMjAlMjB3ZWF0aGVyX2NvbmRpdGlvbnMlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJjb25kaXRpb24lMjIlM0ElMjAlMjJQbHV2aWV1eCUyMiUyQyUyMCUyMnRlbXBfYyUyMiUzQSUyMDE1JTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIw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Rvbm4lQzMlQTkuJTIyJTBBKQ==",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(n.$$.fragment)},l(e){U(n.$$.fragment,e)},m(e,j){d(n,e,j),p=!0},p:V,i(e){p||(w(n.$$.fragment,e),p=!0)},o(e){m(n.$$.fragment,e),p=!1},d(e){T(n,e)}}}function ls(h){let n,p,e,j,M,t;return n=new C({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[Ll]},$$scope:{ctx:h}}}),e=new C({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Kl]},$$scope:{ctx:h}}}),M=new C({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Pl]},$$scope:{ctx:h}}}),{c(){y(n.$$.fragment),p=u(),y(e.$$.fragment),j=u(),y(M.$$.fragment)},l(s){U(n.$$.fragment,s),p=J(s),U(e.$$.fragment,s),j=J(s),U(M.$$.fragment,s)},m(s,l){d(n,s,l),c(s,p,l),d(e,s,l),c(s,j,l),d(M,s,l),t=!0},p(s,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:s}),n.$set(r);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),e.$set(Z);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),M.$set(G)},i(s){t||(w(n.$$.fragment,s),w(e.$$.fragment,s),w(M.$$.fragment,s),t=!0)},o(s){m(n.$$.fragment,s),m(e.$$.fragment,s),m(M.$$.fragment,s),t=!1},d(s){s&&(o(p),o(j)),T(n,s),T(e,s),T(M,s)}}}function ss(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfbW9kZWxzJTBBJTBBY2xhc3MlMjBIdWJTdGF0c1Rvb2woVG9vbCklM0ElMEElMjAlMjAlMjAlMjBuYW1lJTIwJTNEJTIwJTIyaHViX3N0YXRzJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJSJUMzJUE5Y3VwJUMzJUE4cmUlMjBsZSUyMG1vZCVDMyVBOGxlJTIwbGUlMjBwbHVzJTIwdCVDMyVBOWwlQzMlQTljaGFyZyVDMyVBOSUy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lMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyRXJyZXVyJTIwbG9ycyUyMGRlJTIwbGElMjByJUMzJUE5Y3VwJUMzJUE5cmF0aW9uJTIwZGVzJTIwbW9kJUMzJUE4bGVzJTIwcG91ciUyMCU3QmF1dGhvciU3RCUzQSUyMCU3QnN0cihlKSU3RCUyMiUwQSUwQSUyMyUyMEluaXRpYWxpc2VyJTIwbCdvdXRpbCUwQWh1Yl9zdGF0c190b29sJTIwJTNEJTIwSHViU3RhdHNUb29sKCklMEElMEElMjMlMjBFeGVtcGxlJTIwZCd1c2FnZSUwQXByaW50KGh1Yl9zdGF0c190b29sKCUyMmZhY2Vib29rJTIyKSklMjAlMjMlMjBFeGVtcGxlJTIwJTNBJTIwT2J0ZW5pciUyMGxlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2s=",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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function as(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({props:{code:"aW1wb3J0JTIwcmFuZG9tJTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwbGlzdF9tb2RlbHMlMEElMEFkZWYlMjBnZXRfaHViX3N0YXRzKGF1dGhvciUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyUiVDMyVBOWN1cCVDMyVBOHJlJTIwbGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBkJ3VuJTIwYXV0ZXVyJTIwc3AlQzMlQTljaWZpcXVlJTIwc3VyJTIwbGUlMjBIdWdnaW5nJTIwRmFjZSUyMEh1Yi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjB0cnklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBM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JTIwZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJFcnJldXIlMjBsb3JzJTIwZGUlMjBsYSUyMHIlQzMlQTljdXAlQzMlQTlyYXRpb24lMjBkZXMlMjBtb2QlQzMlQThsZXMlMjBwb3VyJTIwJTdCYXV0aG9yJTdEJTNBJTIwJTdCc3RyKGUpJTdEJTIyJTBBJTBBJTIzJTIwSW5pdGlhbGlzZXIlMjBsJ291dGlsJTBBaHViX3N0YXRzX3Rvb2wlMjAlM0QlMjBGdW5jdGlvblRvb2wuZnJvbV9kZWZhdWx0cyhnZXRfaHViX3N0YXRzKSUwQSUwQSUyMyUyMEV4ZW1wbGUlMjBkJ3VzYWdlJTBBcHJpbnQoaHViX3N0YXRzX3Rvb2woJTIyZmFjZWJvb2slMjIpKSUyMCUyMyUyMEV4ZW1wbGUlMjAlM0ElMjBPYnRlbmlyJTIwbGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBwYXIlMjBGYWNlYm9vaw==",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;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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function es(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({props:{code:"ZnJvbSUyMGxhbmdjaGFpbi50b29scyUyMGltcG9ydCUyMFRvb2wlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwbGlzdF9tb2RlbHMlMEElMEFkZWYlMjBnZXRfaHViX3N0YXRzKGF1dGhvciUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyUiVDMyVBOWN1cCVDMyVBOHJlJTIwbGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBkJ3VuJTIwYXV0ZXVyJTIwc3AlQzMlQTljaWZpcXVlJTIwc3VyJTIwbGUlMjBIdWdnaW5nJTIwRmFjZSUyMEh1Yi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjB0cnklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBMaXN0ZXIlMjBsZXMlMjBtb2QlQzMlQThsZXMlMjBkZSUyMGwnYXV0ZXVyJTIwc3AlQzMlQTljaWZpJUMzJUE5JTJDJTIwdHJpJUMzJUE5cyUyMHBhciUyMHQlQzMlQTlsJUMzJUE5Y2hhcmdlbWVudHMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtb2RlbHMlMjAlM0QlMjBsaX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BBJTBBJTIzJTIwSW5pdGlhbGlzZXIlMjBsJ291dGlsJTBBaHViX3N0YXRzX3Rvb2wlMjAlM0QlMjBUb29sKCUwQSUyMCUyMCUyMCUyMG5hbWUlM0QlMjJnZXRfaHViX3N0YXRzJTIyJTJDJTBBJTIwJTIwJTIwJTIwZnVuYyUzRGdldF9odWJfc3RhdHMlMkMlMEElMjAlMjAlMjAlMjBkZXNjcmlwdGlvbiUzRCUyMlIlQzMlQTljdXAlQzMlQThyZSUyMGxlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwZCd1biUyMGF1dGV1ciUyMHNwJUMzJUE5Y2lmaXF1ZSUyMHN1ciUyMGxlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIuJTIyJTBBKSUwQSUwQSUyMyUyMEV4ZW1wbGUlMjBkJ3VzYWdlJTBBcHJpbnQoaHViX3N0YXRzX3Rvb2wuaW52b2tlKCUyMmZhY2Vib29rJTIyKSklMjAlMjMlMjBFeGVtcGxlJTIwJTNBJTIwT2J0ZW5pciUyMGxlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2s=",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}}),t=new f({props:{code:"TGUlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHQlQzMlQTlsJUMzJUE5Y2hhcmclQzMlQTklMjBwYXIlMjBmYWNlYm9vayUyMGVzdCUyMGZhY2Vib29rJTJGZXNtZm9sZF92MSUyMGF2ZWMlMjAxMyUyMDEwOSUyMDg2MSUyMHQlQzMlQTlsJUMzJUE5Y2hhcmdlbWVudHMu",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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function ns(h){let n,p,e,j,M,t;return n=new C({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ss]},$$scope:{ctx:h}}}),e=new C({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[as]},$$scope:{ctx:h}}}),M=new C({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[es]},$$scope:{ctx:h}}}),{c(){y(n.$$.fragment),p=u(),y(e.$$.fragment),j=u(),y(M.$$.fragment)},l(s){U(n.$$.fragment,s),p=J(s),U(e.$$.fragment,s),j=J(s),U(M.$$.fragment,s)},m(s,l){d(n,s,l),c(s,p,l),d(e,s,l),c(s,j,l),d(M,s,l),t=!0},p(s,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:s}),n.$set(r);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),e.$set(Z);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),M.$set(G)},i(s){t||(w(n.$$.fragment,s),w(e.$$.fragment,s),w(M.$$.fragment,s),t=!0)},o(s){m(n.$$.fragment,s),m(e.$$.fragment,s),m(M.$$.fragment,s),t=!1},d(s){s&&(o(p),o(j)),T(n,s),T(e,s),T(M,s)}}}function ts(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({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}}),t=new f({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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function Ms(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({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}}),t=new f({props:{code:"JUYwJTlGJThFJUE5JTIwUiVDMyVBOXBvbnNlJTIwZCdBbGZyZWQlMjAlM0ElMEFGYWNlYm9vayUyMGVzdCUyMHVuJTIwc2VydmljZSUyMGRlJTIwciVDMyVBOXNlYXUlMjBzb2NpYWwlMjBldCUyMHVuZSUyMGVudHJlcHJpc2UlMjB0ZWNobm9sb2dpcXVlJTIwYmFzJUMzJUE5ZSUyMCVDMyVBMCUyME1lbmxvJTIwUGFyayUyQyUyMGVuJTIwQ2FsaWZvcm5pZS4lMjBFbGxlJTIwYSUyMCVDMyVBOXQlQzMlQTklMjBmb25kJUMzJUE5ZSUyMHBhciUyME1hcmslMjBadWNrZXJiZXJnJTIwZXQlMjBwZXJtZXQlMjBhdXglMjBnZW5zJTIwZGUlMjBjciVDMyVBOWVyJTIwZGVzJTIwcHJvZmlscyUyQyUyMHNlJTIwY29ubmVjdGVyJTIwYXZlYyUyMGRlcyUyMGFtaXMlMjBldCUyMGxhJTIwZmFtaWxsZSUyQyUyMHBhcnRhZ2VyJTIwZGVzJTIwcGhvdG9zJTIwZXQlMjB2aWQlQzMlQTlvcyUyQyUyMGV0JTIwcmVqb2luZHJlJTIwZGVzJTIwZ3JvdXBlcyUyMGJhcyVDMyVBOXMlMjBzdXIlMjBkZXMlMjBpbnQlQzMlQTlyJUMzJUFBdHMlMjBwYXJ0YWclQzMlQTlzLiUyMExlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjBwb3B1bGFpcmUlMjBwYXIlMjBGYWNlYm9vayUyMHN1ciUyMGxlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlMjBlc3QlMjBmYWNlYm9vayUyRmVzbWZvbGRfdjElMjBhdmVjJTIwMTMlMjAxMDklMjA4NjElMjB0JUMzJUE5bCVDMyVBOWNoYXJnZW1lbnRzLg==",highlighted:`🎩 Réponse <span class="hljs-keyword">d</span>&#x27;Alfred :
Facebook <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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function ps(h){let n,p,e,j="Sortie attendue :",M,t,s;return n=new f({props:{code:"ZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMFR5cGVkRGljdCUyQyUyMEFubm90YXRlZCUwQWZyb20lMjBsYW5nZ3JhcGguZ3JhcGgubWVzc2FnZSUyMGltcG9ydCUyMGFkZF9tZXNzYWdlcyUwQWZyb20lMjBsYW5nY2hhaW5fY29yZS5tZXNzYWdlcyUyMGltcG9ydCUyMEFueU1lc3NhZ2UlMkMlMjBIdW1hbk1lc3NhZ2UlMkMlMjBBSU1lc3NhZ2UlMEFmcm9tJTIwbGFuZ2dyYXBoLnByZWJ1aWx0JTIwaW1wb3J0JTIwVG9vbE5vZGUlMEFmcm9tJTIwbGFuZ2dyYXBoLm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JTIwbiVDMyVBOWNlc3NpdGUlMjB1biUyMG91dGlsJTJDJTIwcm91dGVyJTIwdmVycyUyMGxlcyUyMG91dGlscyUwQSUyMCUyMCUyMCUyMCUyMyUyMFNpbm9uJTJDJTIwZm91cm5pciUyMHVuZSUyMHIlQzMlQTlwb25zZSUyMGRpcmVjdGUlMEElMjAlMjAlMjAlMjB0b29sc19jb25kaXRpb24lMkMlMEEpJTBBYnVpbGRlci5hZGRfZWRnZSglMjJ0b29scyUyMiUyQyUyMCUyMmFzc2lzdGFudCUyMiklMEFhbGZyZWQlMjAlM0QlMjBidWlsZGVyLmNvbXBpbGUoKSUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCSHVtYW5NZXNzYWdlKGNvbnRlbnQlM0QlMjJRdWklMjBlc3QlMjBGYWNlYm9vayUyMGV0JTIwcXVlbCUyMGVzdCUyMGxldXIlMjBtb2QlQzMlQThsZSUyMGxlJTIwcGx1cyUyMHBvcHVsYWlyZSUyMCUzRiUyMiklNUQlMEFyZXNwb25zZSUyMCUzRCUyMGFsZnJlZC5pbnZva2UoJTdCJTIybWVzc2FnZXMlMjIlM0ElMjBtZXNzYWdlcyU3RCklMEElMEFwcmludCglMjIlRjAlOUYlOEUlQTklMjBSJUMzJUE5cG9uc2UlMjBkJ0FsZnJlZCUyMCUzQSUyMiklMEFwcmludChyZXNwb25zZSU1QidtZXNzYWdlcyclNUQlNUItMSU1RC5jb250ZW50KQ==",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}}),t=new f({props:{code:"JUYwJTlGJThFJUE5JTIwUiVDMyVBOXBvbnNlJTIwZCdBbGZyZWQlMjAlM0ElMEFGYWNlYm9vayUyMGVzdCUyMHVuZSUyMGVudHJlcHJpc2UlMjBkZSUyMG0lQzMlQTlkaWFzJTIwc29jaWF1eCUyMGNvbm51ZSUyMHBvdXIlMjBzb24lMjBzaXRlJTIwZGUlMjByJUMzJUE5c2VhdSUyMHNvY2lhbCUyQyUyMEZhY2Vib29rJTJDJTIwYWluc2klMjBxdWUlMjBkJ2F1dHJlcyUyMHNlcnZpY2VzJTIwY29tbWUlMjBJbnN0YWdyYW0lMjBldCUyMFdoYXRzQXBwLiUyMExlJTIwbW9kJUMzJUE4bGUlMjBsZSUyMHBsdXMlMjB0JUMzJUE5bCVDMyVBOWNoYXJnJUMzJUE5JTIwcGFyJTIwRmFjZWJvb2slMjBzdXIlMjBsZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViJTIwZXN0JTIwZmFjZWJvb2slMkZlc21mb2xkX3YxJTIwYXZlYyUyMDEzJTIwMjAyJTIwMzIxJTIwdCVDMyVBOWwlQzMlQTljaGFyZ2VtZW50cy4=",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(n.$$.fragment),p=u(),e=b("p"),e.textContent=j,M=u(),y(t.$$.fragment)},l(l){U(n.$$.fragment,l),p=J(l),e=I(l,"P",{"data-svelte-h":!0}),B(e)!=="svelte-cs180i"&&(e.textContent=j),M=J(l),U(t.$$.fragment,l)},m(l,r){d(n,l,r),c(l,p,r),c(l,e,r),c(l,M,r),d(t,l,r),s=!0},p:V,i(l){s||(w(n.$$.fragment,l),w(t.$$.fragment,l),s=!0)},o(l){m(n.$$.fragment,l),m(t.$$.fragment,l),s=!1},d(l){l&&(o(p),o(e),o(M)),T(n,l),T(t,l)}}}function os(h){let n,p,e,j,M,t;return n=new C({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ts]},$$scope:{ctx:h}}}),e=new C({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Ms]},$$scope:{ctx:h}}}),M=new C({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[ps]},$$scope:{ctx:h}}}),{c(){y(n.$$.fragment),p=u(),y(e.$$.fragment),j=u(),y(M.$$.fragment)},l(s){U(n.$$.fragment,s),p=J(s),U(e.$$.fragment,s),j=J(s),U(M.$$.fragment,s)},m(s,l){d(n,s,l),c(s,p,l),d(e,s,l),c(s,j,l),d(M,s,l),t=!0},p(s,l){const r={};l&2&&(r.$$scope={dirty:l,ctx:s}),n.$set(r);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:s}),e.$set(Z);const G={};l&2&&(G.$$scope={dirty:l,ctx:s}),M.$set(G)},i(s){t||(w(n.$$.fragment,s),w(e.$$.fragment,s),w(M.$$.fragment,s),t=!0)},o(s){m(n.$$.fragment,s),m(e.$$.fragment,s),m(M.$$.fragment,s),t=!1},d(s){s&&(o(p),o(j)),T(n,s),T(e,s),T(M,s)}}}function cs(h){let n,p,e,j,M,t,s,l,r,Z=`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 des modèles du Hub d’Hugging Face Hub, pour qu’il puisse faire des conversations pertinentes sur des sujets frais.`,G,z,P,A,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.",ll,X,Bl="Pour ce faire, nous devons nous assurer qu’Alfred a accès aux dernières nouvelles et informations sur le monde.",sl,R,fl="Commençons par créer un outil de recherche web pour Alfred !",al,g,el,v,nl,x,Gl="Le gala parfait aurait un feu d’artifice dans un ciel clair, nous devons nous assurer qu’il ne soit pas annulé à cause du mauvais temps.",tl,Y,Zl="Créons un outil personnalisé qui peut être utilisé pour appeler une API météo externe et obtenir les informations pour un lieu donné.",Ml,Q,Cl='<p>Par souci de simplicité, nous utilisons une API météorologique factice pour cet exemple. Si vous voulez utiliser une véritable API, vous pourriez implémenter un outil utilisant l’API OpenWeatherMap comme dans <a href="../../unit1/tutorial">l’Unité 1</a>.</p>',pl,$,ol,S,cl,N,Vl="Le gala réunit le gratin des constructeurs d’IA. Alfred veut les impressionner en discutant de leurs modèles, jeux de données et Spaces les plus populaires. Nous créerons un outil pour récupérer les statistiques des modèles du Hub à partir d’un nom d’utilisateur.",rl,k,il,F,gl="Avec l’outil de statistiques, Alfred peut maintenant impressionner les constructeurs d’IA influents en discutant de leurs modèles les plus populaires.",jl,_,ul,q,Ql="Maintenant que nous avons tous les outils, intégrons-les dans l’agent d’Alfred :",Jl,E,yl,H,Ul,D,$l="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.",dl,W,kl="<p>Essayez d’implémenter un outil qui peut être utilisé pour obtenir les dernières nouvelles sur un sujet spécifique.</p> <p>Quand vous avez terminé, implémentez vos outils personnalisés dans le fichier <code>tools.py</code>.</p>",wl,O,ml,K,Tl;return M=new Fl({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),s=new L({props:{title:"Création et intégration d’outils pour votre agent",local:"création-et-intégration-doutils-pour-votre-agent",headingTag:"h1"}}),z=new L({props:{title:"Donnez à votre agent l’accès au web",local:"donnez-à-votre-agent-laccès-au-web",headingTag:"h2"}}),g=new bl({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[Ol]},$$scope:{ctx:h}}}),v=new L({props:{title:"Création d’un outil personnalisé pour les informations météorologiques afin de programmer le feu d’artifice",local:"création-dun-outil-personnalisé-pour-les-informations-météorologiques-afin-de-programmer-le-feu-dartifice",headingTag:"h2"}}),$=new bl({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[ls]},$$scope:{ctx:h}}}),S=new L({props:{title:"Création d’un outil pour obtenir les statistiques du Hub concernant les constructeurs d’IA influents",local:"création-dun-outil-pour-obtenir-les-statistiques-du-hub-concernant-les-constructeurs-dia-influents",headingTag:"h2"}}),k=new bl({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[ns]},$$scope:{ctx:h}}}),_=new L({props:{title:"Intégration des outils",local:"intégration-des-outils",headingTag:"h2"}}),E=new bl({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[os]},$$scope:{ctx:h}}}),H=new L({props:{title:"Conclusion",local:"conclusion",headingTag:"h2"}}),O=new _l({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/fr/unit3/agentic-rag/tools.mdx"}}),{c(){n=b("meta"),p=u(),e=b("p"),j=u(),y(M.$$.fragment),t=u(),y(s.$$.fragment),l=u(),r=b("p"),r.textContent=Z,G=u(),y(z.$$.fragment),P=u(),A=b("p"),A.textContent=Il,ll=u(),X=b("p"),X.textContent=Bl,sl=u(),R=b("p"),R.textContent=fl,al=u(),y(g.$$.fragment),el=u(),y(v.$$.fragment),nl=u(),x=b("p"),x.textContent=Gl,tl=u(),Y=b("p"),Y.textContent=Zl,Ml=u(),Q=b("blockquote"),Q.innerHTML=Cl,pl=u(),y($.$$.fragment),ol=u(),y(S.$$.fragment),cl=u(),N=b("p"),N.textContent=Vl,rl=u(),y(k.$$.fragment),il=u(),F=b("p"),F.textContent=gl,jl=u(),y(_.$$.fragment),ul=u(),q=b("p"),q.textContent=Ql,Jl=u(),y(E.$$.fragment),yl=u(),y(H.$$.fragment),Ul=u(),D=b("p"),D.textContent=$l,dl=u(),W=b("blockquote"),W.innerHTML=kl,wl=u(),y(O.$$.fragment),ml=u(),K=b("p"),this.h()},l(a){const i=Sl("svelte-u9bgzb",document.head);n=I(i,"META",{name:!0,content:!0}),i.forEach(o),p=J(a),e=I(a,"P",{}),Xl(e).forEach(o),j=J(a),U(M.$$.fragment,a),t=J(a),U(s.$$.fragment,a),l=J(a),r=I(a,"P",{"data-svelte-h":!0}),B(r)!=="svelte-wk2j2"&&(r.textContent=Z),G=J(a),U(z.$$.fragment,a),P=J(a),A=I(a,"P",{"data-svelte-h":!0}),B(A)!=="svelte-1c94rbt"&&(A.textContent=Il),ll=J(a),X=I(a,"P",{"data-svelte-h":!0}),B(X)!=="svelte-6fw3vm"&&(X.textContent=Bl),sl=J(a),R=I(a,"P",{"data-svelte-h":!0}),B(R)!=="svelte-1008e7z"&&(R.textContent=fl),al=J(a),U(g.$$.fragment,a),el=J(a),U(v.$$.fragment,a),nl=J(a),x=I(a,"P",{"data-svelte-h":!0}),B(x)!=="svelte-1qcy3r7"&&(x.textContent=Gl),tl=J(a),Y=I(a,"P",{"data-svelte-h":!0}),B(Y)!=="svelte-12dw46b"&&(Y.textContent=Zl),Ml=J(a),Q=I(a,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),B(Q)!=="svelte-3is5nx"&&(Q.innerHTML=Cl),pl=J(a),U($.$$.fragment,a),ol=J(a),U(S.$$.fragment,a),cl=J(a),N=I(a,"P",{"data-svelte-h":!0}),B(N)!=="svelte-v1nk6n"&&(N.textContent=Vl),rl=J(a),U(k.$$.fragment,a),il=J(a),F=I(a,"P",{"data-svelte-h":!0}),B(F)!=="svelte-w28ddb"&&(F.textContent=gl),jl=J(a),U(_.$$.fragment,a),ul=J(a),q=I(a,"P",{"data-svelte-h":!0}),B(q)!=="svelte-9w8iuq"&&(q.textContent=Ql),Jl=J(a),U(E.$$.fragment,a),yl=J(a),U(H.$$.fragment,a),Ul=J(a),D=I(a,"P",{"data-svelte-h":!0}),B(D)!=="svelte-u34lyp"&&(D.textContent=$l),dl=J(a),W=I(a,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),B(W)!=="svelte-1ckgxjw"&&(W.innerHTML=kl),wl=J(a),U(O.$$.fragment,a),ml=J(a),K=I(a,"P",{}),Xl(K).forEach(o),this.h()},h(){hl(n,"name","hf:doc:metadata"),hl(n,"content",rs),hl(Q,"class","tip"),hl(W,"class","tip")},m(a,i){Nl(document.head,n),c(a,p,i),c(a,e,i),c(a,j,i),d(M,a,i),c(a,t,i),d(s,a,i),c(a,l,i),c(a,r,i),c(a,G,i),d(z,a,i),c(a,P,i),c(a,A,i),c(a,ll,i),c(a,X,i),c(a,sl,i),c(a,R,i),c(a,al,i),d(g,a,i),c(a,el,i),d(v,a,i),c(a,nl,i),c(a,x,i),c(a,tl,i),c(a,Y,i),c(a,Ml,i),c(a,Q,i),c(a,pl,i),d($,a,i),c(a,ol,i),d(S,a,i),c(a,cl,i),c(a,N,i),c(a,rl,i),d(k,a,i),c(a,il,i),c(a,F,i),c(a,jl,i),d(_,a,i),c(a,ul,i),c(a,q,i),c(a,Jl,i),d(E,a,i),c(a,yl,i),d(H,a,i),c(a,Ul,i),c(a,D,i),c(a,dl,i),c(a,W,i),c(a,wl,i),d(O,a,i),c(a,ml,i),c(a,K,i),Tl=!0},p(a,[i]){const El={};i&2&&(El.$$scope={dirty:i,ctx:a}),g.$set(El);const Wl={};i&2&&(Wl.$$scope={dirty:i,ctx:a}),$.$set(Wl);const zl={};i&2&&(zl.$$scope={dirty:i,ctx:a}),k.$set(zl);const Al={};i&2&&(Al.$$scope={dirty:i,ctx:a}),E.$set(Al)},i(a){Tl||(w(M.$$.fragment,a),w(s.$$.fragment,a),w(z.$$.fragment,a),w(g.$$.fragment,a),w(v.$$.fragment,a),w($.$$.fragment,a),w(S.$$.fragment,a),w(k.$$.fragment,a),w(_.$$.fragment,a),w(E.$$.fragment,a),w(H.$$.fragment,a),w(O.$$.fragment,a),Tl=!0)},o(a){m(M.$$.fragment,a),m(s.$$.fragment,a),m(z.$$.fragment,a),m(g.$$.fragment,a),m(v.$$.fragment,a),m($.$$.fragment,a),m(S.$$.fragment,a),m(k.$$.fragment,a),m(_.$$.fragment,a),m(E.$$.fragment,a),m(H.$$.fragment,a),m(O.$$.fragment,a),Tl=!1},d(a){a&&(o(p),o(e),o(j),o(t),o(l),o(r),o(G),o(P),o(A),o(ll),o(X),o(sl),o(R),o(al),o(el),o(nl),o(x),o(tl),o(Y),o(Ml),o(Q),o(pl),o(ol),o(cl),o(N),o(rl),o(il),o(F),o(jl),o(ul),o(q),o(Jl),o(yl),o(Ul),o(D),o(dl),o(W),o(wl),o(ml),o(K)),o(n),T(M,a),T(s,a),T(z,a),T(g,a),T(v,a),T($,a),T(S,a),T(k,a),T(_,a),T(E,a),T(H,a),T(O,a)}}}const rs='{"title":"Création et intégration d’outils pour votre agent","local":"création-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 le feu d’artifice","local":"création-dun-outil-personnalisé-pour-les-informations-météorologiques-afin-de-programmer-le-feu-dartifice","sections":[],"depth":2},{"title":"Création d’un outil pour obtenir les statistiques du Hub concernant les constructeurs d’IA influents","local":"création-dun-outil-pour-obtenir-les-statistiques-du-hub-concernant-les-constructeurs-dia-influents","sections":[],"depth":2},{"title":"Intégration des outils","local":"intégration-des-outils","sections":[],"depth":2},{"title":"Conclusion","local":"conclusion","sections":[],"depth":2}],"depth":1}';function is(h){return vl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ws extends xl{constructor(n){super(),Yl(this,n,is,cs,Rl,{})}}export{ws as component};
