import{s as it,o as rt,n as He}from"../chunks/scheduler.37c15a92.js";import{S as ct,i as mt,g as c,s as a,r as h,m as G,A as pt,h as m,f as l,c as s,j as Ye,u as f,x as u,n as _,k as W,y as ce,a as n,v as g,d as M,t as y,w as b}from"../chunks/index.2bf4358c.js";import{T as Xe}from"../chunks/Tip.363c041f.js";import{C as se}from"../chunks/CodeBlock.4e987730.js";import{H as ie}from"../chunks/Heading.8ada512a.js";import{E as ut}from"../chunks/index.f9c0018f.js";function dt(x){let r,o,w="this notebook",p;return{c(){r=G("You can follow the code in "),o=c("a"),o.textContent=w,p=G(" that you can run using Google Colab."),this.h()},l(i){r=_(i,"You can follow the code in "),o=m(i,"A",{href:!0,target:!0,"data-svelte-h":!0}),u(o)!=="svelte-1oi8dw1"&&(o.textContent=w),p=_(i," that you can run using Google Colab."),this.h()},h(){W(o,"href","https://huggingface.co/agents-course/notebooks/blob/main/unit2/llama-index/tools.ipynb"),W(o,"target","_blank")},m(i,j){n(i,r,j),n(i,o,j),n(i,p,j)},p:He,d(i){i&&(l(r),l(o),l(p))}}}function ht(x){let r,o,w="Function Calling Guide",p,i,j="Function Calling Learning Guide",T;return{c(){r=G("When using an agent or LLM with function calling, the tool selected (and the arguments written for that tool) rely strongly on the tool name and description of the purpose and arguments of the tool. Learn more about function calling in the "),o=c("a"),o.textContent=w,p=G(" and "),i=c("a"),i.textContent=j,T=G("."),this.h()},l(d){r=_(d,"When using an agent or LLM with function calling, the tool selected (and the arguments written for that tool) rely strongly on the tool name and description of the purpose and arguments of the tool. Learn more about function calling in the "),o=m(d,"A",{href:!0,"data-svelte-h":!0}),u(o)!=="svelte-kqlt1w"&&(o.textContent=w),p=_(d," and "),i=m(d,"A",{href:!0,"data-svelte-h":!0}),u(i)!=="svelte-4p3bp7"&&(i.textContent=j),T=_(d,"."),this.h()},h(){W(o,"href","https://docs.llamaindex.ai/en/stable/module_guides/deploying/agents/modules/function_calling.html"),W(i,"href","https://docs.llamaindex.ai/en/stable/understanding/agent/function_calling.html")},m(d,$){n(d,r,$),n(d,o,$),n(d,p,$),n(d,i,$),n(d,T,$)},p:He,d(d){d&&(l(r),l(o),l(p),l(i),l(T))}}}function ft(x){let r,o,w="LlamaHub";return{c(){r=G("You can find toolspecs and utility tools on the "),o=c("a"),o.textContent=w,this.h()},l(p){r=_(p,"You can find toolspecs and utility tools on the "),o=m(p,"A",{href:!0,"data-svelte-h":!0}),u(o)!=="svelte-b92hie"&&(o.textContent=w),this.h()},h(){W(o,"href","https://llamahub.ai/")},m(p,i){n(p,r,i),n(p,o,i)},p:He,d(p){p&&(l(r),l(o))}}}function gt(x){let r,o,w,p,i,j,T,d=`<strong>Defining a clear set of Tools is crucial to performance.</strong> As we discussed in <a href="../../unit1/tools">unit 1</a>, clear tool interfaces are easier for LLMs to use.
Much like a software API interface for human engineers, they can get more out of the tool if it’s easy to understand how it works.`,$,B,Se="There are <strong>four main types of tools in LlamaIndex</strong>:",me,I,Qe='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/tools.png" alt="Tools"/>',pe,k,Fe="<li><code>FunctionTool</code>: Convert any Python function into a tool that an agent can use. It automatically figures out how the function works.</li> <li><code>QueryEngineTool</code>: A tool that lets agents use query engines. Since agents are built on query engines, they can also use other agents as tools.</li> <li><code>Toolspecs</code>: Sets of tools created by the community, which often include tools for specific services like Gmail.</li> <li><code>Utility Tools</code>: Special tools that help handle large amounts of data from other tools.</li>",ue,V,Ae="We will go over each of them in more detail below.",de,L,he,Z,fe,E,qe=`A FunctionTool provides a simple way to wrap any Python function and make it available to an agent.
You can pass either a synchronous or asynchronous function to the tool, along with optional <code>name</code> and <code>description</code> parameters.
The name and description are particularly important as they help the agent understand when and how to use the tool effectively.
Let’s look at how to create a FunctionTool below and then call it.`,ge,N,Me,U,ye,R,be,Y,Pe=`The <code>QueryEngine</code> we defined in the previous unit can be easily transformed into a tool using the <code>QueryEngineTool</code> class.
Let’s see how to create a <code>QueryEngineTool</code> from a <code>QueryEngine</code> in the example below.`,we,X,Te,H,je,S,ze=`Think of <code>ToolSpecs</code> as collections of tools that work together harmoniously - like a well-organized professional toolkit.
Just as a mechanic’s toolkit contains complementary tools that work together for vehicle repairs, a <code>ToolSpec</code> combines related tools for specific purposes.
For example, an accounting agent’s <code>ToolSpec</code> might elegantly integrate spreadsheet capabilities, email functionality, and calculation tools to handle financial tasks with precision and efficiency.`,$e,v,ae,Ke="Install the Google Toolspec",Ne,Q,De="section on the LlamaHub",Re,F,ve,A,Oe="And now we can load the toolspec and convert it to a list of tools.",Je,q,xe,P,et="To get a more detailed view of the tools, we can take a look at the <code>metadata</code> of each tool.",Ze,z,Ue,K,Ce,D,tt=`LlamaIndex also allows using MCP tools through a <a href="https://llamahub.ai/l/tools/llama-index-tools-mcp?from=" rel="nofollow">ToolSpec on the LlamaHub</a>.
You can simply run an MCP server and start using it through the following implementation.`,Ge,O,_e,ee,We,te,lt=`Oftentimes, directly querying an API <strong>can return an excessive amount of data</strong>, some of which may be irrelevant, overflow the context window of the LLM, or unnecessarily increase the number of tokens that you are using.
Let’s walk through our two main utility tools below.`,Be,le,nt="<li><code>OnDemandToolLoader</code>: This tool turns any existing LlamaIndex data loader (BaseReader class) into a tool that an agent can use. The tool can be called with all the parameters needed to trigger <code>load_data</code> from the data loader, along with a natural language query string. During execution, we first load data from the data loader, index it (for instance with a vector store), and then query it ‘on-demand’. All three of these steps happen in a single tool call.</li> <li><code>LoadAndSearchToolSpec</code>: The LoadAndSearchToolSpec takes in any existing Tool as input. As a tool spec, it implements <code>to_tool_list</code>, and when that function is called, two tools are returned: a loading tool and then a search tool. The load Tool execution would call the underlying Tool, and the index the output (by default with a vector index). The search Tool execution would take in a query string as input and call the underlying index.</li>",Ie,C,ke,ne,ot="Now that we understand the basics of agents and tools in LlamaIndex, let’s see how we can <strong>use LlamaIndex to create configurable and manageable workflows!</strong>",Ve,oe,Le,re,Ee;return i=new ie({props:{title:"Using Tools in LlamaIndex",local:"using-tools-in-llamaindex",headingTag:"h1"}}),L=new ie({props:{title:"Creating a FunctionTool",local:"creating-a-functiontool",headingTag:"h2"}}),Z=new Xe({props:{$$slots:{default:[dt]},$$scope:{ctx:x}}}),N=new se({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBGdW5jdGlvblRvb2wlMEElMEFkZWYlMjBnZXRfd2VhdGhlcihsb2NhdGlvbiUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyVXNlZnVsJTIwZm9yJTIwZ2V0dGluZyUyMHRoZSUyMHdlYXRoZXIlMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjBwcmludChmJTIyR2V0dGluZyUyMHdlYXRoZXIlMjBmb3IlMjAlN0Jsb2NhdGlvbiU3RCUyMiklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBmJTIyVGhlJTIwd2VhdGhlciUyMGluJTIwJTdCbG9jYXRpb24lN0QlMjBpcyUyMHN1bm55JTIyJTBBJTBBdG9vbCUyMCUzRCUyMEZ1bmN0aW9uVG9vbC5mcm9tX2RlZmF1bHRzKCUwQSUyMCUyMCUyMCUyMGdldF93ZWF0aGVyJTJDJTBBJTIwJTIwJTIwJTIwbmFtZSUzRCUyMm15X3dlYXRoZXJfdG9vbCUyMiUyQyUwQSUyMCUyMCUyMCUyMGRlc2NyaXB0aW9uJTNEJTIyVXNlZnVsJTIwZm9yJTIwZ2V0dGluZyUyMHRoZSUyMHdlYXRoZXIlMjBmb3IlMjBhJTIwZ2l2ZW4lMjBsb2NhdGlvbi4lMjIlMkMlMEEpJTBBdG9vbC5jYWxsKCUyMk5ldyUyMFlvcmslMjIp",highlighted:`<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</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;Useful for getting the weather for a given location.&quot;&quot;&quot;</span>
    <span class="hljs-built_in">print</span>(<span class="hljs-string">f&quot;Getting weather for <span class="hljs-subst">{location}</span>&quot;</span>)
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;The weather in <span class="hljs-subst">{location}</span> is sunny&quot;</span>

tool = FunctionTool.from_defaults(
    get_weather,
    name=<span class="hljs-string">&quot;my_weather_tool&quot;</span>,
    description=<span class="hljs-string">&quot;Useful for getting the weather for a given location.&quot;</span>,
)
tool.call(<span class="hljs-string">&quot;New York&quot;</span>)`,wrap:!1}}),U=new Xe({props:{$$slots:{default:[ht]},$$scope:{ctx:x}}}),R=new ie({props:{title:"Creating a QueryEngineTool",local:"creating-a-queryenginetool",headingTag:"h2"}}),X=new se({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUlMjBpbXBvcnQlMjBWZWN0b3JTdG9yZUluZGV4JTBBZnJvbSUyMGxsYW1hX2luZGV4LmNvcmUudG9vbHMlMjBpbXBvcnQlMjBRdWVyeUVuZ2luZVRvb2wlMEFmcm9tJTIwbGxhbWFfaW5kZXgubGxtcy5odWdnaW5nZmFjZV9hcGklMjBpbXBvcnQlMjBIdWdnaW5nRmFjZUluZmVyZW5jZUFQSSUwQWZyb20lMjBsbGFtYV9pbmRleC5lbWJlZGRpbmdzLmh1Z2dpbmdmYWNlJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VFbWJlZGRpbmclMEFmcm9tJTIwbGxhbWFfaW5kZXgudmVjdG9yX3N0b3Jlcy5jaHJvbWElMjBpbXBvcnQlMjBDaHJvbWFWZWN0b3JTdG9yZSUwQSUwQWVtYmVkX21vZGVsJTIwJTNEJTIwSHVnZ2luZ0ZhY2VFbWJlZGRpbmcoJTIyQkFBSSUyRmJnZS1zbWFsbC1lbi12MS41JTIyKSUwQSUwQWRiJTIwJTNEJTIwY2hyb21hZGIuUGVyc2lzdGVudENsaWVudChwYXRoJTNEJTIyLiUyRmFsZnJlZF9jaHJvbWFfZGIlMjIpJTBBY2hyb21hX2NvbGxlY3Rpb24lMjAlM0QlMjBkYi5nZXRfb3JfY3JlYXRlX2NvbGxlY3Rpb24oJTIyYWxmcmVkJTIyKSUwQXZlY3Rvcl9zdG9yZSUyMCUzRCUyMENocm9tYVZlY3RvclN0b3JlKGNocm9tYV9jb2xsZWN0aW9uJTNEY2hyb21hX2NvbGxlY3Rpb24pJTBBJTBBaW5kZXglMjAlM0QlMjBWZWN0b3JTdG9yZUluZGV4LmZyb21fdmVjdG9yX3N0b3JlKHZlY3Rvcl9zdG9yZSUyQyUyMGVtYmVkX21vZGVsJTNEZW1iZWRfbW9kZWwpJTBBJTBBbGxtJTIwJTNEJTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEkobW9kZWxfbmFtZSUzRCUyMlF3ZW4lMkZRd2VuMi41LUNvZGVyLTMyQi1JbnN0cnVjdCUyMiklMEFxdWVyeV9lbmdpbmUlMjAlM0QlMjBpbmRleC5hc19xdWVyeV9lbmdpbmUobGxtJTNEbGxtKSUwQXRvb2wlMjAlM0QlMjBRdWVyeUVuZ2luZVRvb2wuZnJvbV9kZWZhdWx0cyhxdWVyeV9lbmdpbmUlMkMlMjBuYW1lJTNEJTIyc29tZSUyMHVzZWZ1bCUyMG5hbWUlMjIlMkMlMjBkZXNjcmlwdGlvbiUzRCUyMnNvbWUlMjB1c2VmdWwlMjBkZXNjcmlwdGlvbiUyMik=",highlighted:`<span class="hljs-keyword">from</span> llama_index.core <span class="hljs-keyword">import</span> VectorStoreIndex
<span class="hljs-keyword">from</span> llama_index.core.tools <span class="hljs-keyword">import</span> QueryEngineTool
<span class="hljs-keyword">from</span> llama_index.llms.huggingface_api <span class="hljs-keyword">import</span> HuggingFaceInferenceAPI
<span class="hljs-keyword">from</span> llama_index.embeddings.huggingface <span class="hljs-keyword">import</span> HuggingFaceEmbedding
<span class="hljs-keyword">from</span> llama_index.vector_stores.chroma <span class="hljs-keyword">import</span> ChromaVectorStore

embed_model = HuggingFaceEmbedding(<span class="hljs-string">&quot;BAAI/bge-small-en-v1.5&quot;</span>)

db = chromadb.PersistentClient(path=<span class="hljs-string">&quot;./alfred_chroma_db&quot;</span>)
chroma_collection = db.get_or_create_collection(<span class="hljs-string">&quot;alfred&quot;</span>)
vector_store = ChromaVectorStore(chroma_collection=chroma_collection)

index = VectorStoreIndex.from_vector_store(vector_store, embed_model=embed_model)

llm = HuggingFaceInferenceAPI(model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>)
query_engine = index.as_query_engine(llm=llm)
tool = QueryEngineTool.from_defaults(query_engine, name=<span class="hljs-string">&quot;some useful name&quot;</span>, description=<span class="hljs-string">&quot;some useful description&quot;</span>)`,wrap:!1}}),H=new ie({props:{title:"Creating Toolspecs",local:"creating-toolspecs",headingTag:"h2"}}),F=new se({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LXRvb2xzLWdvb2dsZQ==",highlighted:"pip install llama-index-tools-google",wrap:!1}}),q=new se({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLmdvb2dsZSUyMGltcG9ydCUyMEdtYWlsVG9vbFNwZWMlMEElMEF0b29sX3NwZWMlMjAlM0QlMjBHbWFpbFRvb2xTcGVjKCklMEF0b29sX3NwZWNfbGlzdCUyMCUzRCUyMHRvb2xfc3BlYy50b190b29sX2xpc3QoKQ==",highlighted:`<span class="hljs-keyword">from</span> llama_index.tools.google <span class="hljs-keyword">import</span> GmailToolSpec

tool_spec = GmailToolSpec()
tool_spec_list = tool_spec.to_tool_list()`,wrap:!1}}),z=new se({props:{code:"JTVCKHRvb2wubWV0YWRhdGEubmFtZSUyQyUyMHRvb2wubWV0YWRhdGEuZGVzY3JpcHRpb24pJTIwZm9yJTIwdG9vbCUyMGluJTIwdG9vbF9zcGVjX2xpc3QlNUQ=",highlighted:'[(tool.metadata.name, tool.metadata.description) <span class="hljs-keyword">for</span> tool <span class="hljs-keyword">in</span> tool_spec_list]',wrap:!1}}),K=new ie({props:{title:"Model Context Protocol (MCP) in LlamaIndex",local:"model-context-protocol-mcp-in-llamaindex",headingTag:"h3"}}),O=new se({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LnRvb2xzLm1jcCUyMGltcG9ydCUyMEJhc2ljTUNQQ2xpZW50JTJDJTIwTWNwVG9vbFNwZWMlMEElMEElMjMlMjBXZSUyMGNvbnNpZGVyJTIwdGhlcmUlMjBpcyUyMGElMjBtY3AlMjBzZXJ2ZXIlMjBydW5uaW5nJTIwb24lMjAxMjcuMC4wLjElM0E4MDAwJTJDJTIwb3IlMjB5b3UlMjBjYW4lMjB1c2UlMjB0aGUlMjBtY3AlMjBjbGllbnQlMjB0byUyMGNvbm5lY3QlMjB0byUyMHlvdXIlMjBvd24lMjBtY3AlMjBzZXJ2ZXIuJTBBbWNwX2NsaWVudCUyMCUzRCUyMEJhc2ljTUNQQ2xpZW50KCUyMmh0dHAlM0ElMkYlMkYxMjcuMC4wLjElM0E4MDAwJTJGc3NlJTIyKSUwQW1jcF90b29sJTIwJTNEJTIwTWNwVG9vbFNwZWMoY2xpZW50JTNEbWNwX2NsaWVudCklMEElMEElMjMlMjBnZXQlMjB0aGUlMjBhZ2VudCUwQWFnZW50JTIwJTNEJTIwYXdhaXQlMjBnZXRfYWdlbnQobWNwX3Rvb2wpJTBBJTBBJTIzJTIwY3JlYXRlJTIwdGhlJTIwYWdlbnQlMjBjb250ZXh0JTBBYWdlbnRfY29udGV4dCUyMCUzRCUyMENvbnRleHQoYWdlbnQp",highlighted:`<span class="hljs-keyword">from</span> llama_index.tools.mcp <span class="hljs-keyword">import</span> BasicMCPClient, McpToolSpec

<span class="hljs-comment"># We consider there is a mcp server running on 127.0.0.1:8000, or you can use the mcp client to connect to your own mcp server.</span>
mcp_client = BasicMCPClient(<span class="hljs-string">&quot;http://127.0.0.1:8000/sse&quot;</span>)
mcp_tool = McpToolSpec(client=mcp_client)

<span class="hljs-comment"># get the agent</span>
agent = <span class="hljs-keyword">await</span> get_agent(mcp_tool)

<span class="hljs-comment"># create the agent context</span>
agent_context = Context(agent)`,wrap:!1}}),ee=new ie({props:{title:"Utility Tools",local:"utility-tools",headingTag:"h2"}}),C=new Xe({props:{$$slots:{default:[ft]},$$scope:{ctx:x}}}),oe=new ut({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit2/llama-index/tools.mdx"}}),{c(){r=c("meta"),o=a(),w=c("p"),p=a(),h(i.$$.fragment),j=a(),T=c("p"),T.innerHTML=d,$=a(),B=c("p"),B.innerHTML=Se,me=a(),I=c("p"),I.innerHTML=Qe,pe=a(),k=c("ol"),k.innerHTML=Fe,ue=a(),V=c("p"),V.textContent=Ae,de=a(),h(L.$$.fragment),he=a(),h(Z.$$.fragment),fe=a(),E=c("p"),E.innerHTML=qe,ge=a(),h(N.$$.fragment),Me=a(),h(U.$$.fragment),ye=a(),h(R.$$.fragment),be=a(),Y=c("p"),Y.innerHTML=Pe,we=a(),h(X.$$.fragment),Te=a(),h(H.$$.fragment),je=a(),S=c("p"),S.innerHTML=ze,$e=a(),v=c("details"),ae=c("summary"),ae.textContent=Ke,Ne=G(`
As introduced in the `),Q=c("a"),Q.textContent=De,Re=G(`, we can install the Google toolspec with the following command:

	`),h(F.$$.fragment),ve=a(),A=c("p"),A.textContent=Oe,Je=a(),h(q.$$.fragment),xe=a(),P=c("p"),P.innerHTML=et,Ze=a(),h(z.$$.fragment),Ue=a(),h(K.$$.fragment),Ce=a(),D=c("p"),D.innerHTML=tt,Ge=a(),h(O.$$.fragment),_e=a(),h(ee.$$.fragment),We=a(),te=c("p"),te.innerHTML=lt,Be=a(),le=c("ol"),le.innerHTML=nt,Ie=a(),h(C.$$.fragment),ke=a(),ne=c("p"),ne.innerHTML=ot,Ve=a(),h(oe.$$.fragment),Le=a(),re=c("p"),this.h()},l(e){const t=pt("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(l),o=s(e),w=m(e,"P",{}),Ye(w).forEach(l),p=s(e),f(i.$$.fragment,e),j=s(e),T=m(e,"P",{"data-svelte-h":!0}),u(T)!=="svelte-1y4sc3l"&&(T.innerHTML=d),$=s(e),B=m(e,"P",{"data-svelte-h":!0}),u(B)!=="svelte-jgrrn"&&(B.innerHTML=Se),me=s(e),I=m(e,"P",{"data-svelte-h":!0}),u(I)!=="svelte-ir2ii4"&&(I.innerHTML=Qe),pe=s(e),k=m(e,"OL",{"data-svelte-h":!0}),u(k)!=="svelte-7bbi5a"&&(k.innerHTML=Fe),ue=s(e),V=m(e,"P",{"data-svelte-h":!0}),u(V)!=="svelte-1hynje"&&(V.textContent=Ae),de=s(e),f(L.$$.fragment,e),he=s(e),f(Z.$$.fragment,e),fe=s(e),E=m(e,"P",{"data-svelte-h":!0}),u(E)!=="svelte-1ij77fk"&&(E.innerHTML=qe),ge=s(e),f(N.$$.fragment,e),Me=s(e),f(U.$$.fragment,e),ye=s(e),f(R.$$.fragment,e),be=s(e),Y=m(e,"P",{"data-svelte-h":!0}),u(Y)!=="svelte-wh1h60"&&(Y.innerHTML=Pe),we=s(e),f(X.$$.fragment,e),Te=s(e),f(H.$$.fragment,e),je=s(e),S=m(e,"P",{"data-svelte-h":!0}),u(S)!=="svelte-1196szp"&&(S.innerHTML=ze),$e=s(e),v=m(e,"DETAILS",{});var J=Ye(v);ae=m(J,"SUMMARY",{"data-svelte-h":!0}),u(ae)!=="svelte-8tnjrg"&&(ae.textContent=Ke),Ne=_(J,`
As introduced in the `),Q=m(J,"A",{href:!0,"data-svelte-h":!0}),u(Q)!=="svelte-16phayx"&&(Q.textContent=De),Re=_(J,`, we can install the Google toolspec with the following command:

	`),f(F.$$.fragment,J),J.forEach(l),ve=s(e),A=m(e,"P",{"data-svelte-h":!0}),u(A)!=="svelte-a37nc2"&&(A.textContent=Oe),Je=s(e),f(q.$$.fragment,e),xe=s(e),P=m(e,"P",{"data-svelte-h":!0}),u(P)!=="svelte-piorhw"&&(P.innerHTML=et),Ze=s(e),f(z.$$.fragment,e),Ue=s(e),f(K.$$.fragment,e),Ce=s(e),D=m(e,"P",{"data-svelte-h":!0}),u(D)!=="svelte-k8w2vg"&&(D.innerHTML=tt),Ge=s(e),f(O.$$.fragment,e),_e=s(e),f(ee.$$.fragment,e),We=s(e),te=m(e,"P",{"data-svelte-h":!0}),u(te)!=="svelte-1s3291r"&&(te.innerHTML=lt),Be=s(e),le=m(e,"OL",{"data-svelte-h":!0}),u(le)!=="svelte-1el281h"&&(le.innerHTML=nt),Ie=s(e),f(C.$$.fragment,e),ke=s(e),ne=m(e,"P",{"data-svelte-h":!0}),u(ne)!=="svelte-a13dju"&&(ne.innerHTML=ot),Ve=s(e),f(oe.$$.fragment,e),Le=s(e),re=m(e,"P",{}),Ye(re).forEach(l),this.h()},h(){W(r,"name","hf:doc:metadata"),W(r,"content",Mt),W(Q,"href","./llama-hub")},m(e,t){ce(document.head,r),n(e,o,t),n(e,w,t),n(e,p,t),g(i,e,t),n(e,j,t),n(e,T,t),n(e,$,t),n(e,B,t),n(e,me,t),n(e,I,t),n(e,pe,t),n(e,k,t),n(e,ue,t),n(e,V,t),n(e,de,t),g(L,e,t),n(e,he,t),g(Z,e,t),n(e,fe,t),n(e,E,t),n(e,ge,t),g(N,e,t),n(e,Me,t),g(U,e,t),n(e,ye,t),g(R,e,t),n(e,be,t),n(e,Y,t),n(e,we,t),g(X,e,t),n(e,Te,t),g(H,e,t),n(e,je,t),n(e,S,t),n(e,$e,t),n(e,v,t),ce(v,ae),ce(v,Ne),ce(v,Q),ce(v,Re),g(F,v,null),n(e,ve,t),n(e,A,t),n(e,Je,t),g(q,e,t),n(e,xe,t),n(e,P,t),n(e,Ze,t),g(z,e,t),n(e,Ue,t),g(K,e,t),n(e,Ce,t),n(e,D,t),n(e,Ge,t),g(O,e,t),n(e,_e,t),g(ee,e,t),n(e,We,t),n(e,te,t),n(e,Be,t),n(e,le,t),n(e,Ie,t),g(C,e,t),n(e,ke,t),n(e,ne,t),n(e,Ve,t),g(oe,e,t),n(e,Le,t),n(e,re,t),Ee=!0},p(e,[t]){const J={};t&2&&(J.$$scope={dirty:t,ctx:e}),Z.$set(J);const at={};t&2&&(at.$$scope={dirty:t,ctx:e}),U.$set(at);const st={};t&2&&(st.$$scope={dirty:t,ctx:e}),C.$set(st)},i(e){Ee||(M(i.$$.fragment,e),M(L.$$.fragment,e),M(Z.$$.fragment,e),M(N.$$.fragment,e),M(U.$$.fragment,e),M(R.$$.fragment,e),M(X.$$.fragment,e),M(H.$$.fragment,e),M(F.$$.fragment,e),M(q.$$.fragment,e),M(z.$$.fragment,e),M(K.$$.fragment,e),M(O.$$.fragment,e),M(ee.$$.fragment,e),M(C.$$.fragment,e),M(oe.$$.fragment,e),Ee=!0)},o(e){y(i.$$.fragment,e),y(L.$$.fragment,e),y(Z.$$.fragment,e),y(N.$$.fragment,e),y(U.$$.fragment,e),y(R.$$.fragment,e),y(X.$$.fragment,e),y(H.$$.fragment,e),y(F.$$.fragment,e),y(q.$$.fragment,e),y(z.$$.fragment,e),y(K.$$.fragment,e),y(O.$$.fragment,e),y(ee.$$.fragment,e),y(C.$$.fragment,e),y(oe.$$.fragment,e),Ee=!1},d(e){e&&(l(o),l(w),l(p),l(j),l(T),l($),l(B),l(me),l(I),l(pe),l(k),l(ue),l(V),l(de),l(he),l(fe),l(E),l(ge),l(Me),l(ye),l(be),l(Y),l(we),l(Te),l(je),l(S),l($e),l(v),l(ve),l(A),l(Je),l(xe),l(P),l(Ze),l(Ue),l(Ce),l(D),l(Ge),l(_e),l(We),l(te),l(Be),l(le),l(Ie),l(ke),l(ne),l(Ve),l(Le),l(re)),l(r),b(i,e),b(L,e),b(Z,e),b(N,e),b(U,e),b(R,e),b(X,e),b(H,e),b(F),b(q,e),b(z,e),b(K,e),b(O,e),b(ee,e),b(C,e),b(oe,e)}}}const Mt='{"title":"Using Tools in LlamaIndex","local":"using-tools-in-llamaindex","sections":[{"title":"Creating a FunctionTool","local":"creating-a-functiontool","sections":[],"depth":2},{"title":"Creating a QueryEngineTool","local":"creating-a-queryenginetool","sections":[],"depth":2},{"title":"Creating Toolspecs","local":"creating-toolspecs","sections":[{"title":"Model Context Protocol (MCP) in LlamaIndex","local":"model-context-protocol-mcp-in-llamaindex","sections":[],"depth":3}],"depth":2},{"title":"Utility Tools","local":"utility-tools","sections":[],"depth":2}],"depth":1}';function yt(x){return rt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Jt extends ct{constructor(r){super(),mt(this,r,yt,gt,it,{})}}export{Jt as component};
