import{s as Ot,f as Kt,o as es,n as _}from"../chunks/scheduler.37c15a92.js";import{S as ts,i as ss,g as T,s as d,r as U,A as ls,h,f as s,c as m,j as yt,u as I,x as y,k as G,y as ns,a as l,v as g,d as b,t as Z,w as $,m as R,n as x}from"../chunks/index.2bf4358c.js";import{T as $e}from"../chunks/Tip.363c041f.js";import{C as W}from"../chunks/CodeBlock.4e987730.js";import{H as V}from"../chunks/Heading.8ada512a.js";import{H as ft,a as Q}from"../chunks/HfOption.02c8e375.js";import{E as as}from"../chunks/index.e71982be.js";function is(C){let a,u="You can choose any of the frameworks covered in the course for this use case. Select your preferred option from the code tabs.";return{c(){a=T("p"),a.textContent=u},l(c){a=h(c,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1846727"&&(a.textContent=u)},m(c,M){l(c,a,M)},p:_,d(c){c&&s(a)}}}function os(C){let a;return{c(){a=R("In a real-world scenario, this dataset could be expanded to include dietary preferences, gift interests, conversation topics to avoid, and other helpful details for a host.")},l(u){a=x(u,"In a real-world scenario, this dataset could be expanded to include dietary preferences, gift interests, conversation topics to avoid, and other helpful details for a host.")},m(u,c){l(u,a,c)},d(u){u&&s(a)}}}function rs(C){let a,u="We will use the Hugging Face <code>datasets</code> library to load the dataset and convert it into a list of <code>Document</code> objects from the <code>langchain.docstore.document</code> module.",c,M,p;return M=new W({props:{code:"aW1wb3J0JTIwZGF0YXNldHMlMEFmcm9tJTIwbGFuZ2NoYWluLmRvY3N0b3JlLmRvY3VtZW50JTIwaW1wb3J0JTIwRG9jdW1lbnQlMEElMEElMjMlMjBMb2FkJTIwdGhlJTIwZGF0YXNldCUwQWd1ZXN0X2RhdGFzZXQlMjAlM0QlMjBkYXRhc2V0cy5sb2FkX2RhdGFzZXQoJTIyYWdlbnRzLWNvdXJzZSUyRnVuaXQzLWludml0ZWVzJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiklMEElMEElMjMlMjBDb252ZXJ0JTIwZGF0YXNldCUyMGVudHJpZXMlMjBpbnRvJTIwRG9jdW1lbnQlMjBvYmplY3RzJTBBZG9jcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMERvY3VtZW50KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBhZ2VfY29udGVudCUzRCUyMiU1Q24lMjIuam9pbiglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmJTIyTmFtZSUzQSUyMCU3Qmd1ZXN0JTVCJ25hbWUnJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMlJlbGF0aW9uJTNBJTIwJTdCZ3Vlc3QlNUIncmVsYXRpb24nJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkRlc2NyaXB0aW9uJTNBJTIwJTdCZ3Vlc3QlNUInZGVzY3JpcHRpb24nJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkVtYWlsJTNBJTIwJTdCZ3Vlc3QlNUInZW1haWwnJTVEJTdEJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldGFkYXRhJTNEJTdCJTIybmFtZSUyMiUzQSUyMGd1ZXN0JTVCJTIybmFtZSUyMiU1RCU3RCUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjBmb3IlMjBndWVzdCUyMGluJTIwZ3Vlc3RfZGF0YXNldCUwQSU1RCUwQQ==",highlighted:`<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">from</span> langchain.docstore.document <span class="hljs-keyword">import</span> Document

<span class="hljs-comment"># Load the dataset</span>
guest_dataset = datasets.load_dataset(<span class="hljs-string">&quot;agents-course/unit3-invitees&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)

<span class="hljs-comment"># Convert dataset entries into Document objects</span>
docs = [
    Document(
        page_content=<span class="hljs-string">&quot;\\n&quot;</span>.join([
            <span class="hljs-string">f&quot;Name: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;name&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Relation: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;relation&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Description: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;description&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Email: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;email&#x27;</span>]}</span>&quot;</span>
        ]),
        metadata={<span class="hljs-string">&quot;name&quot;</span>: guest[<span class="hljs-string">&quot;name&quot;</span>]}
    )
    <span class="hljs-keyword">for</span> guest <span class="hljs-keyword">in</span> guest_dataset
]
`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment)},l(o){a=h(o,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1vrqwzz"&&(a.innerHTML=u),c=m(o),I(M.$$.fragment,o)},m(o,n){l(o,a,n),l(o,c,n),g(M,o,n),p=!0},p:_,i(o){p||(b(M.$$.fragment,o),p=!0)},o(o){Z(M.$$.fragment,o),p=!1},d(o){o&&(s(a),s(c)),$(M,o)}}}function ps(C){let a,u="We will use the Hugging Face <code>datasets</code> library to load the dataset and convert it into a list of <code>Document</code> objects from the <code>llama_index.core.schema</code> module.",c,M,p;return M=new W({props:{code:"aW1wb3J0JTIwZGF0YXNldHMlMEFmcm9tJTIwbGxhbWFfaW5kZXguY29yZS5zY2hlbWElMjBpbXBvcnQlMjBEb2N1bWVudCUwQSUwQSUyMyUyMExvYWQlMjB0aGUlMjBkYXRhc2V0JTBBZ3Vlc3RfZGF0YXNldCUyMCUzRCUyMGRhdGFzZXRzLmxvYWRfZGF0YXNldCglMjJhZ2VudHMtY291cnNlJTJGdW5pdDMtaW52aXRlZXMlMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQSUwQSUyMyUyMENvbnZlcnQlMjBkYXRhc2V0JTIwZW50cmllcyUyMGludG8lMjBEb2N1bWVudCUyMG9iamVjdHMlMEFkb2NzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwRG9jdW1lbnQoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdGV4dCUzRCUyMiU1Q24lMjIuam9pbiglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmJTIyTmFtZSUzQSUyMCU3Qmd1ZXN0X2RhdGFzZXQlNUInbmFtZSclNUQlNUJpJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMlJlbGF0aW9uJTNBJTIwJTdCZ3Vlc3RfZGF0YXNldCU1QidyZWxhdGlvbiclNUQlNUJpJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkRlc2NyaXB0aW9uJTNBJTIwJTdCZ3Vlc3RfZGF0YXNldCU1QidkZXNjcmlwdGlvbiclNUQlNUJpJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkVtYWlsJTNBJTIwJTdCZ3Vlc3RfZGF0YXNldCU1QidlbWFpbCclNUQlNUJpJTVEJTdEJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldGFkYXRhJTNEJTdCJTIybmFtZSUyMiUzQSUyMGd1ZXN0X2RhdGFzZXQlNUInbmFtZSclNUQlNUJpJTVEJTdEJTBBJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMGZvciUyMGklMjBpbiUyMHJhbmdlKGxlbihndWVzdF9kYXRhc2V0KSklMEElNUQ=",highlighted:`<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">from</span> llama_index.core.schema <span class="hljs-keyword">import</span> Document

<span class="hljs-comment"># Load the dataset</span>
guest_dataset = datasets.load_dataset(<span class="hljs-string">&quot;agents-course/unit3-invitees&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)

<span class="hljs-comment"># Convert dataset entries into Document objects</span>
docs = [
    Document(
        text=<span class="hljs-string">&quot;\\n&quot;</span>.join([
            <span class="hljs-string">f&quot;Name: <span class="hljs-subst">{guest_dataset[<span class="hljs-string">&#x27;name&#x27;</span>][i]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Relation: <span class="hljs-subst">{guest_dataset[<span class="hljs-string">&#x27;relation&#x27;</span>][i]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Description: <span class="hljs-subst">{guest_dataset[<span class="hljs-string">&#x27;description&#x27;</span>][i]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Email: <span class="hljs-subst">{guest_dataset[<span class="hljs-string">&#x27;email&#x27;</span>][i]}</span>&quot;</span>
        ]),
        metadata={<span class="hljs-string">&quot;name&quot;</span>: guest_dataset[<span class="hljs-string">&#x27;name&#x27;</span>][i]}
    )
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-built_in">len</span>(guest_dataset))
]`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment)},l(o){a=h(o,"P",{"data-svelte-h":!0}),y(a)!=="svelte-ag3ykm"&&(a.innerHTML=u),c=m(o),I(M.$$.fragment,o)},m(o,n){l(o,a,n),l(o,c,n),g(M,o,n),p=!0},p:_,i(o){p||(b(M.$$.fragment,o),p=!0)},o(o){Z(M.$$.fragment,o),p=!1},d(o){o&&(s(a),s(c)),$(M,o)}}}function cs(C){let a,u="We will use the Hugging Face <code>datasets</code> library to load the dataset and convert it into a list of <code>Document</code> objects from the <code>langchain.docstore.document</code> module.",c,M,p;return M=new W({props:{code:"aW1wb3J0JTIwZGF0YXNldHMlMEFmcm9tJTIwbGFuZ2NoYWluLmRvY3N0b3JlLmRvY3VtZW50JTIwaW1wb3J0JTIwRG9jdW1lbnQlMEElMEElMjMlMjBMb2FkJTIwdGhlJTIwZGF0YXNldCUwQWd1ZXN0X2RhdGFzZXQlMjAlM0QlMjBkYXRhc2V0cy5sb2FkX2RhdGFzZXQoJTIyYWdlbnRzLWNvdXJzZSUyRnVuaXQzLWludml0ZWVzJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiklMEElMEElMjMlMjBDb252ZXJ0JTIwZGF0YXNldCUyMGVudHJpZXMlMjBpbnRvJTIwRG9jdW1lbnQlMjBvYmplY3RzJTBBZG9jcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMERvY3VtZW50KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHBhZ2VfY29udGVudCUzRCUyMiU1Q24lMjIuam9pbiglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBmJTIyTmFtZSUzQSUyMCU3Qmd1ZXN0JTVCJ25hbWUnJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMlJlbGF0aW9uJTNBJTIwJTdCZ3Vlc3QlNUIncmVsYXRpb24nJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkRlc2NyaXB0aW9uJTNBJTIwJTdCZ3Vlc3QlNUInZGVzY3JpcHRpb24nJTVEJTdEJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZiUyMkVtYWlsJTNBJTIwJTdCZ3Vlc3QlNUInZW1haWwnJTVEJTdEJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVEKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG1ldGFkYXRhJTNEJTdCJTIybmFtZSUyMiUzQSUyMGd1ZXN0JTVCJTIybmFtZSUyMiU1RCU3RCUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjBmb3IlMjBndWVzdCUyMGluJTIwZ3Vlc3RfZGF0YXNldCUwQSU1RA==",highlighted:`<span class="hljs-keyword">import</span> datasets
<span class="hljs-keyword">from</span> langchain.docstore.document <span class="hljs-keyword">import</span> Document

<span class="hljs-comment"># Load the dataset</span>
guest_dataset = datasets.load_dataset(<span class="hljs-string">&quot;agents-course/unit3-invitees&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)

<span class="hljs-comment"># Convert dataset entries into Document objects</span>
docs = [
    Document(
        page_content=<span class="hljs-string">&quot;\\n&quot;</span>.join([
            <span class="hljs-string">f&quot;Name: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;name&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Relation: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;relation&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Description: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;description&#x27;</span>]}</span>&quot;</span>,
            <span class="hljs-string">f&quot;Email: <span class="hljs-subst">{guest[<span class="hljs-string">&#x27;email&#x27;</span>]}</span>&quot;</span>
        ]),
        metadata={<span class="hljs-string">&quot;name&quot;</span>: guest[<span class="hljs-string">&quot;name&quot;</span>]}
    )
    <span class="hljs-keyword">for</span> guest <span class="hljs-keyword">in</span> guest_dataset
]`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment)},l(o){a=h(o,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1vrqwzz"&&(a.innerHTML=u),c=m(o),I(M.$$.fragment,o)},m(o,n){l(o,a,n),l(o,c,n),g(M,o,n),p=!0},p:_,i(o){p||(b(M.$$.fragment,o),p=!0)},o(o){Z(M.$$.fragment,o),p=!1},d(o){o&&(s(a),s(c)),$(M,o)}}}function Ms(C){let a,u,c,M,p,o;return a=new Q({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[rs]},$$scope:{ctx:C}}}),c=new Q({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[ps]},$$scope:{ctx:C}}}),p=new Q({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[cs]},$$scope:{ctx:C}}}),{c(){U(a.$$.fragment),u=d(),U(c.$$.fragment),M=d(),U(p.$$.fragment)},l(n){I(a.$$.fragment,n),u=m(n),I(c.$$.fragment,n),M=m(n),I(p.$$.fragment,n)},m(n,i){g(a,n,i),l(n,u,i),g(c,n,i),l(n,M,i),g(p,n,i),o=!0},p(n,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:n}),a.$set(f);const j={};i&2&&(j.$$scope={dirty:i,ctx:n}),c.$set(j);const w={};i&2&&(w.$$scope={dirty:i,ctx:n}),p.$set(w)},i(n){o||(b(a.$$.fragment,n),b(c.$$.fragment,n),b(p.$$.fragment,n),o=!0)},o(n){Z(a.$$.fragment,n),Z(c.$$.fragment,n),Z(p.$$.fragment,n),o=!1},d(n){n&&(s(u),s(M)),$(a,n),$(c,n),$(p,n)}}}function us(C){let a,u,c="BM25Retriever",M,p,o="sentence-transformers",n;return{c(){a=R("The "),u=T("code"),u.textContent=c,M=R(" is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=T("a"),p.textContent=o,n=R("."),this.h()},l(i){a=x(i,"The "),u=h(i,"CODE",{"data-svelte-h":!0}),y(u)!=="svelte-13pi4gc"&&(u.textContent=c),M=x(i," is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=h(i,"A",{href:!0,"data-svelte-h":!0}),y(p)!=="svelte-8vrx36"&&(p.textContent=o),n=x(i,"."),this.h()},h(){G(p,"href","https://www.sbert.net/")},m(i,f){l(i,a,f),l(i,u,f),l(i,M,f),l(i,p,f),l(i,n,f)},p:_,d(i){i&&(s(a),s(u),s(M),s(p),s(n))}}}function ds(C){let a,u="We will use the <code>BM25Retriever</code> from the <code>langchain_community.retrievers</code> module to create a retriever tool.",c,M,p,o,n,i,f="Let’s understand this tool step-by-step:",j,w,v="<li>The <code>name</code> and <code>description</code> help the agent understand when and how to use this tool</li> <li>The <code>inputs</code> define what parameters the tool expects (in this case, a search query)</li> <li>We’re using a <code>BM25Retriever</code>, which is a powerful text retrieval algorithm that doesn’t require embeddings</li> <li>The <code>forward</code> method processes the query and returns the most relevant guest information</li>",B;return M=new $e({props:{$$slots:{default:[us]},$$scope:{ctx:C}}}),o=new W({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkucmV0cmlldmVycyUyMGltcG9ydCUyMEJNMjVSZXRyaWV2ZXIlMEElMEFjbGFzcyUyMEd1ZXN0SW5mb1JldHJpZXZlclRvb2woVG9vbCklM0ElMEElMjAlMjAlMjAlMjBuYW1lJTIwJTNEJTIwJTIyZ3Vlc3RfaW5mb19yZXRyaWV2ZXIlMjIlMEElMjAlMjAlMjAlMjBkZXNjcmlwdGlvbiUyMCUzRCUyMCUyMlJldHJpZXZlcyUyMGRldGFpbGVkJTIwaW5mb3JtYXRpb24lMjBhYm91dCUyMGdhbGElMjBndWVzdHMlMjBiYXNlZCUyMG9uJTIwdGhlaXIlMjBuYW1lJTIwb3IlMjByZWxhdGlvbi4lMjIlMEElMjAlMjAlMjAlMjBpbnB1dHMlMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJxdWVyeSUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJzdHJpbmclMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJkZXNjcmlwdGlvbiUyMiUzQSUyMCUyMlRoZSUyMG5hbWUlMjBvciUyMHJlbGF0aW9uJTIwb2YlMjB0aGUlMjBndWVzdCUyMHlvdSUyMHdhbnQlMjBpbmZvcm1hdGlvbiUyMGFib3V0LiUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTIwJTNEJTIwJTIyc3RyaW5nJTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMGRvY3MpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5pc19pbml0aWFsaXplZCUyMCUzRCUyMEZhbHNlJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwc2VsZi5yZXRyaWV2ZXIlMjAlM0QlMjBCTTI1UmV0cmlldmVyLmZyb21fZG9jdW1lbnRzKGRvY3MpJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIwcXVlcnklM0ElMjBzdHIpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzdWx0cyUyMCUzRCUyMHNlbGYucmV0cmlldmVyLmdldF9yZWxldmFudF9kb2N1bWVudHMocXVlcnkpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaWYlMjByZXN1bHRzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyJTVDbiU1Q24lMjIuam9pbiglNUJkb2MucGFnZV9jb250ZW50JTIwZm9yJTIwZG9jJTIwaW4lMjByZXN1bHRzJTVCJTNBMyU1RCU1RCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBlbHNlJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyTm8lMjBtYXRjaGluZyUyMGd1ZXN0JTIwaW5mb3JtYXRpb24lMjBmb3VuZC4lMjIlMEElMEElMjMlMjBJbml0aWFsaXplJTIwdGhlJTIwdG9vbCUwQWd1ZXN0X2luZm9fdG9vbCUyMCUzRCUyMEd1ZXN0SW5mb1JldHJpZXZlclRvb2woZG9jcyk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Tool
<span class="hljs-keyword">from</span> langchain_community.retrievers <span class="hljs-keyword">import</span> BM25Retriever

<span class="hljs-keyword">class</span> <span class="hljs-title class_">GuestInfoRetrieverTool</span>(<span class="hljs-title class_ inherited__">Tool</span>):
    name = <span class="hljs-string">&quot;guest_info_retriever&quot;</span>
    description = <span class="hljs-string">&quot;Retrieves detailed information about gala guests based on their name or relation.&quot;</span>
    inputs = {
        <span class="hljs-string">&quot;query&quot;</span>: {
            <span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>,
            <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;The name or relation of the guest you want information about.&quot;</span>
        }
    }
    output_type = <span class="hljs-string">&quot;string&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, docs</span>):
        self.is_initialized = <span class="hljs-literal">False</span>
        self.retriever = BM25Retriever.from_documents(docs)

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, query: <span class="hljs-built_in">str</span></span>):
        results = self.retriever.get_relevant_documents(query)
        <span class="hljs-keyword">if</span> results:
            <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;\\n\\n&quot;</span>.join([doc.page_content <span class="hljs-keyword">for</span> doc <span class="hljs-keyword">in</span> results[:<span class="hljs-number">3</span>]])
        <span class="hljs-keyword">else</span>:
            <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;No matching guest information found.&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
guest_info_tool = GuestInfoRetrieverTool(docs)`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment),p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){a=h(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1weris3"&&(a.innerHTML=u),c=m(t),I(M.$$.fragment,t),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-xficc2"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-14ztz3k"&&(w.innerHTML=v)},m(t,J){l(t,a,J),l(t,c,J),g(M,t,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p(t,J){const k={};J&2&&(k.$$scope={dirty:J,ctx:t}),M.$set(k)},i(t){B||(b(M.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(M.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(a),s(c),s(p),s(n),s(i),s(j),s(w)),$(M,t),$(o,t)}}}function ms(C){let a,u,c="BM25Retriever",M,p,o="sentence-transformers",n;return{c(){a=R("The "),u=T("code"),u.textContent=c,M=R(" is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=T("a"),p.textContent=o,n=R("."),this.h()},l(i){a=x(i,"The "),u=h(i,"CODE",{"data-svelte-h":!0}),y(u)!=="svelte-13pi4gc"&&(u.textContent=c),M=x(i," is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=h(i,"A",{href:!0,"data-svelte-h":!0}),y(p)!=="svelte-8vrx36"&&(p.textContent=o),n=x(i,"."),this.h()},h(){G(p,"href","https://www.sbert.net/")},m(i,f){l(i,a,f),l(i,u,f),l(i,M,f),l(i,p,f),l(i,n,f)},p:_,d(i){i&&(s(a),s(u),s(M),s(p),s(n))}}}function Js(C){let a,u="We will use the <code>BM25Retriever</code> from the <code>llama_index.retrievers.bm25</code> module to create a retriever tool.",c,M,p,o,n,i,f="Let’s understand this tool step-by-step.",j,w,v="<li>The docstring helps the agent understand when and how to use this tool</li> <li>The type decorators define what parameters the tool expects (in this case, a search query)</li> <li>We’re using a <code>BM25Retriever</code>, which is a powerful text retrieval algorithm that doesn’t require embeddings</li> <li>The method processes the query and returns the most relevant guest information</li>",B;return M=new $e({props:{$$slots:{default:[ms]},$$scope:{ctx:C}}}),o=new W({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEFmcm9tJTIwbGxhbWFfaW5kZXgucmV0cmlldmVycy5ibTI1JTIwaW1wb3J0JTIwQk0yNVJldHJpZXZlciUwQSUwQWJtMjVfcmV0cmlldmVyJTIwJTNEJTIwQk0yNVJldHJpZXZlci5mcm9tX2RlZmF1bHRzKG5vZGVzJTNEZG9jcyklMEElMEFkZWYlMjBnZXRfZ3Vlc3RfaW5mb19yZXRyaWV2ZXIocXVlcnklM0ElMjBzdHIpJTIwLSUzRSUyMHN0ciUzQSUwQSUyMCUyMCUyMCUyMCUyMiUyMiUyMlJldHJpZXZlcyUyMGRldGFpbGVkJTIwaW5mb3JtYXRpb24lMjBhYm91dCUyMGdhbGElMjBndWVzdHMlMjBiYXNlZCUyMG9uJTIwdGhlaXIlMjBuYW1lJTIwb3IlMjByZWxhdGlvbi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjByZXN1bHRzJTIwJTNEJTIwYm0yNV9yZXRyaWV2ZXIucmV0cmlldmUocXVlcnkpJTBBJTIwJTIwJTIwJTIwaWYlMjByZXN1bHRzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyJTVDbiU1Q24lMjIuam9pbiglNUJkb2MudGV4dCUyMGZvciUyMGRvYyUyMGluJTIwcmVzdWx0cyU1QiUzQTMlNUQlNUQpJTBBJTIwJTIwJTIwJTIwZWxzZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCUyMk5vJTIwbWF0Y2hpbmclMjBndWVzdCUyMGluZm9ybWF0aW9uJTIwZm91bmQuJTIyJTBBJTBBJTIzJTIwSW5pdGlhbGl6ZSUyMHRoZSUyMHRvb2wlMEFndWVzdF9pbmZvX3Rvb2wlMjAlM0QlMjBGdW5jdGlvblRvb2wuZnJvbV9kZWZhdWx0cyhnZXRfZ3Vlc3RfaW5mb19yZXRyaWV2ZXIp",highlighted:`<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> FunctionTool
<span class="hljs-keyword">from</span> llama_index.retrievers.bm25 <span class="hljs-keyword">import</span> BM25Retriever

bm25_retriever = BM25Retriever.from_defaults(nodes=docs)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_guest_info_retriever</span>(<span class="hljs-params">query: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Retrieves detailed information about gala guests based on their name or relation.&quot;&quot;&quot;</span>
    results = bm25_retriever.retrieve(query)
    <span class="hljs-keyword">if</span> results:
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;\\n\\n&quot;</span>.join([doc.text <span class="hljs-keyword">for</span> doc <span class="hljs-keyword">in</span> results[:<span class="hljs-number">3</span>]])
    <span class="hljs-keyword">else</span>:
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;No matching guest information found.&quot;</span>

<span class="hljs-comment"># Initialize the tool</span>
guest_info_tool = FunctionTool.from_defaults(get_guest_info_retriever)`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment),p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){a=h(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1li0cac"&&(a.innerHTML=u),c=m(t),I(M.$$.fragment,t),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-5xdv72"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-1grz3gg"&&(w.innerHTML=v)},m(t,J){l(t,a,J),l(t,c,J),g(M,t,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p(t,J){const k={};J&2&&(k.$$scope={dirty:J,ctx:t}),M.$set(k)},i(t){B||(b(M.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(M.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(a),s(c),s(p),s(n),s(i),s(j),s(w)),$(M,t),$(o,t)}}}function ws(C){let a,u,c="BM25Retriever",M,p,o="sentence-transformers",n;return{c(){a=R("The "),u=T("code"),u.textContent=c,M=R(" is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=T("a"),p.textContent=o,n=R("."),this.h()},l(i){a=x(i,"The "),u=h(i,"CODE",{"data-svelte-h":!0}),y(u)!=="svelte-13pi4gc"&&(u.textContent=c),M=x(i," is a great starting point for retrieval, but for more advanced semantic search, you might consider using embedding-based retrievers like those from "),p=h(i,"A",{href:!0,"data-svelte-h":!0}),y(p)!=="svelte-8vrx36"&&(p.textContent=o),n=x(i,"."),this.h()},h(){G(p,"href","https://www.sbert.net/")},m(i,f){l(i,a,f),l(i,u,f),l(i,M,f),l(i,p,f),l(i,n,f)},p:_,d(i){i&&(s(a),s(u),s(M),s(p),s(n))}}}function Ts(C){let a,u="We will use the <code>BM25Retriever</code> from the <code>langchain_community.retrievers</code> module to create a retriever tool.",c,M,p,o,n,i,f="Let’s understand this tool step-by-step.",j,w,v="<li>The <code>name</code> and <code>description</code> help the agent understand when and how to use this tool</li> <li>The type decorators define what parameters the tool expects (in this case, a search query)</li> <li>We’re using a <code>BM25Retriever</code>, which is a powerful text retrieval algorithm that doesn’t require embeddings</li> <li>The method processes the query and returns the most relevant guest information</li>",B;return M=new $e({props:{$$slots:{default:[ws]},$$scope:{ctx:C}}}),o=new W({props:{code:"ZnJvbSUyMGxhbmdjaGFpbl9jb21tdW5pdHkucmV0cmlldmVycyUyMGltcG9ydCUyMEJNMjVSZXRyaWV2ZXIlMEFmcm9tJTIwbGFuZ2NoYWluLnRvb2xzJTIwaW1wb3J0JTIwVG9vbCUwQSUwQWJtMjVfcmV0cmlldmVyJTIwJTNEJTIwQk0yNVJldHJpZXZlci5mcm9tX2RvY3VtZW50cyhkb2NzKSUwQSUwQWRlZiUyMGV4dHJhY3RfdGV4dChxdWVyeSUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyUmV0cmlldmVzJTIwZGV0YWlsZWQlMjBpbmZvcm1hdGlvbiUyMGFib3V0JTIwZ2FsYSUyMGd1ZXN0cyUyMGJhc2VkJTIwb24lMjB0aGVpciUyMG5hbWUlMjBvciUyMHJlbGF0aW9uLiUyMiUyMiUyMiUwQSUyMCUyMCUyMCUyMHJlc3VsdHMlMjAlM0QlMjBibTI1X3JldHJpZXZlci5pbnZva2UocXVlcnkpJTBBJTIwJTIwJTIwJTIwaWYlMjByZXN1bHRzJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyJTVDbiU1Q24lMjIuam9pbiglNUJkb2MucGFnZV9jb250ZW50JTIwZm9yJTIwZG9jJTIwaW4lMjByZXN1bHRzJTVCJTNBMyU1RCU1RCklMEElMjAlMjAlMjAlMjBlbHNlJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyTm8lMjBtYXRjaGluZyUyMGd1ZXN0JTIwaW5mb3JtYXRpb24lMjBmb3VuZC4lMjIlMEElMEFndWVzdF9pbmZvX3Rvb2wlMjAlM0QlMjBUb29sKCUwQSUyMCUyMCUyMCUyMG5hbWUlM0QlMjJndWVzdF9pbmZvX3JldHJpZXZlciUyMiUyQyUwQSUyMCUyMCUyMCUyMGZ1bmMlM0RleHRyYWN0X3RleHQlMkMlMEElMjAlMjAlMjAlMjBkZXNjcmlwdGlvbiUzRCUyMlJldHJpZXZlcyUyMGRldGFpbGVkJTIwaW5mb3JtYXRpb24lMjBhYm91dCUyMGdhbGElMjBndWVzdHMlMjBiYXNlZCUyMG9uJTIwdGhlaXIlMjBuYW1lJTIwb3IlMjByZWxhdGlvbi4lMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> langchain_community.retrievers <span class="hljs-keyword">import</span> BM25Retriever
<span class="hljs-keyword">from</span> langchain.tools <span class="hljs-keyword">import</span> Tool

bm25_retriever = BM25Retriever.from_documents(docs)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">extract_text</span>(<span class="hljs-params">query: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;Retrieves detailed information about gala guests based on their name or relation.&quot;&quot;&quot;</span>
    results = bm25_retriever.invoke(query)
    <span class="hljs-keyword">if</span> results:
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;\\n\\n&quot;</span>.join([doc.page_content <span class="hljs-keyword">for</span> doc <span class="hljs-keyword">in</span> results[:<span class="hljs-number">3</span>]])
    <span class="hljs-keyword">else</span>:
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;No matching guest information found.&quot;</span>

guest_info_tool = Tool(
    name=<span class="hljs-string">&quot;guest_info_retriever&quot;</span>,
    func=extract_text,
    description=<span class="hljs-string">&quot;Retrieves detailed information about gala guests based on their name or relation.&quot;</span>
)`,wrap:!1}}),{c(){a=T("p"),a.innerHTML=u,c=d(),U(M.$$.fragment),p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){a=h(t,"P",{"data-svelte-h":!0}),y(a)!=="svelte-1weris3"&&(a.innerHTML=u),c=m(t),I(M.$$.fragment,t),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-5xdv72"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-95yww2"&&(w.innerHTML=v)},m(t,J){l(t,a,J),l(t,c,J),g(M,t,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p(t,J){const k={};J&2&&(k.$$scope={dirty:J,ctx:t}),M.$set(k)},i(t){B||(b(M.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(M.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(a),s(c),s(p),s(n),s(i),s(j),s(w)),$(M,t),$(o,t)}}}function hs(C){let a,u,c,M,p,o;return a=new Q({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ds]},$$scope:{ctx:C}}}),c=new Q({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[Js]},$$scope:{ctx:C}}}),p=new Q({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[Ts]},$$scope:{ctx:C}}}),{c(){U(a.$$.fragment),u=d(),U(c.$$.fragment),M=d(),U(p.$$.fragment)},l(n){I(a.$$.fragment,n),u=m(n),I(c.$$.fragment,n),M=m(n),I(p.$$.fragment,n)},m(n,i){g(a,n,i),l(n,u,i),g(c,n,i),l(n,M,i),g(p,n,i),o=!0},p(n,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:n}),a.$set(f);const j={};i&2&&(j.$$scope={dirty:i,ctx:n}),c.$set(j);const w={};i&2&&(w.$$scope={dirty:i,ctx:n}),p.$set(w)},i(n){o||(b(a.$$.fragment,n),b(c.$$.fragment,n),b(p.$$.fragment,n),o=!0)},o(n){Z(a.$$.fragment,n),Z(c.$$.fragment,n),Z(p.$$.fragment,n),o=!1},d(n){n&&(s(u),s(M)),$(a,n),$(c,n),$(p,n)}}}function ys(C){let a,u,c,M="Expected output:",p,o,n,i,f="What’s happening in this final step:",j,w,v="<li>We initialize a Hugging Face model using the <code>InferenceClientModel</code> class</li> <li>We create our agent (Alfred) as a <code>CodeAgent</code>, which can execute Python code to solve problems</li> <li>We ask Alfred to retrieve information about a guest named “Lady Ada Lovelace”</li>",B;return a=new W({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBIdWdnaW5nJTIwRmFjZSUyMG1vZGVsJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBJTBBJTIzJTIwQ3JlYXRlJTIwQWxmcmVkJTJDJTIwb3VyJTIwZ2FsYSUyMGFnZW50JTJDJTIwd2l0aCUyMHRoZSUyMGd1ZXN0JTIwaW5mbyUyMHRvb2wlMEFhbGZyZWQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUJndWVzdF9pbmZvX3Rvb2wlNUQlMkMlMjBtb2RlbCUzRG1vZGVsKSUwQSUwQSUyMyUyMEV4YW1wbGUlMjBxdWVyeSUyMEFsZnJlZCUyMG1pZ2h0JTIwcmVjZWl2ZSUyMGR1cmluZyUyMHRoZSUyMGdhbGElMEFyZXNwb25zZSUyMCUzRCUyMGFsZnJlZC5ydW4oJTIyVGVsbCUyMG1lJTIwYWJvdXQlMjBvdXIlMjBndWVzdCUyMG5hbWVkJTIwJ0xhZHklMjBBZGElMjBMb3ZlbGFjZScuJTIyKSUwQSUwQXByaW50KCUyMiVGMCU5RiU4RSVBOSUyMEFsZnJlZCdzJTIwUmVzcG9uc2UlM0ElMjIpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

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

<span class="hljs-comment"># Create Alfred, our gala agent, with the guest info tool</span>
alfred = CodeAgent(tools=[guest_info_tool], model=model)

<span class="hljs-comment"># Example query Alfred might receive during the gala</span>
response = alfred.run(<span class="hljs-string">&quot;Tell me about our guest named &#x27;Lady Ada Lovelace&#x27;.&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),o=new W({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUJhc2VkJTIwb24lMjB0aGUlMjBpbmZvcm1hdGlvbiUyMEklMjByZXRyaWV2ZWQlMkMlMjBMYWR5JTIwQWRhJTIwTG92ZWxhY2UlMjBpcyUyMGFuJTIwZXN0ZWVtZWQlMjBtYXRoZW1hdGljaWFuJTIwYW5kJTIwZnJpZW5kLiUyMFNoZSUyMGlzJTIwcmVub3duZWQlMjBmb3IlMjBoZXIlMjBwaW9uZWVyaW5nJTIwd29yayUyMGluJTIwbWF0aGVtYXRpY3MlMjBhbmQlMjBjb21wdXRpbmclMkMlMjBvZnRlbiUyMGNlbGVicmF0ZWQlMjBhcyUyMHRoZSUyMGZpcnN0JTIwY29tcHV0ZXIlMjBwcm9ncmFtbWVyJTIwZHVlJTIwdG8lMjBoZXIlMjB3b3JrJTIwb24lMjBDaGFybGVzJTIwQmFiYmFnZSdzJTIwQW5hbHl0aWNhbCUyMEVuZ2luZS4lMjBIZXIlMjBlbWFpbCUyMGFkZHJlc3MlMjBpcyUyMGFkYS5sb3ZlbGFjZSU0MGV4YW1wbGUuY29tLg==",highlighted:`🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>
Based <span class="hljs-keyword">on</span> the information I retrieved, Lady Ada Lovelace <span class="hljs-built_in">is</span> an esteemed mathematician <span class="hljs-built_in">and</span> <span class="hljs-keyword">friend</span>. She <span class="hljs-built_in">is</span> renowned <span class="hljs-keyword">for</span> her pioneering work <span class="hljs-keyword">in</span> mathematics <span class="hljs-built_in">and</span> computing, often celebrated <span class="hljs-keyword">as</span> the first computer programmer due <span class="hljs-keyword">to</span> her work <span class="hljs-keyword">on</span> Charles Babbage<span class="hljs-comment">&#x27;s Analytical Engine. Her email address is ada.lovelace@example.com.</span>`,wrap:!1}}),{c(){U(a.$$.fragment),u=d(),c=T("p"),c.textContent=M,p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){I(a.$$.fragment,t),u=m(t),c=h(t,"P",{"data-svelte-h":!0}),y(c)!=="svelte-15t3xg7"&&(c.textContent=M),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-18avn85"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-1mwulne"&&(w.innerHTML=v)},m(t,J){g(a,t,J),l(t,u,J),l(t,c,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p:_,i(t){B||(b(a.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(a.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(u),s(c),s(p),s(n),s(i),s(j),s(w)),$(a,t),$(o,t)}}}function fs(C){let a,u,c,M="Expected output:",p,o,n,i,f="What’s happening in this final step:",j,w,v="<li>We initialize a Hugging Face model using the <code>HuggingFaceInferenceAPI</code> class</li> <li>We create our agent (Alfred) as a <code>AgentWorkflow</code>, including the tool we just created</li> <li>We ask Alfred to retrieve information about a guest named “Lady Ada Lovelace”</li>",B;return a=new W({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUuYWdlbnQud29ya2Zsb3clMjBpbXBvcnQlMjBBZ2VudFdvcmtmbG93JTBBZnJvbSUyMGxsYW1hX2luZGV4LmxsbXMuaHVnZ2luZ2ZhY2VfYXBpJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEklMEElMEElMjMlMjBJbml0aWFsaXplJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBtb2RlbCUwQWxsbSUyMCUzRCUyMEh1Z2dpbmdGYWNlSW5mZXJlbmNlQVBJKG1vZGVsX25hbWUlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIpJTBBJTBBJTIzJTIwQ3JlYXRlJTIwQWxmcmVkJTJDJTIwb3VyJTIwZ2FsYSUyMGFnZW50JTJDJTIwd2l0aCUyMHRoZSUyMGd1ZXN0JTIwaW5mbyUyMHRvb2wlMEFhbGZyZWQlMjAlM0QlMjBBZ2VudFdvcmtmbG93LmZyb21fdG9vbHNfb3JfZnVuY3Rpb25zKCUwQSUyMCUyMCUyMCUyMCU1Qmd1ZXN0X2luZm9fdG9vbCU1RCUyQyUwQSUyMCUyMCUyMCUyMGxsbSUzRGxsbSUyQyUwQSklMEElMEElMjMlMjBFeGFtcGxlJTIwcXVlcnklMjBBbGZyZWQlMjBtaWdodCUyMHJlY2VpdmUlMjBkdXJpbmclMjB0aGUlMjBnYWxhJTBBcmVzcG9uc2UlMjAlM0QlMjBhd2FpdCUyMGFsZnJlZC5ydW4oJTIyVGVsbCUyMG1lJTIwYWJvdXQlMjBvdXIlMjBndWVzdCUyMG5hbWVkJTIwJ0xhZHklMjBBZGElMjBMb3ZlbGFjZScuJTIyKSUwQSUwQXByaW50KCUyMiVGMCU5RiU4RSVBOSUyMEFsZnJlZCdzJTIwUmVzcG9uc2UlM0ElMjIpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-keyword">from</span> llama_index.core.agent.workflow <span class="hljs-keyword">import</span> AgentWorkflow
<span class="hljs-keyword">from</span> llama_index.llms.huggingface_api <span class="hljs-keyword">import</span> HuggingFaceInferenceAPI

<span class="hljs-comment"># Initialize the Hugging Face model</span>
llm = HuggingFaceInferenceAPI(model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>)

<span class="hljs-comment"># Create Alfred, our gala agent, with the guest info tool</span>
alfred = AgentWorkflow.from_tools_or_functions(
    [guest_info_tool],
    llm=llm,
)

<span class="hljs-comment"># Example query Alfred might receive during the gala</span>
response = <span class="hljs-keyword">await</span> alfred.run(<span class="hljs-string">&quot;Tell me about our guest named &#x27;Lady Ada Lovelace&#x27;.&quot;</span>)

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response)`,wrap:!1}}),o=new W({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUxhZHklMjBBZGElMjBMb3ZlbGFjZSUyMGlzJTIwYW4lMjBlc3RlZW1lZCUyMG1hdGhlbWF0aWNpYW4lMjBhbmQlMjBmcmllbmQlMkMlMjByZW5vd25lZCUyMGZvciUyMGhlciUyMHBpb25lZXJpbmclMjB3b3JrJTIwaW4lMjBtYXRoZW1hdGljcyUyMGFuZCUyMGNvbXB1dGluZy4lMjBTaGUlMjBpcyUyMGNlbGVicmF0ZWQlMjBhcyUyMHRoZSUyMGZpcnN0JTIwY29tcHV0ZXIlMjBwcm9ncmFtbWVyJTIwZHVlJTIwdG8lMjBoZXIlMjB3b3JrJTIwb24lMjBDaGFybGVzJTIwQmFiYmFnZSdzJTIwQW5hbHl0aWNhbCUyMEVuZ2luZS4lMjBIZXIlMjBlbWFpbCUyMGlzJTIwYWRhLmxvdmVsYWNlJTQwZXhhbXBsZS5jb20u",highlighted:`🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>
Lady Ada Lovelace <span class="hljs-built_in">is</span> an esteemed mathematician <span class="hljs-built_in">and</span> <span class="hljs-keyword">friend</span>, renowned <span class="hljs-keyword">for</span> her pioneering work <span class="hljs-keyword">in</span> mathematics <span class="hljs-built_in">and</span> computing. She <span class="hljs-built_in">is</span> celebrated <span class="hljs-keyword">as</span> the first computer programmer due <span class="hljs-keyword">to</span> her work <span class="hljs-keyword">on</span> Charles Babbage<span class="hljs-comment">&#x27;s Analytical Engine. Her email is ada.lovelace@example.com.</span>`,wrap:!1}}),{c(){U(a.$$.fragment),u=d(),c=T("p"),c.textContent=M,p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){I(a.$$.fragment,t),u=m(t),c=h(t,"P",{"data-svelte-h":!0}),y(c)!=="svelte-15t3xg7"&&(c.textContent=M),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-18avn85"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-1xe3pcb"&&(w.innerHTML=v)},m(t,J){g(a,t,J),l(t,u,J),l(t,c,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p:_,i(t){B||(b(a.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(a.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(u),s(c),s(p),s(n),s(i),s(j),s(w)),$(a,t),$(o,t)}}}function js(C){let a,u,c,M="Expected output:",p,o,n,i,f="What’s happening in this final step:",j,w,v="<li>We initialize a Hugging Face model using the <code>HuggingFaceEndpoint</code> class. We also generate a chat interface and append the tools.</li> <li>We create our agent (Alfred) as a <code>StateGraph</code>, that combines 2 nodes (<code>assistant</code>, <code>tools</code>) using an edge</li> <li>We ask Alfred to retrieve information about a guest named “Lady Ada Lovelace”</li>",B;return a=new W({props:{code:"ZnJvbSUyMHR5cGluZyUyMGltcG9ydCUyMFR5cGVkRGljdCUyQyUyMEFubm90YXRlZCUwQWZyb20lMjBsYW5nZ3JhcGguZ3JhcGgubWVzc2FnZSUyMGltcG9ydCUyMGFkZF9tZXNzYWdlcyUwQWZyb20lMjBsYW5nY2hhaW5fY29yZS5tZXNzYWdlcyUyMGltcG9ydCUyMEFueU1lc3NhZ2UlMkMlMjBIdW1hbk1lc3NhZ2UlMkMlMjBBSU1lc3NhZ2UlMEFmcm9tJTIwbGFuZ2dyYXBoLnByZWJ1aWx0JTIwaW1wb3J0JTIwVG9vbE5vZGUlMEFmcm9tJTIwbGFuZ2dyYXBoLmdyYXBoJTIwaW1wb3J0JTIwU1RBUlQlMkMlMjBTdGF0ZUdyYXBoJTBBZnJvbSUyMGxhbmdncmFwaC5wcmVidWlsdCUyMGltcG9ydCUyMHRvb2xzX2NvbmRpdGlvbiUwQWZyb20lMjBsYW5nY2hhaW5faHVnZ2luZ2ZhY2UlMjBpbXBvcnQlMjBIdWdnaW5nRmFjZUVuZHBvaW50JTJDJTIwQ2hhdEh1Z2dpbmdGYWNlJTBBJTBBJTIzJTIwR2VuZXJhdGUlMjB0aGUlMjBjaGF0JTIwaW50ZXJmYWNlJTJDJTIwaW5jbHVkaW5nJTIwdGhlJTIwdG9vbHMlMEFsbG0lMjAlM0QlMjBIdWdnaW5nRmFjZUVuZHBvaW50KCUwQSUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBodWdnaW5nZmFjZWh1Yl9hcGlfdG9rZW4lM0RIVUdHSU5HRkFDRUhVQl9BUElfVE9LRU4lMkMlMEEpJTBBJTBBY2hhdCUyMCUzRCUyMENoYXRIdWdnaW5nRmFjZShsbG0lM0RsbG0lMkMlMjB2ZXJib3NlJTNEVHJ1ZSklMEF0b29scyUyMCUzRCUyMCU1Qmd1ZXN0X2luZm9fdG9vbCU1RCUwQWNoYXRfd2l0aF90b29scyUyMCUzRCUyMGNoYXQuYmluZF90b29scyh0b29scyklMEElMEElMjMlMjBHZW5lcmF0ZSUyMHRoZSUyMEFnZW50U3RhdGUlMjBhbmQlMjBBZ2VudCUyMGdyYXBoJTBBY2xhc3MlMjBBZ2VudFN0YXRlKFR5cGVkRGljdCklM0ElMEElMjAlMjAlMjAlMjBtZXNzYWdlcyUzQSUyMEFubm90YXRlZCU1Qmxpc3QlNUJBbnlNZXNzYWdlJTVEJTJDJTIwYWRkX21lc3NhZ2VzJTVEJTBBJTBBZGVmJTIwYXNzaXN0YW50KHN0YXRlJTNBJTIwQWdlbnRTdGF0ZSklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtZXNzYWdlcyUyMiUzQSUyMCU1QmNoYXRfd2l0aF90b29scy5pbnZva2Uoc3RhdGUlNUIlMjJtZXNzYWdlcyUyMiU1RCklNUQlMkMlMEElMjAlMjAlMjAlMjAlN0QlMEElMEElMjMlMjMlMjBUaGUlMjBncmFwaCUwQWJ1aWxkZXIlMjAlM0QlMjBTdGF0ZUdyYXBoKEFnZW50U3RhdGUpJTBBJTBBJTIzJTIwRGVmaW5lJTIwbm9kZXMlM0ElMjB0aGVzZSUyMGRvJTIwdGhlJTIwd29yayUwQWJ1aWxkZXIuYWRkX25vZGUoJTIyYXNzaXN0YW50JTIyJTJDJTIwYXNzaXN0YW50KSUwQWJ1aWxkZXIuYWRkX25vZGUoJTIydG9vbHMlMjIlMkMlMjBUb29sTm9kZSh0b29scykpJTBBJTBBJTIzJTIwRGVmaW5lJTIwZWRnZXMlM0ElMjB0aGVzZSUyMGRldGVybWluZSUyMGhvdyUyMHRoZSUyMGNvbnRyb2wlMjBmbG93JTIwbW92ZXMlMEFidWlsZGVyLmFkZF9lZGdlKFNUQVJUJTJDJTIwJTIyYXNzaXN0YW50JTIyKSUwQWJ1aWxkZXIuYWRkX2NvbmRpdGlvbmFsX2VkZ2VzKCUwQSUyMCUyMCUyMCUyMCUyMmFzc2lzdGFudCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMyUyMElmJTIwdGhlJTIwbGF0ZXN0JTIwbWVzc2FnZSUyMHJlcXVpcmVzJTIwYSUyMHRvb2wlMkMlMjByb3V0ZSUyMHRvJTIwdG9vbHMlMEElMjAlMjAlMjAlMjAlMjMlMjBPdGhlcndpc2UlMkMlMjBwcm92aWRlJTIwYSUyMGRpcmVjdCUyMHJlc3BvbnNlJTBBJTIwJTIwJTIwJTIwdG9vbHNfY29uZGl0aW9uJTJDJTBBKSUwQWJ1aWxkZXIuYWRkX2VkZ2UoJTIydG9vbHMlMjIlMkMlMjAlMjJhc3Npc3RhbnQlMjIpJTBBYWxmcmVkJTIwJTNEJTIwYnVpbGRlci5jb21waWxlKCklMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1Qkh1bWFuTWVzc2FnZShjb250ZW50JTNEJTIyVGVsbCUyMG1lJTIwYWJvdXQlMjBvdXIlMjBndWVzdCUyMG5hbWVkJTIwJ0xhZHklMjBBZGElMjBMb3ZlbGFjZScuJTIyKSU1RCUwQXJlc3BvbnNlJTIwJTNEJTIwYWxmcmVkLmludm9rZSglN0IlMjJtZXNzYWdlcyUyMiUzQSUyMG1lc3NhZ2VzJTdEKSUwQSUwQXByaW50KCUyMiVGMCU5RiU4RSVBOSUyMEFsZnJlZCdzJTIwUmVzcG9uc2UlM0ElMjIpJTBBcHJpbnQocmVzcG9uc2UlNUInbWVzc2FnZXMnJTVEJTVCLTElNUQuY29udGVudCk=",highlighted:`<span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> TypedDict, Annotated
<span class="hljs-keyword">from</span> langgraph.graph.message <span class="hljs-keyword">import</span> add_messages
<span class="hljs-keyword">from</span> langchain_core.messages <span class="hljs-keyword">import</span> AnyMessage, HumanMessage, AIMessage
<span class="hljs-keyword">from</span> langgraph.prebuilt <span class="hljs-keyword">import</span> ToolNode
<span class="hljs-keyword">from</span> langgraph.graph <span class="hljs-keyword">import</span> START, StateGraph
<span class="hljs-keyword">from</span> langgraph.prebuilt <span class="hljs-keyword">import</span> tools_condition
<span class="hljs-keyword">from</span> langchain_huggingface <span class="hljs-keyword">import</span> HuggingFaceEndpoint, ChatHuggingFace

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

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

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

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

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

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

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

messages = [HumanMessage(content=<span class="hljs-string">&quot;Tell me about our guest named &#x27;Lady Ada Lovelace&#x27;.&quot;</span>)]
response = alfred.invoke({<span class="hljs-string">&quot;messages&quot;</span>: messages})

<span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;🎩 Alfred&#x27;s Response:&quot;</span>)
<span class="hljs-built_in">print</span>(response[<span class="hljs-string">&#x27;messages&#x27;</span>][-<span class="hljs-number">1</span>].content)`,wrap:!1}}),o=new W({props:{code:"JUYwJTlGJThFJUE5JTIwQWxmcmVkJ3MlMjBSZXNwb25zZSUzQSUwQUxhZHklMjBBZGElMjBMb3ZlbGFjZSUyMGlzJTIwYW4lMjBlc3RlZW1lZCUyMG1hdGhlbWF0aWNpYW4lMjBhbmQlMjBwaW9uZWVyJTIwaW4lMjBjb21wdXRpbmclMkMlMjBvZnRlbiUyMGNlbGVicmF0ZWQlMjBhcyUyMHRoZSUyMGZpcnN0JTIwY29tcHV0ZXIlMjBwcm9ncmFtbWVyJTIwZHVlJTIwdG8lMjBoZXIlMjB3b3JrJTIwb24lMjBDaGFybGVzJTIwQmFiYmFnZSdzJTIwQW5hbHl0aWNhbCUyMEVuZ2luZS4=",highlighted:`🎩 Alfred<span class="hljs-comment">&#x27;s Response:</span>
Lady Ada Lovelace <span class="hljs-built_in">is</span> an esteemed mathematician <span class="hljs-built_in">and</span> pioneer <span class="hljs-keyword">in</span> computing, often celebrated <span class="hljs-keyword">as</span> the first computer programmer due <span class="hljs-keyword">to</span> her work <span class="hljs-keyword">on</span> Charles Babbage<span class="hljs-comment">&#x27;s Analytical Engine.</span>`,wrap:!1}}),{c(){U(a.$$.fragment),u=d(),c=T("p"),c.textContent=M,p=d(),U(o.$$.fragment),n=d(),i=T("p"),i.textContent=f,j=d(),w=T("ul"),w.innerHTML=v},l(t){I(a.$$.fragment,t),u=m(t),c=h(t,"P",{"data-svelte-h":!0}),y(c)!=="svelte-15t3xg7"&&(c.textContent=M),p=m(t),I(o.$$.fragment,t),n=m(t),i=h(t,"P",{"data-svelte-h":!0}),y(i)!=="svelte-18avn85"&&(i.textContent=f),j=m(t),w=h(t,"UL",{"data-svelte-h":!0}),y(w)!=="svelte-1gzv19f"&&(w.innerHTML=v)},m(t,J){g(a,t,J),l(t,u,J),l(t,c,J),l(t,p,J),g(o,t,J),l(t,n,J),l(t,i,J),l(t,j,J),l(t,w,J),B=!0},p:_,i(t){B||(b(a.$$.fragment,t),b(o.$$.fragment,t),B=!0)},o(t){Z(a.$$.fragment,t),Z(o.$$.fragment,t),B=!1},d(t){t&&(s(u),s(c),s(p),s(n),s(i),s(j),s(w)),$(a,t),$(o,t)}}}function Us(C){let a,u,c,M,p,o;return a=new Q({props:{id:"agents-frameworks",option:"smolagents",$$slots:{default:[ys]},$$scope:{ctx:C}}}),c=new Q({props:{id:"agents-frameworks",option:"llama-index",$$slots:{default:[fs]},$$scope:{ctx:C}}}),p=new Q({props:{id:"agents-frameworks",option:"langgraph",$$slots:{default:[js]},$$scope:{ctx:C}}}),{c(){U(a.$$.fragment),u=d(),U(c.$$.fragment),M=d(),U(p.$$.fragment)},l(n){I(a.$$.fragment,n),u=m(n),I(c.$$.fragment,n),M=m(n),I(p.$$.fragment,n)},m(n,i){g(a,n,i),l(n,u,i),g(c,n,i),l(n,M,i),g(p,n,i),o=!0},p(n,i){const f={};i&2&&(f.$$scope={dirty:i,ctx:n}),a.$set(f);const j={};i&2&&(j.$$scope={dirty:i,ctx:n}),c.$set(j);const w={};i&2&&(w.$$scope={dirty:i,ctx:n}),p.$set(w)},i(n){o||(b(a.$$.fragment,n),b(c.$$.fragment,n),b(p.$$.fragment,n),o=!0)},o(n){Z(a.$$.fragment,n),Z(c.$$.fragment,n),Z(p.$$.fragment,n),o=!1},d(n){n&&(s(u),s(M)),$(a,n),$(c,n),$(p,n)}}}function Is(C){let a,u,c="When you’re done, implement your guest retriever tool in the <code>retriever.py</code> file.";return{c(){a=R(`Try extending the retriever tool to also return conversation starters based on each guest's interests or background. How would you modify the tool to accomplish this?
`),u=T("p"),u.innerHTML=c},l(M){a=x(M,`Try extending the retriever tool to also return conversation starters based on each guest's interests or background. How would you modify the tool to accomplish this?
`),u=h(M,"P",{"data-svelte-h":!0}),y(u)!=="svelte-1oanlbz"&&(u.innerHTML=c)},m(M,p){l(M,a,p),l(M,u,p)},p:_,d(M){M&&(s(a),s(u))}}}function gs(C){let a,u,c,M,p,o,n,i="Alfred, your trusted agent, is preparing for the most extravagant gala of the century. To ensure the event runs smoothly, Alfred needs quick access to up-to-date information about each guest. Let’s help Alfred by creating a custom Retrieval-Augmented Generation (RAG) tool, powered by our custom dataset.",f,j,w,v,B="Imagine Alfred mingling among the guests, needing to recall specific details about each person at a moment’s notice. A traditional LLM might struggle with this task because:",t,J,k="<li>The guest list is specific to your event and not in the model’s training data</li> <li>Guest information may change or be updated frequently</li> <li>Alfred needs to retrieve precise details like email addresses</li>",Be,z,jt="This is where Retrieval Augmented Generation (RAG) shines! By combining a retrieval system with an LLM, Alfred can access accurate, up-to-date information about your guests on demand.",ve,N,Ge,q,We,L,Ut="In this unit, we’ll develop our agent within a HF Space, as a structured Python project. This approach helps us maintain clean, modular code by organizing different functionalities into separate files.  Also, this makes for a more realistic use case where you would deploy the application for public use.",ke,D,Ve,P,It="<li><strong><code>tools.py</code></strong> – Provides auxiliary tools for the agent.</li> <li><strong><code>retriever.py</code></strong> – Implements retrieval functions to support knowledge access.</li> <li><strong><code>app.py</code></strong> – Integrates all components into a fully functional agent, which we’ll finalize in the last part of this unit.</li>",Re,K,gt='For a hands-on reference, check out <a href="https://huggingface.co/spaces/agents-course/Unit_3_Agentic_RAG" rel="nofollow">this HF Space</a>, where the Agentic RAG developed in this unit is live. Feel free to clone it and experiment!',xe,O,bt="You can directly test the agent below:",_e,X,Zt,Xe,ee,Ee,te,$t='Our dataset <a href="https://huggingface.co/datasets/agents-course/unit3-invitees/" rel="nofollow"><code>agents-course/unit3-invitees</code></a> contains the following fields for each guest:',Qe,se,Ct="<li><strong>Name</strong>: Guest’s full name</li> <li><strong>Relation</strong>: How the guest is related to the host</li> <li><strong>Description</strong>: A brief biography or interesting facts about the guest</li> <li><strong>Email Address</strong>: Contact information for sending invitations or follow-ups</li>",Ne,le,Bt="Below is a preview of the dataset:",Ae,E,vt,Fe,A,Se,ne,He,ae,Gt="We’ll create a custom tool that Alfred can use to quickly retrieve guest information during the gala. Let’s break this down into three manageable steps:",Ye,ie,Wt="<li>Load and prepare the dataset</li> <li>Create the Retriever Tool</li> <li>Integrate the Tool with Alfred</li>",ze,oe,kt="Let’s start with loading and preparing the dataset!",qe,re,Le,pe,Vt="First, we need to transform our raw guest data into a format that’s optimized for retrieval.",De,F,Pe,ce,Rt="In the code above, we:",Ke,Me,xt="<li>Load the dataset</li> <li>Convert each guest entry into a <code>Document</code> object with formatted content</li> <li>Store the <code>Document</code> objects in a list</li>",Oe,ue,_t="This means we’ve got all of our data nicely available so we can get started with configuring our retrieval.",et,de,tt,me,Xt="Now, let’s create a custom tool that Alfred can use to search through our guest information.",st,S,lt,Je,nt,we,Et="Finally, let’s bring everything together by creating our agent and equipping it with our custom tool:",at,H,it,Te,ot,he,Qt="During the gala, a conversation might flow like this:",rt,ye,Nt="<strong>You:</strong> “Alfred, who is that gentleman talking to the ambassador?”",pt,fe,At="<strong>Alfred:</strong> <em>quickly searches the guest database</em> “That’s Dr. Nikola Tesla, sir. He’s an old friend from your university days. He’s recently patented a new wireless energy transmission system and would be delighted to discuss it with you. Just remember he’s passionate about pigeons, so that might make for good small talk.”",ct,je,Mt,Ue,ut,Ie,Ft="Now that Alfred can retrieve guest information, consider how you might enhance this system:",dt,ge,St='<li><strong>Improve the retriever</strong> to use a more sophisticated algorithm like <a href="https://www.sbert.net/" rel="nofollow">sentence-transformers</a></li> <li><strong>Implement a conversation memory</strong> so Alfred remembers previous interactions</li> <li><strong>Combine with web search</strong> to get the latest information on unfamiliar guests</li> <li><strong>Integrate multiple indexes</strong> to get more complete information from verified sources</li>',mt,be,Ht="Now Alfred is fully equipped to handle guest inquiries effortlessly, ensuring your gala is remembered as the most sophisticated and delightful event of the century!",Jt,Y,wt,Ze,Tt,Ce,ht;return p=new V({props:{title:"Creating a RAG Tool for Guest Stories",local:"creating-a-rag-tool-for-guest-stories",headingTag:"h1"}}),j=new V({props:{title:"Why RAG for a Gala?",local:"why-rag-for-a-gala",headingTag:"h2"}}),N=new $e({props:{$$slots:{default:[is]},$$scope:{ctx:C}}}),q=new V({props:{title:"Setting up our application",local:"setting-up-our-application",headingTag:"h2"}}),D=new V({props:{title:"Project Structure",local:"project-structure",headingTag:"h3"}}),ee=new V({props:{title:"Dataset Overview",local:"dataset-overview",headingTag:"h2"}}),A=new $e({props:{$$slots:{default:[os]},$$scope:{ctx:C}}}),ne=new V({props:{title:"Building the Guestbook Tool",local:"building-the-guestbook-tool",headingTag:"h2"}}),re=new V({props:{title:"Step 1: Load and Prepare the Dataset",local:"step-1-load-and-prepare-the-dataset",headingTag:"h3"}}),F=new ft({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[Ms]},$$scope:{ctx:C}}}),de=new V({props:{title:"Step 2: Create the Retriever Tool",local:"step-2-create-the-retriever-tool",headingTag:"h3"}}),S=new ft({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[hs]},$$scope:{ctx:C}}}),Je=new V({props:{title:"Step 3: Integrate the Tool with Alfred",local:"step-3-integrate-the-tool-with-alfred",headingTag:"h3"}}),H=new ft({props:{id:"agents-frameworks",options:["smolagents","llama-index","langgraph"],$$slots:{default:[Us]},$$scope:{ctx:C}}}),Te=new V({props:{title:"Example Interaction",local:"example-interaction",headingTag:"h2"}}),je=new W({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMkRyLiUyME5pa29sYSUyMFRlc2xhJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIycmVsYXRpb24lMjIlM0ElMjAlMjJvbGQlMjBmcmllbmQlMjBmcm9tJTIwdW5pdmVyc2l0eSUyMGRheXMlMjIlMkMlMjAlMjAlMEElMjAlMjAlMjAlMjAlMjJkZXNjcmlwdGlvbiUyMiUzQSUyMCUyMkRyLiUyME5pa29sYSUyMFRlc2xhJTIwaXMlMjBhbiUyMG9sZCUyMGZyaWVuZCUyMGZyb20lMjB5b3VyJTIwdW5pdmVyc2l0eSUyMGRheXMuJTIwSGUncyUyMHJlY2VudGx5JTIwcGF0ZW50ZWQlMjBhJTIwbmV3JTIwd2lyZWxlc3MlMjBlbmVyZ3klMjB0cmFuc21pc3Npb24lMjBzeXN0ZW0lMjBhbmQlMjB3b3VsZCUyMGJlJTIwZGVsaWdodGVkJTIwdG8lMjBkaXNjdXNzJTIwaXQlMjB3aXRoJTIweW91LiUyMEp1c3QlMjByZW1lbWJlciUyMGhlJ3MlMjBwYXNzaW9uYXRlJTIwYWJvdXQlMjBwaWdlb25zJTJDJTIwc28lMjB0aGF0JTIwbWlnaHQlMjBtYWtlJTIwZm9yJTIwZ29vZCUyMHNtYWxsJTIwdGFsay4lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJlbWFpbCUyMiUzQSUyMCUyMm5pa29sYS50ZXNsYSU0MGdtYWlsLmNvbSUyMiUwQSU3RA==",highlighted:`<span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Dr. Nikola Tesla&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;relation&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;old friend from university days&quot;</span><span class="hljs-punctuation">,</span>  
    <span class="hljs-attr">&quot;description&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Dr. Nikola Tesla is an old friend from your university days. He&#x27;s recently patented a new wireless energy transmission system and would be delighted to discuss it with you. Just remember he&#x27;s passionate about pigeons, so that might make for good small talk.&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;email&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;nikola.tesla@gmail.com&quot;</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),Ue=new V({props:{title:"Taking It Further",local:"taking-it-further",headingTag:"h2"}}),Y=new $e({props:{$$slots:{default:[Is]},$$scope:{ctx:C}}}),Ze=new as({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit3/agentic-rag/invitees.mdx"}}),{c(){a=T("meta"),u=d(),c=T("p"),M=d(),U(p.$$.fragment),o=d(),n=T("p"),n.textContent=i,f=d(),U(j.$$.fragment),w=d(),v=T("p"),v.textContent=B,t=d(),J=T("ol"),J.innerHTML=k,Be=d(),z=T("p"),z.textContent=jt,ve=d(),U(N.$$.fragment),Ge=d(),U(q.$$.fragment),We=d(),L=T("p"),L.textContent=Ut,ke=d(),U(D.$$.fragment),Ve=d(),P=T("ul"),P.innerHTML=It,Re=d(),K=T("p"),K.innerHTML=gt,xe=d(),O=T("p"),O.textContent=bt,_e=d(),X=T("iframe"),Xe=d(),U(ee.$$.fragment),Ee=d(),te=T("p"),te.innerHTML=$t,Qe=d(),se=T("ul"),se.innerHTML=Ct,Ne=d(),le=T("p"),le.textContent=Bt,Ae=d(),E=T("iframe"),Fe=d(),U(A.$$.fragment),Se=d(),U(ne.$$.fragment),He=d(),ae=T("p"),ae.textContent=Gt,Ye=d(),ie=T("ol"),ie.innerHTML=Wt,ze=d(),oe=T("p"),oe.textContent=kt,qe=d(),U(re.$$.fragment),Le=d(),pe=T("p"),pe.textContent=Vt,De=d(),U(F.$$.fragment),Pe=d(),ce=T("p"),ce.textContent=Rt,Ke=d(),Me=T("ul"),Me.innerHTML=xt,Oe=d(),ue=T("p"),ue.textContent=_t,et=d(),U(de.$$.fragment),tt=d(),me=T("p"),me.textContent=Xt,st=d(),U(S.$$.fragment),lt=d(),U(Je.$$.fragment),nt=d(),we=T("p"),we.textContent=Et,at=d(),U(H.$$.fragment),it=d(),U(Te.$$.fragment),ot=d(),he=T("p"),he.textContent=Qt,rt=d(),ye=T("p"),ye.innerHTML=Nt,pt=d(),fe=T("p"),fe.innerHTML=At,ct=d(),U(je.$$.fragment),Mt=d(),U(Ue.$$.fragment),ut=d(),Ie=T("p"),Ie.textContent=Ft,dt=d(),ge=T("ol"),ge.innerHTML=St,mt=d(),be=T("p"),be.textContent=Ht,Jt=d(),U(Y.$$.fragment),wt=d(),U(Ze.$$.fragment),Tt=d(),Ce=T("p"),this.h()},l(e){const r=ls("svelte-u9bgzb",document.head);a=h(r,"META",{name:!0,content:!0}),r.forEach(s),u=m(e),c=h(e,"P",{}),yt(c).forEach(s),M=m(e),I(p.$$.fragment,e),o=m(e),n=h(e,"P",{"data-svelte-h":!0}),y(n)!=="svelte-1dmibto"&&(n.textContent=i),f=m(e),I(j.$$.fragment,e),w=m(e),v=h(e,"P",{"data-svelte-h":!0}),y(v)!=="svelte-1ohazl4"&&(v.textContent=B),t=m(e),J=h(e,"OL",{"data-svelte-h":!0}),y(J)!=="svelte-jzmsqw"&&(J.innerHTML=k),Be=m(e),z=h(e,"P",{"data-svelte-h":!0}),y(z)!=="svelte-1pkxjfz"&&(z.textContent=jt),ve=m(e),I(N.$$.fragment,e),Ge=m(e),I(q.$$.fragment,e),We=m(e),L=h(e,"P",{"data-svelte-h":!0}),y(L)!=="svelte-1dq0niz"&&(L.textContent=Ut),ke=m(e),I(D.$$.fragment,e),Ve=m(e),P=h(e,"UL",{"data-svelte-h":!0}),y(P)!=="svelte-718qhw"&&(P.innerHTML=It),Re=m(e),K=h(e,"P",{"data-svelte-h":!0}),y(K)!=="svelte-1ahpfas"&&(K.innerHTML=gt),xe=m(e),O=h(e,"P",{"data-svelte-h":!0}),y(O)!=="svelte-rbljri"&&(O.textContent=bt),_e=m(e),X=h(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),yt(X).forEach(s),Xe=m(e),I(ee.$$.fragment,e),Ee=m(e),te=h(e,"P",{"data-svelte-h":!0}),y(te)!=="svelte-1irlnn3"&&(te.innerHTML=$t),Qe=m(e),se=h(e,"UL",{"data-svelte-h":!0}),y(se)!=="svelte-kf7jwx"&&(se.innerHTML=Ct),Ne=m(e),le=h(e,"P",{"data-svelte-h":!0}),y(le)!=="svelte-79xtgg"&&(le.textContent=Bt),Ae=m(e),E=h(e,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),yt(E).forEach(s),Fe=m(e),I(A.$$.fragment,e),Se=m(e),I(ne.$$.fragment,e),He=m(e),ae=h(e,"P",{"data-svelte-h":!0}),y(ae)!=="svelte-1oc2u9p"&&(ae.textContent=Gt),Ye=m(e),ie=h(e,"OL",{"data-svelte-h":!0}),y(ie)!=="svelte-u61lb"&&(ie.innerHTML=Wt),ze=m(e),oe=h(e,"P",{"data-svelte-h":!0}),y(oe)!=="svelte-1psmdrg"&&(oe.textContent=kt),qe=m(e),I(re.$$.fragment,e),Le=m(e),pe=h(e,"P",{"data-svelte-h":!0}),y(pe)!=="svelte-1qfcd42"&&(pe.textContent=Vt),De=m(e),I(F.$$.fragment,e),Pe=m(e),ce=h(e,"P",{"data-svelte-h":!0}),y(ce)!=="svelte-bw00jq"&&(ce.textContent=Rt),Ke=m(e),Me=h(e,"UL",{"data-svelte-h":!0}),y(Me)!=="svelte-1676c5f"&&(Me.innerHTML=xt),Oe=m(e),ue=h(e,"P",{"data-svelte-h":!0}),y(ue)!=="svelte-1mdm43h"&&(ue.textContent=_t),et=m(e),I(de.$$.fragment,e),tt=m(e),me=h(e,"P",{"data-svelte-h":!0}),y(me)!=="svelte-1bgeoxd"&&(me.textContent=Xt),st=m(e),I(S.$$.fragment,e),lt=m(e),I(Je.$$.fragment,e),nt=m(e),we=h(e,"P",{"data-svelte-h":!0}),y(we)!=="svelte-11fbh5x"&&(we.textContent=Et),at=m(e),I(H.$$.fragment,e),it=m(e),I(Te.$$.fragment,e),ot=m(e),he=h(e,"P",{"data-svelte-h":!0}),y(he)!=="svelte-12f07z5"&&(he.textContent=Qt),rt=m(e),ye=h(e,"P",{"data-svelte-h":!0}),y(ye)!=="svelte-r8vshx"&&(ye.innerHTML=Nt),pt=m(e),fe=h(e,"P",{"data-svelte-h":!0}),y(fe)!=="svelte-hi3m2m"&&(fe.innerHTML=At),ct=m(e),I(je.$$.fragment,e),Mt=m(e),I(Ue.$$.fragment,e),ut=m(e),Ie=h(e,"P",{"data-svelte-h":!0}),y(Ie)!=="svelte-1up6x2f"&&(Ie.textContent=Ft),dt=m(e),ge=h(e,"OL",{"data-svelte-h":!0}),y(ge)!=="svelte-1eie5na"&&(ge.innerHTML=St),mt=m(e),be=h(e,"P",{"data-svelte-h":!0}),y(be)!=="svelte-1upuje4"&&(be.textContent=Ht),Jt=m(e),I(Y.$$.fragment,e),wt=m(e),I(Ze.$$.fragment,e),Tt=m(e),Ce=h(e,"P",{}),yt(Ce).forEach(s),this.h()},h(){G(a,"name","hf:doc:metadata"),G(a,"content",bs),Kt(X.src,Zt="https://agents-course-unit-3-agentic-rag.hf.space")||G(X,"src",Zt),G(X,"frameborder","0"),G(X,"width","850"),G(X,"height","450"),Kt(E.src,vt="https://huggingface.co/datasets/agents-course/unit3-invitees/embed/viewer/default/train")||G(E,"src",vt),G(E,"frameborder","0"),G(E,"width","100%"),G(E,"height","560px")},m(e,r){ns(document.head,a),l(e,u,r),l(e,c,r),l(e,M,r),g(p,e,r),l(e,o,r),l(e,n,r),l(e,f,r),g(j,e,r),l(e,w,r),l(e,v,r),l(e,t,r),l(e,J,r),l(e,Be,r),l(e,z,r),l(e,ve,r),g(N,e,r),l(e,Ge,r),g(q,e,r),l(e,We,r),l(e,L,r),l(e,ke,r),g(D,e,r),l(e,Ve,r),l(e,P,r),l(e,Re,r),l(e,K,r),l(e,xe,r),l(e,O,r),l(e,_e,r),l(e,X,r),l(e,Xe,r),g(ee,e,r),l(e,Ee,r),l(e,te,r),l(e,Qe,r),l(e,se,r),l(e,Ne,r),l(e,le,r),l(e,Ae,r),l(e,E,r),l(e,Fe,r),g(A,e,r),l(e,Se,r),g(ne,e,r),l(e,He,r),l(e,ae,r),l(e,Ye,r),l(e,ie,r),l(e,ze,r),l(e,oe,r),l(e,qe,r),g(re,e,r),l(e,Le,r),l(e,pe,r),l(e,De,r),g(F,e,r),l(e,Pe,r),l(e,ce,r),l(e,Ke,r),l(e,Me,r),l(e,Oe,r),l(e,ue,r),l(e,et,r),g(de,e,r),l(e,tt,r),l(e,me,r),l(e,st,r),g(S,e,r),l(e,lt,r),g(Je,e,r),l(e,nt,r),l(e,we,r),l(e,at,r),g(H,e,r),l(e,it,r),g(Te,e,r),l(e,ot,r),l(e,he,r),l(e,rt,r),l(e,ye,r),l(e,pt,r),l(e,fe,r),l(e,ct,r),g(je,e,r),l(e,Mt,r),g(Ue,e,r),l(e,ut,r),l(e,Ie,r),l(e,dt,r),l(e,ge,r),l(e,mt,r),l(e,be,r),l(e,Jt,r),g(Y,e,r),l(e,wt,r),g(Ze,e,r),l(e,Tt,r),l(e,Ce,r),ht=!0},p(e,[r]){const Yt={};r&2&&(Yt.$$scope={dirty:r,ctx:e}),N.$set(Yt);const zt={};r&2&&(zt.$$scope={dirty:r,ctx:e}),A.$set(zt);const qt={};r&2&&(qt.$$scope={dirty:r,ctx:e}),F.$set(qt);const Lt={};r&2&&(Lt.$$scope={dirty:r,ctx:e}),S.$set(Lt);const Dt={};r&2&&(Dt.$$scope={dirty:r,ctx:e}),H.$set(Dt);const Pt={};r&2&&(Pt.$$scope={dirty:r,ctx:e}),Y.$set(Pt)},i(e){ht||(b(p.$$.fragment,e),b(j.$$.fragment,e),b(N.$$.fragment,e),b(q.$$.fragment,e),b(D.$$.fragment,e),b(ee.$$.fragment,e),b(A.$$.fragment,e),b(ne.$$.fragment,e),b(re.$$.fragment,e),b(F.$$.fragment,e),b(de.$$.fragment,e),b(S.$$.fragment,e),b(Je.$$.fragment,e),b(H.$$.fragment,e),b(Te.$$.fragment,e),b(je.$$.fragment,e),b(Ue.$$.fragment,e),b(Y.$$.fragment,e),b(Ze.$$.fragment,e),ht=!0)},o(e){Z(p.$$.fragment,e),Z(j.$$.fragment,e),Z(N.$$.fragment,e),Z(q.$$.fragment,e),Z(D.$$.fragment,e),Z(ee.$$.fragment,e),Z(A.$$.fragment,e),Z(ne.$$.fragment,e),Z(re.$$.fragment,e),Z(F.$$.fragment,e),Z(de.$$.fragment,e),Z(S.$$.fragment,e),Z(Je.$$.fragment,e),Z(H.$$.fragment,e),Z(Te.$$.fragment,e),Z(je.$$.fragment,e),Z(Ue.$$.fragment,e),Z(Y.$$.fragment,e),Z(Ze.$$.fragment,e),ht=!1},d(e){e&&(s(u),s(c),s(M),s(o),s(n),s(f),s(w),s(v),s(t),s(J),s(Be),s(z),s(ve),s(Ge),s(We),s(L),s(ke),s(Ve),s(P),s(Re),s(K),s(xe),s(O),s(_e),s(X),s(Xe),s(Ee),s(te),s(Qe),s(se),s(Ne),s(le),s(Ae),s(E),s(Fe),s(Se),s(He),s(ae),s(Ye),s(ie),s(ze),s(oe),s(qe),s(Le),s(pe),s(De),s(Pe),s(ce),s(Ke),s(Me),s(Oe),s(ue),s(et),s(tt),s(me),s(st),s(lt),s(nt),s(we),s(at),s(it),s(ot),s(he),s(rt),s(ye),s(pt),s(fe),s(ct),s(Mt),s(ut),s(Ie),s(dt),s(ge),s(mt),s(be),s(Jt),s(wt),s(Tt),s(Ce)),s(a),$(p,e),$(j,e),$(N,e),$(q,e),$(D,e),$(ee,e),$(A,e),$(ne,e),$(re,e),$(F,e),$(de,e),$(S,e),$(Je,e),$(H,e),$(Te,e),$(je,e),$(Ue,e),$(Y,e),$(Ze,e)}}}const bs='{"title":"Creating a RAG Tool for Guest Stories","local":"creating-a-rag-tool-for-guest-stories","sections":[{"title":"Why RAG for a Gala?","local":"why-rag-for-a-gala","sections":[],"depth":2},{"title":"Setting up our application","local":"setting-up-our-application","sections":[{"title":"Project Structure","local":"project-structure","sections":[],"depth":3}],"depth":2},{"title":"Dataset Overview","local":"dataset-overview","sections":[],"depth":2},{"title":"Building the Guestbook Tool","local":"building-the-guestbook-tool","sections":[{"title":"Step 1: Load and Prepare the Dataset","local":"step-1-load-and-prepare-the-dataset","sections":[],"depth":3},{"title":"Step 2: Create the Retriever Tool","local":"step-2-create-the-retriever-tool","sections":[],"depth":3},{"title":"Step 3: Integrate the Tool with Alfred","local":"step-3-integrate-the-tool-with-alfred","sections":[],"depth":3}],"depth":2},{"title":"Example Interaction","local":"example-interaction","sections":[],"depth":2},{"title":"Taking It Further","local":"taking-it-further","sections":[],"depth":2}],"depth":1}';function Zs(C){return es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Vs extends ts{constructor(a){super(),ss(this,a,Zs,gs,Ot,{})}}export{Vs as component};
