import{s as pe,n as ue,o as fe}from"../chunks/scheduler.889ebb13.js";import{S as he,i as ge,g as i,s as a,r as x,A as ce,h as o,f as n,c as s,j as me,u as I,x as r,k as re,y as de,a as l,v,d as j,t as H,w as _}from"../chunks/index.ca18042b.js";import{C as D}from"../chunks/CodeBlock.1db71023.js";import{H as K}from"../chunks/Heading.3daa581c.js";import{E as we}from"../chunks/EditOnGithub.2e95618d.js";function Me(O){let m,G,Z,k,p,B,u,ee="<strong>LlamaHub is a registry of hundreds of integrations, agents and tools that you can use within LlamaIndex.</strong>",W,f,te='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit2/llama-index/llama-hub.png" alt="LlamaHub"/>',C,h,ne="We will be using various integrations in this course, so let’s first look at the LlamaHub and how it can help us.",E,g,le="Let’s see how to find and install the dependencies for the components we need.",P,c,Y,d,ae=`LlamaIndex installation instructions are available as a well-structured <strong>overview on <a href="https://llamahub.ai/" rel="nofollow">LlamaHub</a></strong>.
This might be a bit overwhelming at first, but most of the <strong>installation commands generally follow an easy-to-remember format</strong>:`,V,w,A,M,se='Let’s try to install the dependencies for an LLM component using the <a href="https://llamahub.ai/l/llms/llama-index-llms-huggingface-api?from=llms" rel="nofollow">Hugging Face inference API integration</a>.',X,$,S,b,F,T,ie=`Once installed, we can see the usage patterns. You’ll notice that the import paths follow the install command!
Underneath, we can see an example of the usage of <strong>the Hugging Face inference API for an LLM component</strong>.`,Q,J,q,y,oe=`Wonderful, we now know how to find, install and use the integrations for the components we need.
<strong>Let’s dive deeper into the components</strong> and see how we can use them to build our own agents.`,R,L,N,U,z;return p=new K({props:{title:"Introduction to the LlamaHub",local:"introduction-to-the-llamahub",headingTag:"h1"}}),c=new K({props:{title:"Installation",local:"installation",headingTag:"h2"}}),w=new D({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LSU3QmNvbXBvbmVudC10eXBlJTdELSU3QmZyYW1ld29yay1uYW1lJTdE",highlighted:"pip install llama-index-{component-type}-{framework-name}",wrap:!1}}),$=new D({props:{code:"cGlwJTIwaW5zdGFsbCUyMGxsYW1hLWluZGV4LWxsbXMtaHVnZ2luZ2ZhY2UtYXBp",highlighted:"pip install llama-index-llms-huggingface-api",wrap:!1}}),b=new K({props:{title:"Usage",local:"usage",headingTag:"h2"}}),J=new D({props:{code:"ZnJvbSUyMGxsYW1hX2luZGV4LmxsbXMuaHVnZ2luZ2ZhY2VfYXBpJTIwaW1wb3J0JTIwSHVnZ2luZ0ZhY2VJbmZlcmVuY2VBUEklMEElMEFsbG0lMjAlM0QlMjBIdWdnaW5nRmFjZUluZmVyZW5jZUFQSSglMEElMjAlMjAlMjAlMjBtb2RlbF9uYW1lJTNEJTIyUXdlbiUyRlF3ZW4yLjUtQ29kZXItMzJCLUluc3RydWN0JTIyJTJDJTBBJTIwJTIwJTIwJTIwdGVtcGVyYXR1cmUlM0QwLjclMkMlMEElMjAlMjAlMjAlMjBtYXhfdG9rZW5zJTNEMTAwJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW4lM0QlMjJoZl94eHglMjIlMkMlMEEpJTBBJTBBbGxtLmNvbXBsZXRlKCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyKSUwQSUyMyUyMEklMjBhbSUyMGdvb2QlMkMlMjBob3clMjBjYW4lMjBJJTIwaGVscCUyMHlvdSUyMHRvZGF5JTNG",highlighted:`<span class="hljs-keyword">from</span> llama_index.llms.huggingface_api <span class="hljs-keyword">import</span> HuggingFaceInferenceAPI

llm = HuggingFaceInferenceAPI(
    model_name=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
    temperature=<span class="hljs-number">0.7</span>,
    max_tokens=<span class="hljs-number">100</span>,
    token=<span class="hljs-string">&quot;hf_xxx&quot;</span>,
)

llm.complete(<span class="hljs-string">&quot;Hello, how are you?&quot;</span>)
<span class="hljs-comment"># I am good, how can I help you today?</span>`,wrap:!1}}),L=new we({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/unit2/llama-index/llama-hub.mdx"}}),{c(){m=i("meta"),G=a(),Z=i("p"),k=a(),x(p.$$.fragment),B=a(),u=i("p"),u.innerHTML=ee,W=a(),f=i("p"),f.innerHTML=te,C=a(),h=i("p"),h.textContent=ne,E=a(),g=i("p"),g.textContent=le,P=a(),x(c.$$.fragment),Y=a(),d=i("p"),d.innerHTML=ae,V=a(),x(w.$$.fragment),A=a(),M=i("p"),M.innerHTML=se,X=a(),x($.$$.fragment),S=a(),x(b.$$.fragment),F=a(),T=i("p"),T.innerHTML=ie,Q=a(),x(J.$$.fragment),q=a(),y=i("p"),y.innerHTML=oe,R=a(),x(L.$$.fragment),N=a(),U=i("p"),this.h()},l(e){const t=ce("svelte-u9bgzb",document.head);m=o(t,"META",{name:!0,content:!0}),t.forEach(n),G=s(e),Z=o(e,"P",{}),me(Z).forEach(n),k=s(e),I(p.$$.fragment,e),B=s(e),u=o(e,"P",{"data-svelte-h":!0}),r(u)!=="svelte-6kawnq"&&(u.innerHTML=ee),W=s(e),f=o(e,"P",{"data-svelte-h":!0}),r(f)!=="svelte-jjjeyj"&&(f.innerHTML=te),C=s(e),h=o(e,"P",{"data-svelte-h":!0}),r(h)!=="svelte-fohn1k"&&(h.textContent=ne),E=s(e),g=o(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-5c6p8c"&&(g.textContent=le),P=s(e),I(c.$$.fragment,e),Y=s(e),d=o(e,"P",{"data-svelte-h":!0}),r(d)!=="svelte-169w10d"&&(d.innerHTML=ae),V=s(e),I(w.$$.fragment,e),A=s(e),M=o(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-6hebr6"&&(M.innerHTML=se),X=s(e),I($.$$.fragment,e),S=s(e),I(b.$$.fragment,e),F=s(e),T=o(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-1dpkd4c"&&(T.innerHTML=ie),Q=s(e),I(J.$$.fragment,e),q=s(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-13kdhye"&&(y.innerHTML=oe),R=s(e),I(L.$$.fragment,e),N=s(e),U=o(e,"P",{}),me(U).forEach(n),this.h()},h(){re(m,"name","hf:doc:metadata"),re(m,"content",$e)},m(e,t){de(document.head,m),l(e,G,t),l(e,Z,t),l(e,k,t),v(p,e,t),l(e,B,t),l(e,u,t),l(e,W,t),l(e,f,t),l(e,C,t),l(e,h,t),l(e,E,t),l(e,g,t),l(e,P,t),v(c,e,t),l(e,Y,t),l(e,d,t),l(e,V,t),v(w,e,t),l(e,A,t),l(e,M,t),l(e,X,t),v($,e,t),l(e,S,t),v(b,e,t),l(e,F,t),l(e,T,t),l(e,Q,t),v(J,e,t),l(e,q,t),l(e,y,t),l(e,R,t),v(L,e,t),l(e,N,t),l(e,U,t),z=!0},p:ue,i(e){z||(j(p.$$.fragment,e),j(c.$$.fragment,e),j(w.$$.fragment,e),j($.$$.fragment,e),j(b.$$.fragment,e),j(J.$$.fragment,e),j(L.$$.fragment,e),z=!0)},o(e){H(p.$$.fragment,e),H(c.$$.fragment,e),H(w.$$.fragment,e),H($.$$.fragment,e),H(b.$$.fragment,e),H(J.$$.fragment,e),H(L.$$.fragment,e),z=!1},d(e){e&&(n(G),n(Z),n(k),n(B),n(u),n(W),n(f),n(C),n(h),n(E),n(g),n(P),n(Y),n(d),n(V),n(A),n(M),n(X),n(S),n(F),n(T),n(Q),n(q),n(y),n(R),n(N),n(U)),n(m),_(p,e),_(c,e),_(w,e),_($,e),_(b,e),_(J,e),_(L,e)}}}const $e='{"title":"Introduction to the LlamaHub","local":"introduction-to-the-llamahub","sections":[{"title":"Installation","local":"installation","sections":[],"depth":2},{"title":"Usage","local":"usage","sections":[],"depth":2}],"depth":1}';function be(O){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ie extends he{constructor(m){super(),ge(this,m,be,Me,pe,{})}}export{Ie as component};
