import{S as su,i as lu,s as iu,e as r,k as i,w as g,t as s,M as du,c as a,d as o,m as d,a as n,x as _,h as l,b as m,G as e,g as h,y as v,q as b,o as $,B as y,v as cu,L as rr}from"../../chunks/vendor-hf-doc-builder.js";import{T as Hp}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ar}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as J}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as or}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function mu(I){let f,T;return{c(){f=r("p"),T=s(`Transformers Agent is an experimental API which is subject to change at any time. Results returned by the agents
can vary as the APIs or underlying models are prone to change.`)},l(w){f=a(w,"P",{});var u=n(f);T=l(u,`Transformers Agent is an experimental API which is subject to change at any time. Results returned by the agents
can vary as the APIs or underlying models are prone to change.`),u.forEach(o)},m(w,u){h(w,f,u),e(f,T)},d(w){w&&o(f)}}}function pu(I){let f,T,w,u,E;return u=new ar({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhmQWdlbnQlMEElMEFhZ2VudCUyMCUzRCUyMEhmQWdlbnQoJTIyaHR0cHMlM0ElMkYlMkZhcGktaW5mZXJlbmNlLmh1Z2dpbmdmYWNlLmNvJTJGbW9kZWxzJTJGYmlnY29kZSUyRnN0YXJjb2RlciUyMiklMEFhZ2VudC5ydW4oJTIySXMlMjB0aGUlMjBmb2xsb3dpbmclMjAlNjB0ZXh0JTYwJTIwKGluJTIwU3BhbmlzaCklMjBwb3NpdGl2ZSUyMG9yJTIwbmVnYXRpdmUlM0YlMjIlMkMlMjB0ZXh0JTNEJTIyJUMyJUExRXN0ZSUyMGVzJTIwdW4lMjBBUEklMjBtdXklMjBhZ3JhZGFibGUhJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HfAgent

agent = HfAgent(<span class="hljs-string">&quot;https://api-inference.huggingface.co/models/bigcode/starcoder&quot;</span>)
agent.run(<span class="hljs-string">&quot;Is the following \`text\` (in Spanish) positive or negative?&quot;</span>, text=<span class="hljs-string">&quot;\xA1Este es un API muy agradable!&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function hu(I){let f,T,w,u,E;return u=new ar({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsRm9yQ2F1c2FsTE0lMkMlMjBBdXRvVG9rZW5pemVyJTJDJTIwTG9jYWxBZ2VudCUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJiaWdjb2RlJTJGc3RhcmNvZGVyJTIyJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JDYXVzYWxMTS5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQSUwQWFnZW50JTIwJTNEJTIwTG9jYWxBZ2VudChtb2RlbCUyQyUyMHRva2VuaXplciklMEFhZ2VudC5ydW4oJTIyRHJhdyUyMG1lJTIwYSUyMHBpY3R1cmUlMjBvZiUyMHJpdmVycyUyMGFuZCUyMGxha2VzLiUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCausalLM, AutoTokenizer, LocalAgent

checkpoint = <span class="hljs-string">&quot;bigcode/starcoder&quot;</span>
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map=<span class="hljs-string">&quot;auto&quot;</span>, torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(checkpoint)

agent = LocalAgent(model, tokenizer)
agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes.&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function fu(I){let f,T,w,u,E;return u=new ar({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwTG9jYWxBZ2VudCUwQSUwQWFnZW50JTIwJTNEJTIwTG9jYWxBZ2VudC5mcm9tX3ByZXRyYWluZWQoJTIyYmlnY29kZSUyRnN0YXJjb2RlciUyMiUyQyUyMGRldmljZV9tYXAlM0QlMjJhdXRvJTIyJTJDJTIwdG9yY2hfZHR5cGUlM0R0b3JjaC5iZmxvYXQxNiklMEFhZ2VudC5ydW4oJTIyRHJhdyUyMG1lJTIwYSUyMHBpY3R1cmUlMjBvZiUyMHJpdmVycyUyMGFuZCUyMGxha2VzLiUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LocalAgent

agent = LocalAgent.from_pretrained(<span class="hljs-string">&quot;bigcode/starcoder&quot;</span>, device_map=<span class="hljs-string">&quot;auto&quot;</span>, torch_dtype=torch.bfloat16)
agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes.&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function uu(I){let f,T,w,u,E,c,A,R;return{c(){f=r("p"),T=s("The openAI models are used in generation mode, so even for the "),w=r("code"),u=s("chat()"),E=s(` API, it\u2019s better to use models like
`),c=r("code"),A=s('"text-davinci-003"'),R=s(" over the chat-GPT variant. Proper support for chat-GPT models will come in a next version.")},l(H){f=a(H,"P",{});var M=n(f);T=l(M,"The openAI models are used in generation mode, so even for the "),w=a(M,"CODE",{});var N=n(w);u=l(N,"chat()"),N.forEach(o),E=l(M,` API, it\u2019s better to use models like
`),c=a(M,"CODE",{});var ae=n(c);A=l(ae,'"text-davinci-003"'),ae.forEach(o),R=l(M," over the chat-GPT variant. Proper support for chat-GPT models will come in a next version."),M.forEach(o)},m(H,M){h(H,f,M),e(f,T),e(f,w),e(w,u),e(f,E),e(f,c),e(c,A),e(f,R)},d(H){H&&o(f)}}}function gu(I){let f,T,w,u,E;return u=new ar({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9wZW5BaUFnZW50JTBBJTBBYWdlbnQlMjAlM0QlMjBPcGVuQWlBZ2VudChtb2RlbCUzRCUyMnRleHQtZGF2aW5jaS0wMDMlMjIlMkMlMjBhcGlfa2V5JTNEeHh4KSUwQWFnZW50LnJ1biglMjJJcyUyMHRoZSUyMGZvbGxvd2luZyUyMCU2MHRleHQlNjAlMjAoaW4lMjBTcGFuaXNoKSUyMHBvc2l0aXZlJTIwb3IlMjBuZWdhdGl2ZSUzRiUyMiUyQyUyMHRleHQlM0QlMjIlQzIlQTFFc3RlJTIwZXMlMjB1biUyMEFQSSUyMG11eSUyMGFncmFkYWJsZSElMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> OpenAiAgent

agent = OpenAiAgent(model=<span class="hljs-string">&quot;text-davinci-003&quot;</span>, api_key=xxx)
agent.run(<span class="hljs-string">&quot;Is the following \`text\` (in Spanish) positive or negative?&quot;</span>, text=<span class="hljs-string">&quot;\xA1Este es un API muy agradable!&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function _u(I){let f,T,w,u,E,c,A,R;return{c(){f=r("p"),T=s("The openAI models are used in generation mode, so even for the "),w=r("code"),u=s("chat()"),E=s(` API, it\u2019s better to use models like
`),c=r("code"),A=s('"text-davinci-003"'),R=s(" over the chat-GPT variant. Proper support for chat-GPT models will come in a next version.")},l(H){f=a(H,"P",{});var M=n(f);T=l(M,"The openAI models are used in generation mode, so even for the "),w=a(M,"CODE",{});var N=n(w);u=l(N,"chat()"),N.forEach(o),E=l(M,` API, it\u2019s better to use models like
`),c=a(M,"CODE",{});var ae=n(c);A=l(ae,'"text-davinci-003"'),ae.forEach(o),R=l(M," over the chat-GPT variant. Proper support for chat-GPT models will come in a next version."),M.forEach(o)},m(H,M){h(H,f,M),e(f,T),e(f,w),e(w,u),e(f,E),e(f,c),e(c,A),e(f,R)},d(H){H&&o(f)}}}function vu(I){let f,T,w,u,E;return u=new ar({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF6dXJlT3BlbkFpQWdlbnQlMEElMEFhZ2VudCUyMCUzRCUyMEF6dXJlQWlBZ2VudChkZXBsb3ltZW50X2lkJTNEJTIyRGF2aW5jaS0wMDMlMjIlMkMlMjBhcGlfa2V5JTNEeHh4JTJDJTIwcmVzb3VyY2VfbmFtZSUzRHl5eSklMEFhZ2VudC5ydW4oJTIySXMlMjB0aGUlMjBmb2xsb3dpbmclMjAlNjB0ZXh0JTYwJTIwKGluJTIwU3BhbmlzaCklMjBwb3NpdGl2ZSUyMG9yJTIwbmVnYXRpdmUlM0YlMjIlMkMlMjB0ZXh0JTNEJTIyJUMyJUExRXN0ZSUyMGVzJTIwdW4lMjBBUEklMjBtdXklMjBhZ3JhZGFibGUhJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AzureOpenAiAgent

agent = AzureAiAgent(deployment_id=<span class="hljs-string">&quot;Davinci-003&quot;</span>, api_key=xxx, resource_name=yyy)
agent.run(<span class="hljs-string">&quot;Is the following \`text\` (in Spanish) positive or negative?&quot;</span>, text=<span class="hljs-string">&quot;\xA1Este es un API muy agradable!&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function bu(I){let f,T,w,u,E;return u=new ar({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhmQWdlbnQlMEElMEFhZ2VudCUyMCUzRCUyMEhmQWdlbnQoJTIyaHR0cHMlM0ElMkYlMkZhcGktaW5mZXJlbmNlLmh1Z2dpbmdmYWNlLmNvJTJGbW9kZWxzJTJGYmlnY29kZSUyRnN0YXJjb2RlciUyMiklMEFhZ2VudC5jaGF0KCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcyUyMiklMEElMEFhZ2VudC5jaGF0KCUyMlRyYW5zZm9ybSUyMHRoZSUyMHBpY3R1cmUlMjBzbyUyMHRoYXQlMjB0aGVyZSUyMGlzJTIwYSUyMHJvY2slMjBpbiUyMHRoZXJlJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HfAgent

agent = HfAgent(<span class="hljs-string">&quot;https://api-inference.huggingface.co/models/bigcode/starcoder&quot;</span>)
agent.chat(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes&quot;</span>)

agent.chat(<span class="hljs-string">&quot;Transform the picture so that there is a rock in there&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function $u(I){let f,T,w,u,E;return u=new ar({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhmQWdlbnQlMEElMEFhZ2VudCUyMCUzRCUyMEhmQWdlbnQoJTIyaHR0cHMlM0ElMkYlMkZhcGktaW5mZXJlbmNlLmh1Z2dpbmdmYWNlLmNvJTJGbW9kZWxzJTJGYmlnY29kZSUyRnN0YXJjb2RlciUyMiklMEFhZ2VudC5ydW4oJTIyRHJhdyUyMG1lJTIwYSUyMHBpY3R1cmUlMjBvZiUyMHJpdmVycyUyMGFuZCUyMGxha2VzJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HfAgent

agent = HfAgent(<span class="hljs-string">&quot;https://api-inference.huggingface.co/models/bigcode/starcoder&quot;</span>)
agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes&quot;</span>)`}}),{c(){f=r("p"),T=s("Example:"),w=i(),g(u.$$.fragment)},l(c){f=a(c,"P",{});var A=n(f);T=l(A,"Example:"),A.forEach(o),w=d(c),_(u.$$.fragment,c)},m(c,A){h(c,f,A),e(f,T),h(c,w,A),v(u,c,A),E=!0},p:rr,i(c){E||(b(u.$$.fragment,c),E=!0)},o(c){$(u.$$.fragment,c),E=!1},d(c){c&&o(f),c&&o(w),y(u,c)}}}function yu(I){let f,T,w,u,E,c,A,R,H,M,N,ae,Ze,ul,nr,gl,_l,On,me,Le,Hr,Zt,vl,Cr,bl,Rn,B,$l,sr,yl,wl,lr,Al,El,ir,Tl,kl,Zn,pe,Se,Nr,Lt,xl,Or,Il,Ln,ee,St,Ml,Rr,Pl,jl,We,Sn,he,Ge,Zr,Wt,Jl,Lr,Ul,Wn,Z,Gt,Dl,Sr,Hl,Cl,qe,Nl,ne,qt,Ol,zt,Rl,Wr,Zl,Ll,Sl,ze,Gn,fe,Ve,Gr,Vt,Wl,qr,Gl,qn,L,Bt,ql,zr,zl,Vl,Be,Bl,Ye,zn,ue,Fe,Vr,Yt,Yl,Br,Fl,Vn,S,Ft,Ql,Qt,Xl,Xt,Kl,ei,ti,Qe,oi,Xe,Bn,ge,Ke,Yr,Kt,ri,Fr,ai,Yn,C,eo,ni,Qr,si,li,se,to,ii,Xr,di,ci,et,mi,le,oo,pi,Kr,hi,fi,tt,ui,ot,ro,gi,ao,_i,dr,vi,bi,Fn,_e,rt,ea,no,$i,ta,yi,Qn,ve,at,oa,so,wi,ra,Ai,Xn,be,lo,Ei,aa,Ti,Kn,$e,nt,na,io,ki,sa,xi,es,x,co,Ii,mo,Mi,la,Pi,ji,Ji,te,Y,ia,Ui,Di,da,Hi,Ci,ca,Ni,Oi,ma,Ri,Zi,Li,F,pa,Si,Wi,ha,Gi,qi,fa,zi,Vi,ua,Bi,Yi,Fi,U,ga,Qi,Xi,_a,Ki,ed,va,td,od,ba,rd,ad,$a,nd,sd,ya,ld,id,dd,D,wa,cd,md,Aa,pd,hd,Ea,fd,ud,Ta,gd,_d,ka,vd,bd,xa,$d,yd,wd,ye,Ad,cr,Ed,Td,mr,kd,xd,Id,st,po,Md,ho,Pd,pr,jd,Jd,Ud,lt,fo,Dd,Ia,Hd,Cd,it,uo,Nd,Ma,Od,Rd,Q,go,Zd,_o,Ld,Pa,Sd,Wd,Gd,we,hr,qd,ja,zd,Vd,vo,Bd,Ja,Yd,Fd,Qd,bo,Xd,Ua,Kd,ec,tc,$o,oc,Da,rc,ac,nc,dt,yo,sc,Ha,lc,ts,Ae,ct,Ca,wo,ic,Na,dc,os,P,Ao,cc,Ee,mc,fr,pc,hc,ur,fc,uc,gc,oe,mt,Oa,_c,vc,Ra,bc,$c,yc,pt,Za,wc,Ac,La,Ec,Tc,kc,X,Sa,xc,Ic,Wa,Mc,Pc,Ga,jc,Jc,gr,Uc,Dc,Hc,K,qa,Cc,Nc,za,Oc,Rc,Va,Zc,Lc,_r,Sc,Wc,Gc,ht,Eo,qc,To,zc,Ba,Vc,Bc,Yc,ft,ko,Fc,Te,Qc,Ya,Xc,Kc,Fa,em,tm,om,ut,xo,rm,Io,am,Qa,nm,sm,lm,gt,Mo,im,re,dm,Xa,cm,mm,Ka,pm,hm,en,fm,um,rs,ke,_t,tn,Po,gm,on,_m,as,W,jo,vm,Jo,bm,vr,$m,ym,wm,vt,Uo,Am,Do,Em,br,Tm,km,xm,ie,Ho,Im,Co,Mm,rn,Pm,jm,Jm,No,Um,$r,Dm,Hm,ns,xe,bt,an,Oo,Cm,nn,Nm,ss,Ie,Ro,Om,Me,Rm,sn,Zm,Lm,ln,Sm,Wm,ls,Pe,$t,dn,Zo,Gm,cn,qm,is,yr,zm,ds,yt,Vm,mn,Bm,Ym,cs,wr,Fm,ms,de,Lo,Qm,pn,Xm,Km,ep,je,tp,hn,op,rp,fn,ap,np,sp,un,lp,ps,Je,wt,gn,So,ip,_n,dp,hs,Ue,Wo,cp,vn,mp,fs,De,At,bn,Go,pp,$n,hp,us,G,qo,fp,yn,up,gp,Et,zo,_p,wn,vp,bp,Tt,Vo,$p,An,yp,gs,He,kt,En,Bo,wp,Tn,Ap,_s,q,Yo,Ep,kn,Tp,kp,xt,Fo,xp,Qo,Ip,xn,Mp,Pp,jp,It,Xo,Jp,In,Up,vs;return c=new J({}),N=new Hp({props:{warning:!0,$$slots:{default:[mu]},$$scope:{ctx:I}}}),Zt=new J({}),Lt=new J({}),St=new k({props:{name:"class transformers.HfAgent",anchor:"transformers.HfAgent",parameters:[{name:"url_endpoint",val:""},{name:"token",val:" = None"},{name:"chat_prompt_template",val:" = None"},{name:"run_prompt_template",val:" = None"},{name:"additional_tools",val:" = None"}],parametersDescription:[{anchor:"transformers.HfAgent.url_endpoint",description:`<strong>url_endpoint</strong> (<code>str</code>) &#x2014;
The name of the url endpoint to use.`,name:"url_endpoint"},{anchor:"transformers.HfAgent.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If unset, will use the token generated when
running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.HfAgent.chat_prompt_template",description:`<strong>chat_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>chat</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>chat_prompt_template.txt</code> in this repo in this case.`,name:"chat_prompt_template"},{anchor:"transformers.HfAgent.run_prompt_template",description:`<strong>run_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>run</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>run_prompt_template.txt</code> in this repo in this case.`,name:"run_prompt_template"},{anchor:"transformers.HfAgent.additional_tools",description:`<strong>additional_tools</strong> (<a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, list of tools or dictionary with tool values, <em>optional</em>) &#x2014;
Any additional tools to include on top of the default ones. If you pass along a tool with the same name as
one of the default tools, that default tool will be overridden.`,name:"additional_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L588"}}),We=new or({props:{anchor:"transformers.HfAgent.example",$$slots:{default:[pu]},$$scope:{ctx:I}}}),Wt=new J({}),Gt=new k({props:{name:"class transformers.LocalAgent",anchor:"transformers.LocalAgent",parameters:[{name:"model",val:""},{name:"tokenizer",val:""},{name:"chat_prompt_template",val:" = None"},{name:"run_prompt_template",val:" = None"},{name:"additional_tools",val:" = None"}],parametersDescription:[{anchor:"transformers.LocalAgent.model",description:`<strong>model</strong> (<a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>) &#x2014;
The model to use for the agent.`,name:"model"},{anchor:"transformers.LocalAgent.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>) &#x2014;
The tokenizer to use for the agent.`,name:"tokenizer"},{anchor:"transformers.LocalAgent.chat_prompt_template",description:`<strong>chat_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>chat</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>chat_prompt_template.txt</code> in this repo in this case.`,name:"chat_prompt_template"},{anchor:"transformers.LocalAgent.run_prompt_template",description:`<strong>run_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>run</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>run_prompt_template.txt</code> in this repo in this case.`,name:"run_prompt_template"},{anchor:"transformers.LocalAgent.additional_tools",description:`<strong>additional_tools</strong> (<a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, list of tools or dictionary with tool values, <em>optional</em>) &#x2014;
Any additional tools to include on top of the default ones. If you pass along a tool with the same name as
one of the default tools, that default tool will be overridden.`,name:"additional_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L659"}}),qe=new or({props:{anchor:"transformers.LocalAgent.example",$$slots:{default:[hu]},$$scope:{ctx:I}}}),qt=new k({props:{name:"from_pretrained",anchor:"transformers.LocalAgent.from_pretrained",parameters:[{name:"pretrained_model_name_or_path",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LocalAgent.from_pretrained.pretrained_model_name_or_path",description:`<strong>pretrained_model_name_or_path</strong> (<code>str</code> or <code>os.PathLike</code>) &#x2014;
The name of a repo on the Hub or a local path to a folder containing both model and tokenizer.`,name:"pretrained_model_name_or_path"},{anchor:"transformers.LocalAgent.from_pretrained.kwargs",description:`<strong>kwargs</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) &#x2014;
Keyword arguments passed along to <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a>.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L704"}}),ze=new or({props:{anchor:"transformers.LocalAgent.from_pretrained.example",$$slots:{default:[fu]},$$scope:{ctx:I}}}),Vt=new J({}),Bt=new k({props:{name:"class transformers.OpenAiAgent",anchor:"transformers.OpenAiAgent",parameters:[{name:"model",val:" = 'text-davinci-003'"},{name:"api_key",val:" = None"},{name:"chat_prompt_template",val:" = None"},{name:"run_prompt_template",val:" = None"},{name:"additional_tools",val:" = None"}],parametersDescription:[{anchor:"transformers.OpenAiAgent.model",description:`<strong>model</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;text-davinci-003&quot;</code>) &#x2014;
The name of the OpenAI model to use.`,name:"model"},{anchor:"transformers.OpenAiAgent.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use. If unset, will look for the environment variable <code>&quot;OPENAI_API_KEY&quot;</code>.`,name:"api_key"},{anchor:"transformers.OpenAiAgent.chat_prompt_template",description:`<strong>chat_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>chat</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>chat_prompt_template.txt</code> in this repo in this case.`,name:"chat_prompt_template"},{anchor:"transformers.OpenAiAgent.run_prompt_template",description:`<strong>run_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>run</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>run_prompt_template.txt</code> in this repo in this case.`,name:"run_prompt_template"},{anchor:"transformers.OpenAiAgent.additional_tools",description:`<strong>additional_tools</strong> (<a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, list of tools or dictionary with tool values, <em>optional</em>) &#x2014;
Any additional tools to include on top of the default ones. If you pass along a tool with the same name as
one of the default tools, that default tool will be overridden.`,name:"additional_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L364"}}),Be=new Hp({props:{warning:!0,$$slots:{default:[uu]},$$scope:{ctx:I}}}),Ye=new or({props:{anchor:"transformers.OpenAiAgent.example",$$slots:{default:[gu]},$$scope:{ctx:I}}}),Yt=new J({}),Ft=new k({props:{name:"class transformers.AzureOpenAiAgent",anchor:"transformers.AzureOpenAiAgent",parameters:[{name:"deployment_id",val:""},{name:"api_key",val:" = None"},{name:"resource_name",val:" = None"},{name:"api_version",val:" = '2022-12-01'"},{name:"is_chat_model",val:" = None"},{name:"chat_prompt_template",val:" = None"},{name:"run_prompt_template",val:" = None"},{name:"additional_tools",val:" = None"}],parametersDescription:[{anchor:"transformers.AzureOpenAiAgent.deployment_id",description:`<strong>deployment_id</strong> (<code>str</code>) &#x2014;
The name of the deployed Azure openAI model to use.`,name:"deployment_id"},{anchor:"transformers.AzureOpenAiAgent.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use. If unset, will look for the environment variable <code>&quot;AZURE_OPENAI_API_KEY&quot;</code>.`,name:"api_key"},{anchor:"transformers.AzureOpenAiAgent.resource_name",description:`<strong>resource_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The name of your Azure OpenAI Resource. If unset, will look for the environment variable
<code>&quot;AZURE_OPENAI_RESOURCE_NAME&quot;</code>.`,name:"resource_name"},{anchor:"transformers.AzureOpenAiAgent.api_version",description:`<strong>api_version</strong> (<code>str</code>, <em>optional</em>, default to <code>&quot;2022-12-01&quot;</code>) &#x2014;
The API version to use for this agent.`,name:"api_version"},{anchor:"transformers.AzureOpenAiAgent.is_chat_mode",description:`<strong>is_chat_mode</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether you are using a completion model or a chat model (see note above, chat models won&#x2019;t be as
efficient). Will default to <code>gpt</code> being in the <code>deployment_id</code> or not.`,name:"is_chat_mode"},{anchor:"transformers.AzureOpenAiAgent.chat_prompt_template",description:`<strong>chat_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>chat</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>chat_prompt_template.txt</code> in this repo in this case.`,name:"chat_prompt_template"},{anchor:"transformers.AzureOpenAiAgent.run_prompt_template",description:`<strong>run_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>run</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>run_prompt_template.txt</code> in this repo in this case.`,name:"run_prompt_template"},{anchor:"transformers.AzureOpenAiAgent.additional_tools",description:`<strong>additional_tools</strong> (<a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, list of tools or dictionary with tool values, <em>optional</em>) &#x2014;
Any additional tools to include on top of the default ones. If you pass along a tool with the same name as
one of the default tools, that default tool will be overridden.`,name:"additional_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L462"}}),Qe=new Hp({props:{warning:!0,$$slots:{default:[_u]},$$scope:{ctx:I}}}),Xe=new or({props:{anchor:"transformers.AzureOpenAiAgent.example",$$slots:{default:[vu]},$$scope:{ctx:I}}}),Kt=new J({}),eo=new k({props:{name:"class transformers.Agent",anchor:"transformers.Agent",parameters:[{name:"chat_prompt_template",val:" = None"},{name:"run_prompt_template",val:" = None"},{name:"additional_tools",val:" = None"}],parametersDescription:[{anchor:"transformers.Agent.chat_prompt_template",description:`<strong>chat_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>chat</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>chat_prompt_template.txt</code> in this repo in this case.`,name:"chat_prompt_template"},{anchor:"transformers.Agent.run_prompt_template",description:`<strong>run_prompt_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Pass along your own prompt if you want to override the default template for the <code>run</code> method. Can be the
actual prompt template or a repo ID (on the Hugging Face Hub). The prompt should be in a file named
<code>run_prompt_template.txt</code> in this repo in this case.`,name:"run_prompt_template"},{anchor:"transformers.Agent.additional_tools",description:`<strong>additional_tools</strong> (<a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, list of tools or dictionary with tool values, <em>optional</em>) &#x2014;
Any additional tools to include on top of the default ones. If you pass along a tool with the same name as
one of the default tools, that default tool will be overridden.`,name:"additional_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L196"}}),to=new k({props:{name:"chat",anchor:"transformers.Agent.chat",parameters:[{name:"task",val:""},{name:"return_code",val:" = False"},{name:"remote",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Agent.chat.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; The task to perform",name:"task"},{anchor:"transformers.Agent.chat.return_code",description:`<strong>return_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to just return code and not evaluate it.`,name:"return_code"},{anchor:"transformers.Agent.chat.remote",description:`<strong>remote</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use remote tools (inference endpoints) instead of local ones.`,name:"remote"},{anchor:"transformers.Agent.chat.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Any keyword argument to send to the agent when evaluating the code.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L268"}}),et=new or({props:{anchor:"transformers.Agent.chat.example",$$slots:{default:[bu]},$$scope:{ctx:I}}}),oo=new k({props:{name:"run",anchor:"transformers.Agent.run",parameters:[{name:"task",val:""},{name:"return_code",val:" = False"},{name:"remote",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Agent.run.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; The task to perform",name:"task"},{anchor:"transformers.Agent.run.return_code",description:`<strong>return_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to just return code and not evaluate it.`,name:"return_code"},{anchor:"transformers.Agent.run.remote",description:`<strong>remote</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use remote tools (inference endpoints) instead of local ones.`,name:"remote"},{anchor:"transformers.Agent.run.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Any keyword argument to send to the agent when evaluating the code.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L318"}}),tt=new or({props:{anchor:"transformers.Agent.run.example",$$slots:{default:[$u]},$$scope:{ctx:I}}}),ro=new k({props:{name:"prepare_for_new_chat",anchor:"transformers.Agent.prepare_for_new_chat",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agents.py#L310"}}),no=new J({}),so=new J({}),lo=new k({props:{name:"transformers.load_tool",anchor:"transformers.load_tool",parameters:[{name:"task_or_repo_id",val:""},{name:"model_repo_id",val:" = None"},{name:"remote",val:" = False"},{name:"token",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.load_tool.task_or_repo_id",description:`<strong>task_or_repo_id</strong> (<code>str</code>) &#x2014;
The task for which to load the tool or a repo ID of a tool on the Hub. Tasks implemented in Transformers
are:</p>
<ul>
<li><code>&quot;document-question-answering&quot;</code></li>
<li><code>&quot;image-captioning&quot;</code></li>
<li><code>&quot;image-question-answering&quot;</code></li>
<li><code>&quot;image-segmentation&quot;</code></li>
<li><code>&quot;speech-to-text&quot;</code></li>
<li><code>&quot;summarization&quot;</code></li>
<li><code>&quot;text-classification&quot;</code></li>
<li><code>&quot;text-question-answering&quot;</code></li>
<li><code>&quot;text-to-speech&quot;</code></li>
<li><code>&quot;translation&quot;</code></li>
</ul>`,name:"task_or_repo_id"},{anchor:"transformers.load_tool.model_repo_id",description:`<strong>model_repo_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Use this argument to use a different model than the default one for the tool you selected.`,name:"model_repo_id"},{anchor:"transformers.load_tool.remote",description:`<strong>remote</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use your tool by downloading the model or (if it is available) with an inference endpoint.`,name:"remote"},{anchor:"transformers.load_tool.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to identify you on hf.co. If unset, will use the token generated when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.load_tool.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Additional keyword arguments that will be split in two: all arguments relevant to the Hub (such as
<code>cache_dir</code>, <code>revision</code>, <code>subfolder</code>) will be used when downloading the files for your tool, and the others
will be passed along to its init.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L639"}}),io=new J({}),co=new k({props:{name:"class transformers.Tool",anchor:"transformers.Tool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L81"}}),po=new k({props:{name:"from_gradio",anchor:"transformers.Tool.from_gradio",parameters:[{name:"gradio_tool",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L330"}}),fo=new k({props:{name:"from_hub",anchor:"transformers.Tool.from_hub",parameters:[{name:"repo_id",val:": str"},{name:"model_repo_id",val:": typing.Optional[str] = None"},{name:"token",val:": typing.Optional[str] = None"},{name:"remote",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Tool.from_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repo on the Hub where your tool is defined.`,name:"repo_id"},{anchor:"transformers.Tool.from_hub.model_repo_id",description:`<strong>model_repo_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
If your tool uses a model and you want to use a different model than the default, you can pass a second
repo ID or an endpoint url to this argument.`,name:"model_repo_id"},{anchor:"transformers.Tool.from_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to identify you on hf.co. If unset, will use the token generated when running
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.Tool.from_hub.remote",description:`<strong>remote</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to use your tool by downloading the model or (if it is available) with an inference endpoint.`,name:"remote"},{anchor:"transformers.Tool.from_hub.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Additional keyword arguments that will be split in two: all arguments relevant to the Hub (such as
<code>cache_dir</code>, <code>revision</code>, <code>subfolder</code>) will be used when downloading the files for your tool, and the
others will be passed along to its init.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L176"}}),uo=new k({props:{name:"push_to_hub",anchor:"transformers.Tool.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": str = 'Upload tool'"},{name:"private",val:": typing.Optional[bool] = None"},{name:"token",val:": typing.Union[bool, str, NoneType] = None"},{name:"create_pr",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Tool.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your tool to. It should contain your organization name when
pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.Tool.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;Upload tool&quot;</code>) &#x2014;
Message to commit while pushing.`,name:"commit_message"},{anchor:"transformers.Tool.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.Tool.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If unset, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.Tool.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L286"}}),go=new k({props:{name:"save",anchor:"transformers.Tool.save",parameters:[{name:"output_dir",val:""}],parametersDescription:[{anchor:"transformers.Tool.save.output_dir",description:"<strong>output_dir</strong> (<code>str</code>) &#x2014; The folder in which you want to save your tool.",name:"output_dir"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L122"}}),yo=new k({props:{name:"setup",anchor:"transformers.Tool.setup",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L115"}}),wo=new J({}),Ao=new k({props:{name:"class transformers.PipelineTool",anchor:"transformers.PipelineTool",parameters:[{name:"model",val:" = None"},{name:"pre_processor",val:" = None"},{name:"post_processor",val:" = None"},{name:"device",val:" = None"},{name:"device_map",val:" = None"},{name:"model_kwargs",val:" = None"},{name:"token",val:" = None"},{name:"**hub_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PipelineTool.model",description:`<strong>model</strong> (<code>str</code> or <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>, <em>optional</em>) &#x2014;
The name of the checkpoint to use for the model, or the instantiated model. If unset, will default to the
value of the class attribute <code>default_checkpoint</code>.`,name:"model"},{anchor:"transformers.PipelineTool.pre_processor",description:`<strong>pre_processor</strong> (<code>str</code> or <code>Any</code>, <em>optional</em>) &#x2014;
The name of the checkpoint to use for the pre-processor, or the instantiated pre-processor (can be a
tokenizer, an image processor, a feature extractor or a processor). Will default to the value of <code>model</code> if
unset.`,name:"pre_processor"},{anchor:"transformers.PipelineTool.post_processor",description:`<strong>post_processor</strong> (<code>str</code> or <code>Any</code>, <em>optional</em>) &#x2014;
The name of the checkpoint to use for the post-processor, or the instantiated pre-processor (can be a
tokenizer, an image processor, a feature extractor or a processor). Will default to the <code>pre_processor</code> if
unset.`,name:"post_processor"},{anchor:"transformers.PipelineTool.device",description:`<strong>device</strong> (<code>int</code>, <code>str</code> or <code>torch.device</code>, <em>optional</em>) &#x2014;
The device on which to execute the model. Will default to any accelerator available (GPU, MPS etc&#x2026;), the
CPU otherwise.`,name:"device"},{anchor:"transformers.PipelineTool.device_map",description:`<strong>device_map</strong> (<code>str</code> or <code>dict</code>, <em>optional</em>) &#x2014;
If passed along, will be used to instantiate the model.`,name:"device_map"},{anchor:"transformers.PipelineTool.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Any keyword argument to send to the model instantiation.`,name:"model_kwargs"},{anchor:"transformers.PipelineTool.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If unset, will use the token generated when
running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.PipelineTool.hub_kwargs",description:`<strong>hub_kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Any additional keyword argument to send to the methods that will load the data from the Hub.`,name:"hub_kwargs"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L433"}}),Eo=new k({props:{name:"decode",anchor:"transformers.PipelineTool.decode",parameters:[{name:"outputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L552"}}),ko=new k({props:{name:"encode",anchor:"transformers.PipelineTool.encode",parameters:[{name:"raw_inputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L539"}}),xo=new k({props:{name:"forward",anchor:"transformers.PipelineTool.forward",parameters:[{name:"inputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L545"}}),Mo=new k({props:{name:"setup",anchor:"transformers.PipelineTool.setup",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L513"}}),Po=new J({}),jo=new k({props:{name:"class transformers.RemoteTool",anchor:"transformers.RemoteTool",parameters:[{name:"endpoint_url",val:" = None"},{name:"token",val:" = None"},{name:"tool_class",val:" = None"}],parametersDescription:[{anchor:"transformers.RemoteTool.endpoint_url",description:`<strong>endpoint_url</strong> (<code>str</code>) &#x2014;
The url of the endpoint to use.`,name:"endpoint_url"},{anchor:"transformers.RemoteTool.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If unset, will use the token generated when
running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"transformers.RemoteTool.tool_class",description:`<strong>tool_class</strong> (<code>type</code>, <em>optional</em>) &#x2014;
The corresponding <code>tool_class</code> if this is a remote version of an existing tool. Will help determine when
the output should be converted to another type (like images).`,name:"tool_class"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L346"}}),Uo=new k({props:{name:"extract_outputs",anchor:"transformers.RemoteTool.extract_outputs",parameters:[{name:"outputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L409"}}),Ho=new k({props:{name:"prepare_inputs",anchor:"transformers.RemoteTool.prepare_inputs",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L366"}}),Oo=new J({}),Ro=new k({props:{name:"transformers.launch_gradio_demo",anchor:"transformers.launch_gradio_demo",parameters:[{name:"tool_class",val:": Tool"}],parametersDescription:[{anchor:"transformers.launch_gradio_demo.tool_class",description:"<strong>tool_class</strong> (<code>type</code>) &#x2014; The class of the tool for which to launch the demo.",name:"tool_class"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/base.py#L573"}}),Zo=new J({}),So=new J({}),Wo=new k({props:{name:"class transformers.tools.agent_types.AgentText",anchor:"transformers.tools.agent_types.AgentText",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L71"}}),Go=new J({}),qo=new k({props:{name:"class transformers.tools.agent_types.AgentImage",anchor:"transformers.tools.agent_types.AgentImage",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L83"}}),zo=new k({props:{name:"to_raw",anchor:"transformers.tools.agent_types.AgentImage.to_raw",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L115"}}),Vo=new k({props:{name:"to_string",anchor:"transformers.tools.agent_types.AgentImage.to_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L126"}}),Bo=new J({}),Yo=new k({props:{name:"class transformers.tools.agent_types.AgentAudio",anchor:"transformers.tools.agent_types.AgentAudio",parameters:[{name:"value",val:""},{name:"samplerate",val:" = 16000"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L155"}}),Fo=new k({props:{name:"to_raw",anchor:"transformers.tools.agent_types.AgentAudio.to_raw",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L186"}}),Xo=new k({props:{name:"to_string",anchor:"transformers.tools.agent_types.AgentAudio.to_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/tools/agent_types.py#L198"}}),{c(){f=r("meta"),T=i(),w=r("h1"),u=r("a"),E=r("span"),g(c.$$.fragment),A=i(),R=r("span"),H=s("Agents & Tools"),M=i(),g(N.$$.fragment),ae=i(),Ze=r("p"),ul=s("To learn more about agents and tools make sure to read the "),nr=r("a"),gl=s("introductory guide"),_l=s(`. This page
contains the API docs for the underlying classes.`),On=i(),me=r("h2"),Le=r("a"),Hr=r("span"),g(Zt.$$.fragment),vl=i(),Cr=r("span"),bl=s("Agents"),Rn=i(),B=r("p"),$l=s("We provide three types of agents: "),sr=r("a"),yl=s("HfAgent"),wl=s(" uses inference endpoints for opensource models, "),lr=r("a"),Al=s("LocalAgent"),El=s(" uses a model of your choice locally and "),ir=r("a"),Tl=s("OpenAiAgent"),kl=s(" uses OpenAI closed models."),Zn=i(),pe=r("h3"),Se=r("a"),Nr=r("span"),g(Lt.$$.fragment),xl=i(),Or=r("span"),Il=s("HfAgent"),Ln=i(),ee=r("div"),g(St.$$.fragment),Ml=i(),Rr=r("p"),Pl=s("Agent that uses an inference endpoint to generate code."),jl=i(),g(We.$$.fragment),Sn=i(),he=r("h3"),Ge=r("a"),Zr=r("span"),g(Wt.$$.fragment),Jl=i(),Lr=r("span"),Ul=s("LocalAgent"),Wn=i(),Z=r("div"),g(Gt.$$.fragment),Dl=i(),Sr=r("p"),Hl=s("Agent that uses a local model and tokenizer to generate code."),Cl=i(),g(qe.$$.fragment),Nl=i(),ne=r("div"),g(qt.$$.fragment),Ol=i(),zt=r("p"),Rl=s("Convenience method to build a "),Wr=r("code"),Zl=s("LocalAgent"),Ll=s(" from a pretrained checkpoint."),Sl=i(),g(ze.$$.fragment),Gn=i(),fe=r("h3"),Ve=r("a"),Gr=r("span"),g(Vt.$$.fragment),Wl=i(),qr=r("span"),Gl=s("OpenAiAgent"),qn=i(),L=r("div"),g(Bt.$$.fragment),ql=i(),zr=r("p"),zl=s("Agent that uses the openai API to generate code."),Vl=i(),g(Be.$$.fragment),Bl=i(),g(Ye.$$.fragment),zn=i(),ue=r("h3"),Fe=r("a"),Vr=r("span"),g(Yt.$$.fragment),Yl=i(),Br=r("span"),Fl=s("AzureOpenAiAgent"),Vn=i(),S=r("div"),g(Ft.$$.fragment),Ql=i(),Qt=r("p"),Xl=s("Agent that uses Azure OpenAI to generate code. See the "),Xt=r("a"),Kl=s(`official
documentation`),ei=s(` to learn how to deploy an openAI
model on Azure`),ti=i(),g(Qe.$$.fragment),oi=i(),g(Xe.$$.fragment),Bn=i(),ge=r("h3"),Ke=r("a"),Yr=r("span"),g(Kt.$$.fragment),ri=i(),Fr=r("span"),ai=s("Agent"),Yn=i(),C=r("div"),g(eo.$$.fragment),ni=i(),Qr=r("p"),si=s("Base class for all agents which contains the main API methods."),li=i(),se=r("div"),g(to.$$.fragment),ii=i(),Xr=r("p"),di=s("Sends a new request to the agent in a chat. Will use the previous ones in its history."),ci=i(),g(et.$$.fragment),mi=i(),le=r("div"),g(oo.$$.fragment),pi=i(),Kr=r("p"),hi=s("Sends a request to the agent."),fi=i(),g(tt.$$.fragment),ui=i(),ot=r("div"),g(ro.$$.fragment),gi=i(),ao=r("p"),_i=s("Clears the history of prior calls to "),dr=r("a"),vi=s("chat()"),bi=s("."),Fn=i(),_e=r("h2"),rt=r("a"),ea=r("span"),g(no.$$.fragment),$i=i(),ta=r("span"),yi=s("Tools"),Qn=i(),ve=r("h3"),at=r("a"),oa=r("span"),g(so.$$.fragment),wi=i(),ra=r("span"),Ai=s("load_tool"),Xn=i(),be=r("div"),g(lo.$$.fragment),Ei=i(),aa=r("p"),Ti=s("Main function to quickly load a tool, be it on the Hub or in the Transformers library."),Kn=i(),$e=r("h3"),nt=r("a"),na=r("span"),g(io.$$.fragment),ki=i(),sa=r("span"),xi=s("Tool"),es=i(),x=r("div"),g(co.$$.fragment),Ii=i(),mo=r("p"),Mi=s("A base class for the functions used by the agent. Subclass this and implement the "),la=r("code"),Pi=s("__call__"),ji=s(` method as well as the
following class attributes:`),Ji=i(),te=r("ul"),Y=r("li"),ia=r("strong"),Ui=s("description"),Di=s(" ("),da=r("code"),Hi=s("str"),Ci=s(`) \u2014 A short description of what your tool does, the inputs it expects and the output(s) it
will return. For instance \u2018This is a tool that downloads a file from a `),ca=r("code"),Ni=s("url"),Oi=s(". It takes the "),ma=r("code"),Ri=s("url"),Zi=s(` as input, and
returns the text contained in the file\u2019.`),Li=i(),F=r("li"),pa=r("strong"),Si=s("name"),Wi=s(" ("),ha=r("code"),Gi=s("str"),qi=s(`) \u2014 A performative name that will be used for your tool in the prompt to the agent. For instance
`),fa=r("code"),zi=s('"text-classifier"'),Vi=s(" or "),ua=r("code"),Bi=s('"image_generator"'),Yi=s("."),Fi=i(),U=r("li"),ga=r("strong"),Qi=s("inputs"),Xi=s(" ("),_a=r("code"),Ki=s("List[str]"),ed=s(`) \u2014 The list of modalities expected for the inputs (in the same order as in the call).
Modalitiies should be `),va=r("code"),td=s('"text"'),od=s(", "),ba=r("code"),rd=s('"image"'),ad=s(" or "),$a=r("code"),nd=s('"audio"'),sd=s(". This is only used by "),ya=r("code"),ld=s("launch_gradio_demo"),id=s(` or to make a
nice space from your tool.`),dd=i(),D=r("li"),wa=r("strong"),cd=s("outputs"),md=s(" ("),Aa=r("code"),pd=s("List[str]"),hd=s(`) \u2014 The list of modalities returned but the tool (in the same order as the return of the
call method). Modalitiies should be `),Ea=r("code"),fd=s('"text"'),ud=s(", "),Ta=r("code"),gd=s('"image"'),_d=s(" or "),ka=r("code"),vd=s('"audio"'),bd=s(". This is only used by "),xa=r("code"),$d=s("launch_gradio_demo"),yd=s(`
or to make a nice space from your tool.`),wd=i(),ye=r("p"),Ad=s("You can also override the method "),cr=r("a"),Ed=s("setup()"),Td=s(` if your tool as an expensive operation to perform before being
usable (such as loading a model). `),mr=r("a"),kd=s("setup()"),xd=s(` will be called the first time you use your tool, but not at
instantiation.`),Id=i(),st=r("div"),g(po.$$.fragment),Md=i(),ho=r("p"),Pd=s("Creates a "),pr=r("a"),jd=s("Tool"),Jd=s(" from a gradio tool."),Ud=i(),lt=r("div"),g(fo.$$.fragment),Dd=i(),Ia=r("p"),Hd=s("Loads a tool defined on the Hub."),Cd=i(),it=r("div"),g(uo.$$.fragment),Nd=i(),Ma=r("p"),Od=s("Upload the tool to the Hub."),Rd=i(),Q=r("div"),g(go.$$.fragment),Zd=i(),_o=r("p"),Ld=s(`Saves the relevant code files for your tool so it can be pushed to the Hub. This will copy the code of your
tool in `),Pa=r("code"),Sd=s("output_dir"),Wd=s(" as well as autogenerate:"),Gd=i(),we=r("ul"),hr=r("li"),qd=s("a config file named "),ja=r("code"),zd=s("tool_config.json"),Vd=i(),vo=r("li"),Bd=s("an "),Ja=r("code"),Yd=s("app.py"),Fd=s(" file so that your tool can be converted to a space"),Qd=i(),bo=r("li"),Xd=s("a "),Ua=r("code"),Kd=s("requirements.txt"),ec=s(` containing the names of the module used by your tool (as detected when inspecting its
code)`),tc=i(),$o=r("p"),oc=s("You should only use this method to save tools that are defined in a separate module (not "),Da=r("code"),rc=s("__main__"),ac=s(")."),nc=i(),dt=r("div"),g(yo.$$.fragment),sc=i(),Ha=r("p"),lc=s(`Overwrite this method here for any operation that is expensive and needs to be executed before you start using
your tool. Such as loading a big model.`),ts=i(),Ae=r("h3"),ct=r("a"),Ca=r("span"),g(wo.$$.fragment),ic=i(),Na=r("span"),dc=s("PipelineTool"),os=i(),P=r("div"),g(Ao.$$.fragment),cc=i(),Ee=r("p"),mc=s("A "),fr=r("a"),pc=s("Tool"),hc=s(" tailored towards Transformer models. On top of the class attributes of the base class "),ur=r("a"),fc=s("Tool"),uc=s(`, you will
need to specify:`),gc=i(),oe=r("ul"),mt=r("li"),Oa=r("strong"),_c=s("model_class"),vc=s(" ("),Ra=r("code"),bc=s("type"),$c=s(") \u2014 The class to use to load the model in this tool."),yc=i(),pt=r("li"),Za=r("strong"),wc=s("default_checkpoint"),Ac=s(" ("),La=r("code"),Ec=s("str"),Tc=s(") \u2014 The default checkpoint that should be used when the user doesn\u2019t specify one."),kc=i(),X=r("li"),Sa=r("strong"),xc=s("pre_processor_class"),Ic=s(" ("),Wa=r("code"),Mc=s("type"),Pc=s(", "),Ga=r("em"),jc=s("optional"),Jc=s(", defaults to "),gr=r("a"),Uc=s("AutoProcessor"),Dc=s(`) \u2014 The class to use to load the
pre-processor`),Hc=i(),K=r("li"),qa=r("strong"),Cc=s("post_processor_class"),Nc=s(" ("),za=r("code"),Oc=s("type"),Rc=s(", "),Va=r("em"),Zc=s("optional"),Lc=s(", defaults to "),_r=r("a"),Sc=s("AutoProcessor"),Wc=s(`) \u2014 The class to use to load the
post-processor (when different from the pre-processor).`),Gc=i(),ht=r("div"),g(Eo.$$.fragment),qc=i(),To=r("p"),zc=s("Uses the "),Ba=r("code"),Vc=s("post_processor"),Bc=s(" to decode the model output."),Yc=i(),ft=r("div"),g(ko.$$.fragment),Fc=i(),Te=r("p"),Qc=s("Uses the "),Ya=r("code"),Xc=s("pre_processor"),Kc=s(" to prepare the inputs for the "),Fa=r("code"),em=s("model"),tm=s("."),om=i(),ut=r("div"),g(xo.$$.fragment),rm=i(),Io=r("p"),am=s("Sends the inputs through the "),Qa=r("code"),nm=s("model"),sm=s("."),lm=i(),gt=r("div"),g(Mo.$$.fragment),im=i(),re=r("p"),dm=s("Instantiates the "),Xa=r("code"),cm=s("pre_processor"),mm=s(", "),Ka=r("code"),pm=s("model"),hm=s(" and "),en=r("code"),fm=s("post_processor"),um=s(" if necessary."),rs=i(),ke=r("h3"),_t=r("a"),tn=r("span"),g(Po.$$.fragment),gm=i(),on=r("span"),_m=s("RemoteTool"),as=i(),W=r("div"),g(jo.$$.fragment),vm=i(),Jo=r("p"),bm=s("A "),vr=r("a"),$m=s("Tool"),ym=s(" that will make requests to an inference endpoint."),wm=i(),vt=r("div"),g(Uo.$$.fragment),Am=i(),Do=r("p"),Em=s("You can override this method in your custom class of "),br=r("a"),Tm=s("RemoteTool"),km=s(` to apply some custom post-processing of the
outputs of the endpoint.`),xm=i(),ie=r("div"),g(Ho.$$.fragment),Im=i(),Co=r("p"),Mm=s(`Prepare the inputs received for the HTTP client sending data to the endpoint. Positional arguments will be
matched with the signature of the `),rn=r("code"),Pm=s("tool_class"),jm=s(` if it was provided at instantation. Images will be encoded into
bytes.`),Jm=i(),No=r("p"),Um=s("You can override this method in your custom class of "),$r=r("a"),Dm=s("RemoteTool"),Hm=s("."),ns=i(),xe=r("h3"),bt=r("a"),an=r("span"),g(Oo.$$.fragment),Cm=i(),nn=r("span"),Nm=s("launch_gradio_demo"),ss=i(),Ie=r("div"),g(Ro.$$.fragment),Om=i(),Me=r("p"),Rm=s(`Launches a gradio demo for a tool. The corresponding tool class needs to properly implement the class attributes
`),sn=r("code"),Zm=s("inputs"),Lm=s(" and "),ln=r("code"),Sm=s("outputs"),Wm=s("."),ls=i(),Pe=r("h2"),$t=r("a"),dn=r("span"),g(Zo.$$.fragment),Gm=i(),cn=r("span"),qm=s("Agent Types"),is=i(),yr=r("p"),zm=s(`Agents can handle any type of object in-between tools; tools, being completely multimodal, can accept and return
text, image, audio, video, among other types. In order to increase compatibility between tools, as well as to
correctly render these returns in ipython (jupyter, colab, ipython notebooks, \u2026), we implement wrapper classes
around these types.`),ds=i(),yt=r("p"),Vm=s(`The wrapped objects should continue behaving as initially; a text object should still behave as a string, an image
object should still behave as a `),mn=r("code"),Bm=s("PIL.Image"),Ym=s("."),cs=i(),wr=r("p"),Fm=s("These types have three specific purposes:"),ms=i(),de=r("ul"),Lo=r("li"),Qm=s("Calling "),pn=r("code"),Xm=s("to_raw"),Km=s(" on the type should return the underlying object"),ep=i(),je=r("li"),tp=s("Calling "),hn=r("code"),op=s("to_string"),rp=s(" on the type should return the object as a string: that can be the string in case of an "),fn=r("code"),ap=s("AgentText"),np=s(`
but will be the path of the serialized version of the object in other instances`),sp=i(),un=r("li"),lp=s("Displaying it in an ipython kernel should display the object correctly"),ps=i(),Je=r("h3"),wt=r("a"),gn=r("span"),g(So.$$.fragment),ip=i(),_n=r("span"),dp=s("AgentText"),hs=i(),Ue=r("div"),g(Wo.$$.fragment),cp=i(),vn=r("p"),mp=s("Text type returned by the agent. Behaves as a string."),fs=i(),De=r("h3"),At=r("a"),bn=r("span"),g(Go.$$.fragment),pp=i(),$n=r("span"),hp=s("AgentImage"),us=i(),G=r("div"),g(qo.$$.fragment),fp=i(),yn=r("p"),up=s("Image type returned by the agent. Behaves as a PIL.Image."),gp=i(),Et=r("div"),g(zo.$$.fragment),_p=i(),wn=r("p"),vp=s("Returns the \u201Craw\u201D version of that object. In the case of an AgentImage, it is a PIL.Image."),bp=i(),Tt=r("div"),g(Vo.$$.fragment),$p=i(),An=r("p"),yp=s(`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`),gs=i(),He=r("h3"),kt=r("a"),En=r("span"),g(Bo.$$.fragment),wp=i(),Tn=r("span"),Ap=s("AgentAudio"),_s=i(),q=r("div"),g(Yo.$$.fragment),Ep=i(),kn=r("p"),Tp=s("Audio type returned by the agent."),kp=i(),xt=r("div"),g(Fo.$$.fragment),xp=i(),Qo=r("p"),Ip=s("Returns the \u201Craw\u201D version of that object. It is a "),xn=r("code"),Mp=s("torch.Tensor"),Pp=s(" object."),jp=i(),It=r("div"),g(Xo.$$.fragment),Jp=i(),In=r("p"),Up=s(`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`),this.h()},l(t){const p=du('[data-svelte="svelte-1phssyn"]',document.head);f=a(p,"META",{name:!0,content:!0}),p.forEach(o),T=d(t),w=a(t,"H1",{class:!0});var Ko=n(w);u=a(Ko,"A",{id:!0,class:!0,href:!0});var Mn=n(u);E=a(Mn,"SPAN",{});var Pn=n(E);_(c.$$.fragment,Pn),Pn.forEach(o),Mn.forEach(o),A=d(Ko),R=a(Ko,"SPAN",{});var jn=n(R);H=l(jn,"Agents & Tools"),jn.forEach(o),Ko.forEach(o),M=d(t),_(N.$$.fragment,t),ae=d(t),Ze=a(t,"P",{});var er=n(Ze);ul=l(er,"To learn more about agents and tools make sure to read the "),nr=a(er,"A",{href:!0});var Jn=n(nr);gl=l(Jn,"introductory guide"),Jn.forEach(o),_l=l(er,`. This page
contains the API docs for the underlying classes.`),er.forEach(o),On=d(t),me=a(t,"H2",{class:!0});var tr=n(me);Le=a(tr,"A",{id:!0,class:!0,href:!0});var Un=n(Le);Hr=a(Un,"SPAN",{});var Dn=n(Hr);_(Zt.$$.fragment,Dn),Dn.forEach(o),Un.forEach(o),vl=d(tr),Cr=a(tr,"SPAN",{});var Hn=n(Cr);bl=l(Hn,"Agents"),Hn.forEach(o),tr.forEach(o),Rn=d(t),B=a(t,"P",{});var Mt=n(B);$l=l(Mt,"We provide three types of agents: "),sr=a(Mt,"A",{href:!0});var Cp=n(sr);yl=l(Cp,"HfAgent"),Cp.forEach(o),wl=l(Mt," uses inference endpoints for opensource models, "),lr=a(Mt,"A",{href:!0});var Np=n(lr);Al=l(Np,"LocalAgent"),Np.forEach(o),El=l(Mt," uses a model of your choice locally and "),ir=a(Mt,"A",{href:!0});var Op=n(ir);Tl=l(Op,"OpenAiAgent"),Op.forEach(o),kl=l(Mt," uses OpenAI closed models."),Mt.forEach(o),Zn=d(t),pe=a(t,"H3",{class:!0});var bs=n(pe);Se=a(bs,"A",{id:!0,class:!0,href:!0});var Rp=n(Se);Nr=a(Rp,"SPAN",{});var Zp=n(Nr);_(Lt.$$.fragment,Zp),Zp.forEach(o),Rp.forEach(o),xl=d(bs),Or=a(bs,"SPAN",{});var Lp=n(Or);Il=l(Lp,"HfAgent"),Lp.forEach(o),bs.forEach(o),Ln=d(t),ee=a(t,"DIV",{class:!0});var Ar=n(ee);_(St.$$.fragment,Ar),Ml=d(Ar),Rr=a(Ar,"P",{});var Sp=n(Rr);Pl=l(Sp,"Agent that uses an inference endpoint to generate code."),Sp.forEach(o),jl=d(Ar),_(We.$$.fragment,Ar),Ar.forEach(o),Sn=d(t),he=a(t,"H3",{class:!0});var $s=n(he);Ge=a($s,"A",{id:!0,class:!0,href:!0});var Wp=n(Ge);Zr=a(Wp,"SPAN",{});var Gp=n(Zr);_(Wt.$$.fragment,Gp),Gp.forEach(o),Wp.forEach(o),Jl=d($s),Lr=a($s,"SPAN",{});var qp=n(Lr);Ul=l(qp,"LocalAgent"),qp.forEach(o),$s.forEach(o),Wn=d(t),Z=a(t,"DIV",{class:!0});var Pt=n(Z);_(Gt.$$.fragment,Pt),Dl=d(Pt),Sr=a(Pt,"P",{});var zp=n(Sr);Hl=l(zp,"Agent that uses a local model and tokenizer to generate code."),zp.forEach(o),Cl=d(Pt),_(qe.$$.fragment,Pt),Nl=d(Pt),ne=a(Pt,"DIV",{class:!0});var Er=n(ne);_(qt.$$.fragment,Er),Ol=d(Er),zt=a(Er,"P",{});var ys=n(zt);Rl=l(ys,"Convenience method to build a "),Wr=a(ys,"CODE",{});var Vp=n(Wr);Zl=l(Vp,"LocalAgent"),Vp.forEach(o),Ll=l(ys," from a pretrained checkpoint."),ys.forEach(o),Sl=d(Er),_(ze.$$.fragment,Er),Er.forEach(o),Pt.forEach(o),Gn=d(t),fe=a(t,"H3",{class:!0});var ws=n(fe);Ve=a(ws,"A",{id:!0,class:!0,href:!0});var Bp=n(Ve);Gr=a(Bp,"SPAN",{});var Yp=n(Gr);_(Vt.$$.fragment,Yp),Yp.forEach(o),Bp.forEach(o),Wl=d(ws),qr=a(ws,"SPAN",{});var Fp=n(qr);Gl=l(Fp,"OpenAiAgent"),Fp.forEach(o),ws.forEach(o),qn=d(t),L=a(t,"DIV",{class:!0});var jt=n(L);_(Bt.$$.fragment,jt),ql=d(jt),zr=a(jt,"P",{});var Qp=n(zr);zl=l(Qp,"Agent that uses the openai API to generate code."),Qp.forEach(o),Vl=d(jt),_(Be.$$.fragment,jt),Bl=d(jt),_(Ye.$$.fragment,jt),jt.forEach(o),zn=d(t),ue=a(t,"H3",{class:!0});var As=n(ue);Fe=a(As,"A",{id:!0,class:!0,href:!0});var Xp=n(Fe);Vr=a(Xp,"SPAN",{});var Kp=n(Vr);_(Yt.$$.fragment,Kp),Kp.forEach(o),Xp.forEach(o),Yl=d(As),Br=a(As,"SPAN",{});var eh=n(Br);Fl=l(eh,"AzureOpenAiAgent"),eh.forEach(o),As.forEach(o),Vn=d(t),S=a(t,"DIV",{class:!0});var Jt=n(S);_(Ft.$$.fragment,Jt),Ql=d(Jt),Qt=a(Jt,"P",{});var Es=n(Qt);Xl=l(Es,"Agent that uses Azure OpenAI to generate code. See the "),Xt=a(Es,"A",{href:!0,rel:!0});var th=n(Xt);Kl=l(th,`official
documentation`),th.forEach(o),ei=l(Es,` to learn how to deploy an openAI
model on Azure`),Es.forEach(o),ti=d(Jt),_(Qe.$$.fragment,Jt),oi=d(Jt),_(Xe.$$.fragment,Jt),Jt.forEach(o),Bn=d(t),ge=a(t,"H3",{class:!0});var Ts=n(ge);Ke=a(Ts,"A",{id:!0,class:!0,href:!0});var oh=n(Ke);Yr=a(oh,"SPAN",{});var rh=n(Yr);_(Kt.$$.fragment,rh),rh.forEach(o),oh.forEach(o),ri=d(Ts),Fr=a(Ts,"SPAN",{});var ah=n(Fr);ai=l(ah,"Agent"),ah.forEach(o),Ts.forEach(o),Yn=d(t),C=a(t,"DIV",{class:!0});var ce=n(C);_(eo.$$.fragment,ce),ni=d(ce),Qr=a(ce,"P",{});var nh=n(Qr);si=l(nh,"Base class for all agents which contains the main API methods."),nh.forEach(o),li=d(ce),se=a(ce,"DIV",{class:!0});var Tr=n(se);_(to.$$.fragment,Tr),ii=d(Tr),Xr=a(Tr,"P",{});var sh=n(Xr);di=l(sh,"Sends a new request to the agent in a chat. Will use the previous ones in its history."),sh.forEach(o),ci=d(Tr),_(et.$$.fragment,Tr),Tr.forEach(o),mi=d(ce),le=a(ce,"DIV",{class:!0});var kr=n(le);_(oo.$$.fragment,kr),pi=d(kr),Kr=a(kr,"P",{});var lh=n(Kr);hi=l(lh,"Sends a request to the agent."),lh.forEach(o),fi=d(kr),_(tt.$$.fragment,kr),kr.forEach(o),ui=d(ce),ot=a(ce,"DIV",{class:!0});var ks=n(ot);_(ro.$$.fragment,ks),gi=d(ks),ao=a(ks,"P",{});var xs=n(ao);_i=l(xs,"Clears the history of prior calls to "),dr=a(xs,"A",{href:!0});var ih=n(dr);vi=l(ih,"chat()"),ih.forEach(o),bi=l(xs,"."),xs.forEach(o),ks.forEach(o),ce.forEach(o),Fn=d(t),_e=a(t,"H2",{class:!0});var Is=n(_e);rt=a(Is,"A",{id:!0,class:!0,href:!0});var dh=n(rt);ea=a(dh,"SPAN",{});var ch=n(ea);_(no.$$.fragment,ch),ch.forEach(o),dh.forEach(o),$i=d(Is),ta=a(Is,"SPAN",{});var mh=n(ta);yi=l(mh,"Tools"),mh.forEach(o),Is.forEach(o),Qn=d(t),ve=a(t,"H3",{class:!0});var Ms=n(ve);at=a(Ms,"A",{id:!0,class:!0,href:!0});var ph=n(at);oa=a(ph,"SPAN",{});var hh=n(oa);_(so.$$.fragment,hh),hh.forEach(o),ph.forEach(o),wi=d(Ms),ra=a(Ms,"SPAN",{});var fh=n(ra);Ai=l(fh,"load_tool"),fh.forEach(o),Ms.forEach(o),Xn=d(t),be=a(t,"DIV",{class:!0});var Ps=n(be);_(lo.$$.fragment,Ps),Ei=d(Ps),aa=a(Ps,"P",{});var uh=n(aa);Ti=l(uh,"Main function to quickly load a tool, be it on the Hub or in the Transformers library."),uh.forEach(o),Ps.forEach(o),Kn=d(t),$e=a(t,"H3",{class:!0});var js=n($e);nt=a(js,"A",{id:!0,class:!0,href:!0});var gh=n(nt);na=a(gh,"SPAN",{});var _h=n(na);_(io.$$.fragment,_h),_h.forEach(o),gh.forEach(o),ki=d(js),sa=a(js,"SPAN",{});var vh=n(sa);xi=l(vh,"Tool"),vh.forEach(o),js.forEach(o),es=d(t),x=a(t,"DIV",{class:!0});var j=n(x);_(co.$$.fragment,j),Ii=d(j),mo=a(j,"P",{});var Js=n(mo);Mi=l(Js,"A base class for the functions used by the agent. Subclass this and implement the "),la=a(Js,"CODE",{});var bh=n(la);Pi=l(bh,"__call__"),bh.forEach(o),ji=l(Js,` method as well as the
following class attributes:`),Js.forEach(o),Ji=d(j),te=a(j,"UL",{});var Ut=n(te);Y=a(Ut,"LI",{});var Ce=n(Y);ia=a(Ce,"STRONG",{});var $h=n(ia);Ui=l($h,"description"),$h.forEach(o),Di=l(Ce," ("),da=a(Ce,"CODE",{});var yh=n(da);Hi=l(yh,"str"),yh.forEach(o),Ci=l(Ce,`) \u2014 A short description of what your tool does, the inputs it expects and the output(s) it
will return. For instance \u2018This is a tool that downloads a file from a `),ca=a(Ce,"CODE",{});var wh=n(ca);Ni=l(wh,"url"),wh.forEach(o),Oi=l(Ce,". It takes the "),ma=a(Ce,"CODE",{});var Ah=n(ma);Ri=l(Ah,"url"),Ah.forEach(o),Zi=l(Ce,` as input, and
returns the text contained in the file\u2019.`),Ce.forEach(o),Li=d(Ut),F=a(Ut,"LI",{});var Ne=n(F);pa=a(Ne,"STRONG",{});var Eh=n(pa);Si=l(Eh,"name"),Eh.forEach(o),Wi=l(Ne," ("),ha=a(Ne,"CODE",{});var Th=n(ha);Gi=l(Th,"str"),Th.forEach(o),qi=l(Ne,`) \u2014 A performative name that will be used for your tool in the prompt to the agent. For instance
`),fa=a(Ne,"CODE",{});var kh=n(fa);zi=l(kh,'"text-classifier"'),kh.forEach(o),Vi=l(Ne," or "),ua=a(Ne,"CODE",{});var xh=n(ua);Bi=l(xh,'"image_generator"'),xh.forEach(o),Yi=l(Ne,"."),Ne.forEach(o),Fi=d(Ut),U=a(Ut,"LI",{});var z=n(U);ga=a(z,"STRONG",{});var Ih=n(ga);Qi=l(Ih,"inputs"),Ih.forEach(o),Xi=l(z," ("),_a=a(z,"CODE",{});var Mh=n(_a);Ki=l(Mh,"List[str]"),Mh.forEach(o),ed=l(z,`) \u2014 The list of modalities expected for the inputs (in the same order as in the call).
Modalitiies should be `),va=a(z,"CODE",{});var Ph=n(va);td=l(Ph,'"text"'),Ph.forEach(o),od=l(z,", "),ba=a(z,"CODE",{});var jh=n(ba);rd=l(jh,'"image"'),jh.forEach(o),ad=l(z," or "),$a=a(z,"CODE",{});var Jh=n($a);nd=l(Jh,'"audio"'),Jh.forEach(o),sd=l(z,". This is only used by "),ya=a(z,"CODE",{});var Uh=n(ya);ld=l(Uh,"launch_gradio_demo"),Uh.forEach(o),id=l(z,` or to make a
nice space from your tool.`),z.forEach(o),dd=d(Ut),D=a(Ut,"LI",{});var V=n(D);wa=a(V,"STRONG",{});var Dh=n(wa);cd=l(Dh,"outputs"),Dh.forEach(o),md=l(V," ("),Aa=a(V,"CODE",{});var Hh=n(Aa);pd=l(Hh,"List[str]"),Hh.forEach(o),hd=l(V,`) \u2014 The list of modalities returned but the tool (in the same order as the return of the
call method). Modalitiies should be `),Ea=a(V,"CODE",{});var Ch=n(Ea);fd=l(Ch,'"text"'),Ch.forEach(o),ud=l(V,", "),Ta=a(V,"CODE",{});var Nh=n(Ta);gd=l(Nh,'"image"'),Nh.forEach(o),_d=l(V," or "),ka=a(V,"CODE",{});var Oh=n(ka);vd=l(Oh,'"audio"'),Oh.forEach(o),bd=l(V,". This is only used by "),xa=a(V,"CODE",{});var Rh=n(xa);$d=l(Rh,"launch_gradio_demo"),Rh.forEach(o),yd=l(V,`
or to make a nice space from your tool.`),V.forEach(o),Ut.forEach(o),wd=d(j),ye=a(j,"P",{});var xr=n(ye);Ad=l(xr,"You can also override the method "),cr=a(xr,"A",{href:!0});var Zh=n(cr);Ed=l(Zh,"setup()"),Zh.forEach(o),Td=l(xr,` if your tool as an expensive operation to perform before being
usable (such as loading a model). `),mr=a(xr,"A",{href:!0});var Lh=n(mr);kd=l(Lh,"setup()"),Lh.forEach(o),xd=l(xr,` will be called the first time you use your tool, but not at
instantiation.`),xr.forEach(o),Id=d(j),st=a(j,"DIV",{class:!0});var Us=n(st);_(po.$$.fragment,Us),Md=d(Us),ho=a(Us,"P",{});var Ds=n(ho);Pd=l(Ds,"Creates a "),pr=a(Ds,"A",{href:!0});var Sh=n(pr);jd=l(Sh,"Tool"),Sh.forEach(o),Jd=l(Ds," from a gradio tool."),Ds.forEach(o),Us.forEach(o),Ud=d(j),lt=a(j,"DIV",{class:!0});var Hs=n(lt);_(fo.$$.fragment,Hs),Dd=d(Hs),Ia=a(Hs,"P",{});var Wh=n(Ia);Hd=l(Wh,"Loads a tool defined on the Hub."),Wh.forEach(o),Hs.forEach(o),Cd=d(j),it=a(j,"DIV",{class:!0});var Cs=n(it);_(uo.$$.fragment,Cs),Nd=d(Cs),Ma=a(Cs,"P",{});var Gh=n(Ma);Od=l(Gh,"Upload the tool to the Hub."),Gh.forEach(o),Cs.forEach(o),Rd=d(j),Q=a(j,"DIV",{class:!0});var Dt=n(Q);_(go.$$.fragment,Dt),Zd=d(Dt),_o=a(Dt,"P",{});var Ns=n(_o);Ld=l(Ns,`Saves the relevant code files for your tool so it can be pushed to the Hub. This will copy the code of your
tool in `),Pa=a(Ns,"CODE",{});var qh=n(Pa);Sd=l(qh,"output_dir"),qh.forEach(o),Wd=l(Ns," as well as autogenerate:"),Ns.forEach(o),Gd=d(Dt),we=a(Dt,"UL",{});var Ir=n(we);hr=a(Ir,"LI",{});var Dp=n(hr);qd=l(Dp,"a config file named "),ja=a(Dp,"CODE",{});var zh=n(ja);zd=l(zh,"tool_config.json"),zh.forEach(o),Dp.forEach(o),Vd=d(Ir),vo=a(Ir,"LI",{});var Os=n(vo);Bd=l(Os,"an "),Ja=a(Os,"CODE",{});var Vh=n(Ja);Yd=l(Vh,"app.py"),Vh.forEach(o),Fd=l(Os," file so that your tool can be converted to a space"),Os.forEach(o),Qd=d(Ir),bo=a(Ir,"LI",{});var Rs=n(bo);Xd=l(Rs,"a "),Ua=a(Rs,"CODE",{});var Bh=n(Ua);Kd=l(Bh,"requirements.txt"),Bh.forEach(o),ec=l(Rs,` containing the names of the module used by your tool (as detected when inspecting its
code)`),Rs.forEach(o),Ir.forEach(o),tc=d(Dt),$o=a(Dt,"P",{});var Zs=n($o);oc=l(Zs,"You should only use this method to save tools that are defined in a separate module (not "),Da=a(Zs,"CODE",{});var Yh=n(Da);rc=l(Yh,"__main__"),Yh.forEach(o),ac=l(Zs,")."),Zs.forEach(o),Dt.forEach(o),nc=d(j),dt=a(j,"DIV",{class:!0});var Ls=n(dt);_(yo.$$.fragment,Ls),sc=d(Ls),Ha=a(Ls,"P",{});var Fh=n(Ha);lc=l(Fh,`Overwrite this method here for any operation that is expensive and needs to be executed before you start using
your tool. Such as loading a big model.`),Fh.forEach(o),Ls.forEach(o),j.forEach(o),ts=d(t),Ae=a(t,"H3",{class:!0});var Ss=n(Ae);ct=a(Ss,"A",{id:!0,class:!0,href:!0});var Qh=n(ct);Ca=a(Qh,"SPAN",{});var Xh=n(Ca);_(wo.$$.fragment,Xh),Xh.forEach(o),Qh.forEach(o),ic=d(Ss),Na=a(Ss,"SPAN",{});var Kh=n(Na);dc=l(Kh,"PipelineTool"),Kh.forEach(o),Ss.forEach(o),os=d(t),P=a(t,"DIV",{class:!0});var O=n(P);_(Ao.$$.fragment,O),cc=d(O),Ee=a(O,"P",{});var Mr=n(Ee);mc=l(Mr,"A "),fr=a(Mr,"A",{href:!0});var ef=n(fr);pc=l(ef,"Tool"),ef.forEach(o),hc=l(Mr," tailored towards Transformer models. On top of the class attributes of the base class "),ur=a(Mr,"A",{href:!0});var tf=n(ur);fc=l(tf,"Tool"),tf.forEach(o),uc=l(Mr,`, you will
need to specify:`),Mr.forEach(o),gc=d(O),oe=a(O,"UL",{});var Ht=n(oe);mt=a(Ht,"LI",{});var Cn=n(mt);Oa=a(Cn,"STRONG",{});var of=n(Oa);_c=l(of,"model_class"),of.forEach(o),vc=l(Cn," ("),Ra=a(Cn,"CODE",{});var rf=n(Ra);bc=l(rf,"type"),rf.forEach(o),$c=l(Cn,") \u2014 The class to use to load the model in this tool."),Cn.forEach(o),yc=d(Ht),pt=a(Ht,"LI",{});var Nn=n(pt);Za=a(Nn,"STRONG",{});var af=n(Za);wc=l(af,"default_checkpoint"),af.forEach(o),Ac=l(Nn," ("),La=a(Nn,"CODE",{});var nf=n(La);Ec=l(nf,"str"),nf.forEach(o),Tc=l(Nn,") \u2014 The default checkpoint that should be used when the user doesn\u2019t specify one."),Nn.forEach(o),kc=d(Ht),X=a(Ht,"LI",{});var Oe=n(X);Sa=a(Oe,"STRONG",{});var sf=n(Sa);xc=l(sf,"pre_processor_class"),sf.forEach(o),Ic=l(Oe," ("),Wa=a(Oe,"CODE",{});var lf=n(Wa);Mc=l(lf,"type"),lf.forEach(o),Pc=l(Oe,", "),Ga=a(Oe,"EM",{});var df=n(Ga);jc=l(df,"optional"),df.forEach(o),Jc=l(Oe,", defaults to "),gr=a(Oe,"A",{href:!0});var cf=n(gr);Uc=l(cf,"AutoProcessor"),cf.forEach(o),Dc=l(Oe,`) \u2014 The class to use to load the
pre-processor`),Oe.forEach(o),Hc=d(Ht),K=a(Ht,"LI",{});var Re=n(K);qa=a(Re,"STRONG",{});var mf=n(qa);Cc=l(mf,"post_processor_class"),mf.forEach(o),Nc=l(Re," ("),za=a(Re,"CODE",{});var pf=n(za);Oc=l(pf,"type"),pf.forEach(o),Rc=l(Re,", "),Va=a(Re,"EM",{});var hf=n(Va);Zc=l(hf,"optional"),hf.forEach(o),Lc=l(Re,", defaults to "),_r=a(Re,"A",{href:!0});var ff=n(_r);Sc=l(ff,"AutoProcessor"),ff.forEach(o),Wc=l(Re,`) \u2014 The class to use to load the
post-processor (when different from the pre-processor).`),Re.forEach(o),Ht.forEach(o),Gc=d(O),ht=a(O,"DIV",{class:!0});var Ws=n(ht);_(Eo.$$.fragment,Ws),qc=d(Ws),To=a(Ws,"P",{});var Gs=n(To);zc=l(Gs,"Uses the "),Ba=a(Gs,"CODE",{});var uf=n(Ba);Vc=l(uf,"post_processor"),uf.forEach(o),Bc=l(Gs," to decode the model output."),Gs.forEach(o),Ws.forEach(o),Yc=d(O),ft=a(O,"DIV",{class:!0});var qs=n(ft);_(ko.$$.fragment,qs),Fc=d(qs),Te=a(qs,"P",{});var Pr=n(Te);Qc=l(Pr,"Uses the "),Ya=a(Pr,"CODE",{});var gf=n(Ya);Xc=l(gf,"pre_processor"),gf.forEach(o),Kc=l(Pr," to prepare the inputs for the "),Fa=a(Pr,"CODE",{});var _f=n(Fa);em=l(_f,"model"),_f.forEach(o),tm=l(Pr,"."),Pr.forEach(o),qs.forEach(o),om=d(O),ut=a(O,"DIV",{class:!0});var zs=n(ut);_(xo.$$.fragment,zs),rm=d(zs),Io=a(zs,"P",{});var Vs=n(Io);am=l(Vs,"Sends the inputs through the "),Qa=a(Vs,"CODE",{});var vf=n(Qa);nm=l(vf,"model"),vf.forEach(o),sm=l(Vs,"."),Vs.forEach(o),zs.forEach(o),lm=d(O),gt=a(O,"DIV",{class:!0});var Bs=n(gt);_(Mo.$$.fragment,Bs),im=d(Bs),re=a(Bs,"P",{});var Ct=n(re);dm=l(Ct,"Instantiates the "),Xa=a(Ct,"CODE",{});var bf=n(Xa);cm=l(bf,"pre_processor"),bf.forEach(o),mm=l(Ct,", "),Ka=a(Ct,"CODE",{});var $f=n(Ka);pm=l($f,"model"),$f.forEach(o),hm=l(Ct," and "),en=a(Ct,"CODE",{});var yf=n(en);fm=l(yf,"post_processor"),yf.forEach(o),um=l(Ct," if necessary."),Ct.forEach(o),Bs.forEach(o),O.forEach(o),rs=d(t),ke=a(t,"H3",{class:!0});var Ys=n(ke);_t=a(Ys,"A",{id:!0,class:!0,href:!0});var wf=n(_t);tn=a(wf,"SPAN",{});var Af=n(tn);_(Po.$$.fragment,Af),Af.forEach(o),wf.forEach(o),gm=d(Ys),on=a(Ys,"SPAN",{});var Ef=n(on);_m=l(Ef,"RemoteTool"),Ef.forEach(o),Ys.forEach(o),as=d(t),W=a(t,"DIV",{class:!0});var Nt=n(W);_(jo.$$.fragment,Nt),vm=d(Nt),Jo=a(Nt,"P",{});var Fs=n(Jo);bm=l(Fs,"A "),vr=a(Fs,"A",{href:!0});var Tf=n(vr);$m=l(Tf,"Tool"),Tf.forEach(o),ym=l(Fs," that will make requests to an inference endpoint."),Fs.forEach(o),wm=d(Nt),vt=a(Nt,"DIV",{class:!0});var Qs=n(vt);_(Uo.$$.fragment,Qs),Am=d(Qs),Do=a(Qs,"P",{});var Xs=n(Do);Em=l(Xs,"You can override this method in your custom class of "),br=a(Xs,"A",{href:!0});var kf=n(br);Tm=l(kf,"RemoteTool"),kf.forEach(o),km=l(Xs,` to apply some custom post-processing of the
outputs of the endpoint.`),Xs.forEach(o),Qs.forEach(o),xm=d(Nt),ie=a(Nt,"DIV",{class:!0});var jr=n(ie);_(Ho.$$.fragment,jr),Im=d(jr),Co=a(jr,"P",{});var Ks=n(Co);Mm=l(Ks,`Prepare the inputs received for the HTTP client sending data to the endpoint. Positional arguments will be
matched with the signature of the `),rn=a(Ks,"CODE",{});var xf=n(rn);Pm=l(xf,"tool_class"),xf.forEach(o),jm=l(Ks,` if it was provided at instantation. Images will be encoded into
bytes.`),Ks.forEach(o),Jm=d(jr),No=a(jr,"P",{});var el=n(No);Um=l(el,"You can override this method in your custom class of "),$r=a(el,"A",{href:!0});var If=n($r);Dm=l(If,"RemoteTool"),If.forEach(o),Hm=l(el,"."),el.forEach(o),jr.forEach(o),Nt.forEach(o),ns=d(t),xe=a(t,"H3",{class:!0});var tl=n(xe);bt=a(tl,"A",{id:!0,class:!0,href:!0});var Mf=n(bt);an=a(Mf,"SPAN",{});var Pf=n(an);_(Oo.$$.fragment,Pf),Pf.forEach(o),Mf.forEach(o),Cm=d(tl),nn=a(tl,"SPAN",{});var jf=n(nn);Nm=l(jf,"launch_gradio_demo"),jf.forEach(o),tl.forEach(o),ss=d(t),Ie=a(t,"DIV",{class:!0});var ol=n(Ie);_(Ro.$$.fragment,ol),Om=d(ol),Me=a(ol,"P",{});var Jr=n(Me);Rm=l(Jr,`Launches a gradio demo for a tool. The corresponding tool class needs to properly implement the class attributes
`),sn=a(Jr,"CODE",{});var Jf=n(sn);Zm=l(Jf,"inputs"),Jf.forEach(o),Lm=l(Jr," and "),ln=a(Jr,"CODE",{});var Uf=n(ln);Sm=l(Uf,"outputs"),Uf.forEach(o),Wm=l(Jr,"."),Jr.forEach(o),ol.forEach(o),ls=d(t),Pe=a(t,"H2",{class:!0});var rl=n(Pe);$t=a(rl,"A",{id:!0,class:!0,href:!0});var Df=n($t);dn=a(Df,"SPAN",{});var Hf=n(dn);_(Zo.$$.fragment,Hf),Hf.forEach(o),Df.forEach(o),Gm=d(rl),cn=a(rl,"SPAN",{});var Cf=n(cn);qm=l(Cf,"Agent Types"),Cf.forEach(o),rl.forEach(o),is=d(t),yr=a(t,"P",{});var Nf=n(yr);zm=l(Nf,`Agents can handle any type of object in-between tools; tools, being completely multimodal, can accept and return
text, image, audio, video, among other types. In order to increase compatibility between tools, as well as to
correctly render these returns in ipython (jupyter, colab, ipython notebooks, \u2026), we implement wrapper classes
around these types.`),Nf.forEach(o),ds=d(t),yt=a(t,"P",{});var al=n(yt);Vm=l(al,`The wrapped objects should continue behaving as initially; a text object should still behave as a string, an image
object should still behave as a `),mn=a(al,"CODE",{});var Of=n(mn);Bm=l(Of,"PIL.Image"),Of.forEach(o),Ym=l(al,"."),al.forEach(o),cs=d(t),wr=a(t,"P",{});var Rf=n(wr);Fm=l(Rf,"These types have three specific purposes:"),Rf.forEach(o),ms=d(t),de=a(t,"UL",{});var Ur=n(de);Lo=a(Ur,"LI",{});var nl=n(Lo);Qm=l(nl,"Calling "),pn=a(nl,"CODE",{});var Zf=n(pn);Xm=l(Zf,"to_raw"),Zf.forEach(o),Km=l(nl," on the type should return the underlying object"),nl.forEach(o),ep=d(Ur),je=a(Ur,"LI",{});var Dr=n(je);tp=l(Dr,"Calling "),hn=a(Dr,"CODE",{});var Lf=n(hn);op=l(Lf,"to_string"),Lf.forEach(o),rp=l(Dr," on the type should return the object as a string: that can be the string in case of an "),fn=a(Dr,"CODE",{});var Sf=n(fn);ap=l(Sf,"AgentText"),Sf.forEach(o),np=l(Dr,`
but will be the path of the serialized version of the object in other instances`),Dr.forEach(o),sp=d(Ur),un=a(Ur,"LI",{});var Wf=n(un);lp=l(Wf,"Displaying it in an ipython kernel should display the object correctly"),Wf.forEach(o),Ur.forEach(o),ps=d(t),Je=a(t,"H3",{class:!0});var sl=n(Je);wt=a(sl,"A",{id:!0,class:!0,href:!0});var Gf=n(wt);gn=a(Gf,"SPAN",{});var qf=n(gn);_(So.$$.fragment,qf),qf.forEach(o),Gf.forEach(o),ip=d(sl),_n=a(sl,"SPAN",{});var zf=n(_n);dp=l(zf,"AgentText"),zf.forEach(o),sl.forEach(o),hs=d(t),Ue=a(t,"DIV",{class:!0});var ll=n(Ue);_(Wo.$$.fragment,ll),cp=d(ll),vn=a(ll,"P",{});var Vf=n(vn);mp=l(Vf,"Text type returned by the agent. Behaves as a string."),Vf.forEach(o),ll.forEach(o),fs=d(t),De=a(t,"H3",{class:!0});var il=n(De);At=a(il,"A",{id:!0,class:!0,href:!0});var Bf=n(At);bn=a(Bf,"SPAN",{});var Yf=n(bn);_(Go.$$.fragment,Yf),Yf.forEach(o),Bf.forEach(o),pp=d(il),$n=a(il,"SPAN",{});var Ff=n($n);hp=l(Ff,"AgentImage"),Ff.forEach(o),il.forEach(o),us=d(t),G=a(t,"DIV",{class:!0});var Ot=n(G);_(qo.$$.fragment,Ot),fp=d(Ot),yn=a(Ot,"P",{});var Qf=n(yn);up=l(Qf,"Image type returned by the agent. Behaves as a PIL.Image."),Qf.forEach(o),gp=d(Ot),Et=a(Ot,"DIV",{class:!0});var dl=n(Et);_(zo.$$.fragment,dl),_p=d(dl),wn=a(dl,"P",{});var Xf=n(wn);vp=l(Xf,"Returns the \u201Craw\u201D version of that object. In the case of an AgentImage, it is a PIL.Image."),Xf.forEach(o),dl.forEach(o),bp=d(Ot),Tt=a(Ot,"DIV",{class:!0});var cl=n(Tt);_(Vo.$$.fragment,cl),$p=d(cl),An=a(cl,"P",{});var Kf=n(An);yp=l(Kf,`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`),Kf.forEach(o),cl.forEach(o),Ot.forEach(o),gs=d(t),He=a(t,"H3",{class:!0});var ml=n(He);kt=a(ml,"A",{id:!0,class:!0,href:!0});var eu=n(kt);En=a(eu,"SPAN",{});var tu=n(En);_(Bo.$$.fragment,tu),tu.forEach(o),eu.forEach(o),wp=d(ml),Tn=a(ml,"SPAN",{});var ou=n(Tn);Ap=l(ou,"AgentAudio"),ou.forEach(o),ml.forEach(o),_s=d(t),q=a(t,"DIV",{class:!0});var Rt=n(q);_(Yo.$$.fragment,Rt),Ep=d(Rt),kn=a(Rt,"P",{});var ru=n(kn);Tp=l(ru,"Audio type returned by the agent."),ru.forEach(o),kp=d(Rt),xt=a(Rt,"DIV",{class:!0});var pl=n(xt);_(Fo.$$.fragment,pl),xp=d(pl),Qo=a(pl,"P",{});var hl=n(Qo);Ip=l(hl,"Returns the \u201Craw\u201D version of that object. It is a "),xn=a(hl,"CODE",{});var au=n(xn);Mp=l(au,"torch.Tensor"),au.forEach(o),Pp=l(hl," object."),hl.forEach(o),pl.forEach(o),jp=d(Rt),It=a(Rt,"DIV",{class:!0});var fl=n(It);_(Xo.$$.fragment,fl),Jp=d(fl),In=a(fl,"P",{});var nu=n(In);Up=l(nu,`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`),nu.forEach(o),fl.forEach(o),Rt.forEach(o),this.h()},h(){m(f,"name","hf:doc:metadata"),m(f,"content",JSON.stringify(wu)),m(u,"id","agents-tools"),m(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(u,"href","#agents-tools"),m(w,"class","relative group"),m(nr,"href","../transformers_agents"),m(Le,"id","agents"),m(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Le,"href","#agents"),m(me,"class","relative group"),m(sr,"href","/docs/transformers/main/en/main_classes/agent#transformers.HfAgent"),m(lr,"href","/docs/transformers/main/en/main_classes/agent#transformers.LocalAgent"),m(ir,"href","/docs/transformers/main/en/main_classes/agent#transformers.OpenAiAgent"),m(Se,"id","transformers.HfAgent"),m(Se,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Se,"href","#transformers.HfAgent"),m(pe,"class","relative group"),m(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ge,"id","transformers.LocalAgent"),m(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ge,"href","#transformers.LocalAgent"),m(he,"class","relative group"),m(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ve,"id","transformers.OpenAiAgent"),m(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ve,"href","#transformers.OpenAiAgent"),m(fe,"class","relative group"),m(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Fe,"id","transformers.AzureOpenAiAgent"),m(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Fe,"href","#transformers.AzureOpenAiAgent"),m(ue,"class","relative group"),m(Xt,"href","https://learn.microsoft.com/en-us/azure/cognitive-services/openai/"),m(Xt,"rel","nofollow"),m(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Ke,"id","transformers.Agent"),m(Ke,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(Ke,"href","#transformers.Agent"),m(ge,"class","relative group"),m(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(dr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Agent.chat"),m(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(rt,"id","tools"),m(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(rt,"href","#tools"),m(_e,"class","relative group"),m(at,"id","transformers.load_tool"),m(at,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(at,"href","#transformers.load_tool"),m(ve,"class","relative group"),m(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(nt,"id","transformers.Tool"),m(nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(nt,"href","#transformers.Tool"),m($e,"class","relative group"),m(cr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool.setup"),m(mr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool.setup"),m(pr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool"),m(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ct,"id","transformers.PipelineTool"),m(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(ct,"href","#transformers.PipelineTool"),m(Ae,"class","relative group"),m(fr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool"),m(ur,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool"),m(gr,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoProcessor"),m(_r,"href","/docs/transformers/main/en/model_doc/auto#transformers.AutoProcessor"),m(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(_t,"id","transformers.RemoteTool"),m(_t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(_t,"href","#transformers.RemoteTool"),m(ke,"class","relative group"),m(vr,"href","/docs/transformers/main/en/main_classes/agent#transformers.Tool"),m(br,"href","/docs/transformers/main/en/main_classes/agent#transformers.RemoteTool"),m(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($r,"href","/docs/transformers/main/en/main_classes/agent#transformers.RemoteTool"),m(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(bt,"id","transformers.launch_gradio_demo"),m(bt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(bt,"href","#transformers.launch_gradio_demo"),m(xe,"class","relative group"),m(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m($t,"id","agent-types"),m($t,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m($t,"href","#agent-types"),m(Pe,"class","relative group"),m(wt,"id","transformers.tools.agent_types.AgentText"),m(wt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(wt,"href","#transformers.tools.agent_types.AgentText"),m(Je,"class","relative group"),m(Ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(At,"id","transformers.tools.agent_types.AgentImage"),m(At,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(At,"href","#transformers.tools.agent_types.AgentImage"),m(De,"class","relative group"),m(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(kt,"id","transformers.tools.agent_types.AgentAudio"),m(kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),m(kt,"href","#transformers.tools.agent_types.AgentAudio"),m(He,"class","relative group"),m(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),m(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,p){e(document.head,f),h(t,T,p),h(t,w,p),e(w,u),e(u,E),v(c,E,null),e(w,A),e(w,R),e(R,H),h(t,M,p),v(N,t,p),h(t,ae,p),h(t,Ze,p),e(Ze,ul),e(Ze,nr),e(nr,gl),e(Ze,_l),h(t,On,p),h(t,me,p),e(me,Le),e(Le,Hr),v(Zt,Hr,null),e(me,vl),e(me,Cr),e(Cr,bl),h(t,Rn,p),h(t,B,p),e(B,$l),e(B,sr),e(sr,yl),e(B,wl),e(B,lr),e(lr,Al),e(B,El),e(B,ir),e(ir,Tl),e(B,kl),h(t,Zn,p),h(t,pe,p),e(pe,Se),e(Se,Nr),v(Lt,Nr,null),e(pe,xl),e(pe,Or),e(Or,Il),h(t,Ln,p),h(t,ee,p),v(St,ee,null),e(ee,Ml),e(ee,Rr),e(Rr,Pl),e(ee,jl),v(We,ee,null),h(t,Sn,p),h(t,he,p),e(he,Ge),e(Ge,Zr),v(Wt,Zr,null),e(he,Jl),e(he,Lr),e(Lr,Ul),h(t,Wn,p),h(t,Z,p),v(Gt,Z,null),e(Z,Dl),e(Z,Sr),e(Sr,Hl),e(Z,Cl),v(qe,Z,null),e(Z,Nl),e(Z,ne),v(qt,ne,null),e(ne,Ol),e(ne,zt),e(zt,Rl),e(zt,Wr),e(Wr,Zl),e(zt,Ll),e(ne,Sl),v(ze,ne,null),h(t,Gn,p),h(t,fe,p),e(fe,Ve),e(Ve,Gr),v(Vt,Gr,null),e(fe,Wl),e(fe,qr),e(qr,Gl),h(t,qn,p),h(t,L,p),v(Bt,L,null),e(L,ql),e(L,zr),e(zr,zl),e(L,Vl),v(Be,L,null),e(L,Bl),v(Ye,L,null),h(t,zn,p),h(t,ue,p),e(ue,Fe),e(Fe,Vr),v(Yt,Vr,null),e(ue,Yl),e(ue,Br),e(Br,Fl),h(t,Vn,p),h(t,S,p),v(Ft,S,null),e(S,Ql),e(S,Qt),e(Qt,Xl),e(Qt,Xt),e(Xt,Kl),e(Qt,ei),e(S,ti),v(Qe,S,null),e(S,oi),v(Xe,S,null),h(t,Bn,p),h(t,ge,p),e(ge,Ke),e(Ke,Yr),v(Kt,Yr,null),e(ge,ri),e(ge,Fr),e(Fr,ai),h(t,Yn,p),h(t,C,p),v(eo,C,null),e(C,ni),e(C,Qr),e(Qr,si),e(C,li),e(C,se),v(to,se,null),e(se,ii),e(se,Xr),e(Xr,di),e(se,ci),v(et,se,null),e(C,mi),e(C,le),v(oo,le,null),e(le,pi),e(le,Kr),e(Kr,hi),e(le,fi),v(tt,le,null),e(C,ui),e(C,ot),v(ro,ot,null),e(ot,gi),e(ot,ao),e(ao,_i),e(ao,dr),e(dr,vi),e(ao,bi),h(t,Fn,p),h(t,_e,p),e(_e,rt),e(rt,ea),v(no,ea,null),e(_e,$i),e(_e,ta),e(ta,yi),h(t,Qn,p),h(t,ve,p),e(ve,at),e(at,oa),v(so,oa,null),e(ve,wi),e(ve,ra),e(ra,Ai),h(t,Xn,p),h(t,be,p),v(lo,be,null),e(be,Ei),e(be,aa),e(aa,Ti),h(t,Kn,p),h(t,$e,p),e($e,nt),e(nt,na),v(io,na,null),e($e,ki),e($e,sa),e(sa,xi),h(t,es,p),h(t,x,p),v(co,x,null),e(x,Ii),e(x,mo),e(mo,Mi),e(mo,la),e(la,Pi),e(mo,ji),e(x,Ji),e(x,te),e(te,Y),e(Y,ia),e(ia,Ui),e(Y,Di),e(Y,da),e(da,Hi),e(Y,Ci),e(Y,ca),e(ca,Ni),e(Y,Oi),e(Y,ma),e(ma,Ri),e(Y,Zi),e(te,Li),e(te,F),e(F,pa),e(pa,Si),e(F,Wi),e(F,ha),e(ha,Gi),e(F,qi),e(F,fa),e(fa,zi),e(F,Vi),e(F,ua),e(ua,Bi),e(F,Yi),e(te,Fi),e(te,U),e(U,ga),e(ga,Qi),e(U,Xi),e(U,_a),e(_a,Ki),e(U,ed),e(U,va),e(va,td),e(U,od),e(U,ba),e(ba,rd),e(U,ad),e(U,$a),e($a,nd),e(U,sd),e(U,ya),e(ya,ld),e(U,id),e(te,dd),e(te,D),e(D,wa),e(wa,cd),e(D,md),e(D,Aa),e(Aa,pd),e(D,hd),e(D,Ea),e(Ea,fd),e(D,ud),e(D,Ta),e(Ta,gd),e(D,_d),e(D,ka),e(ka,vd),e(D,bd),e(D,xa),e(xa,$d),e(D,yd),e(x,wd),e(x,ye),e(ye,Ad),e(ye,cr),e(cr,Ed),e(ye,Td),e(ye,mr),e(mr,kd),e(ye,xd),e(x,Id),e(x,st),v(po,st,null),e(st,Md),e(st,ho),e(ho,Pd),e(ho,pr),e(pr,jd),e(ho,Jd),e(x,Ud),e(x,lt),v(fo,lt,null),e(lt,Dd),e(lt,Ia),e(Ia,Hd),e(x,Cd),e(x,it),v(uo,it,null),e(it,Nd),e(it,Ma),e(Ma,Od),e(x,Rd),e(x,Q),v(go,Q,null),e(Q,Zd),e(Q,_o),e(_o,Ld),e(_o,Pa),e(Pa,Sd),e(_o,Wd),e(Q,Gd),e(Q,we),e(we,hr),e(hr,qd),e(hr,ja),e(ja,zd),e(we,Vd),e(we,vo),e(vo,Bd),e(vo,Ja),e(Ja,Yd),e(vo,Fd),e(we,Qd),e(we,bo),e(bo,Xd),e(bo,Ua),e(Ua,Kd),e(bo,ec),e(Q,tc),e(Q,$o),e($o,oc),e($o,Da),e(Da,rc),e($o,ac),e(x,nc),e(x,dt),v(yo,dt,null),e(dt,sc),e(dt,Ha),e(Ha,lc),h(t,ts,p),h(t,Ae,p),e(Ae,ct),e(ct,Ca),v(wo,Ca,null),e(Ae,ic),e(Ae,Na),e(Na,dc),h(t,os,p),h(t,P,p),v(Ao,P,null),e(P,cc),e(P,Ee),e(Ee,mc),e(Ee,fr),e(fr,pc),e(Ee,hc),e(Ee,ur),e(ur,fc),e(Ee,uc),e(P,gc),e(P,oe),e(oe,mt),e(mt,Oa),e(Oa,_c),e(mt,vc),e(mt,Ra),e(Ra,bc),e(mt,$c),e(oe,yc),e(oe,pt),e(pt,Za),e(Za,wc),e(pt,Ac),e(pt,La),e(La,Ec),e(pt,Tc),e(oe,kc),e(oe,X),e(X,Sa),e(Sa,xc),e(X,Ic),e(X,Wa),e(Wa,Mc),e(X,Pc),e(X,Ga),e(Ga,jc),e(X,Jc),e(X,gr),e(gr,Uc),e(X,Dc),e(oe,Hc),e(oe,K),e(K,qa),e(qa,Cc),e(K,Nc),e(K,za),e(za,Oc),e(K,Rc),e(K,Va),e(Va,Zc),e(K,Lc),e(K,_r),e(_r,Sc),e(K,Wc),e(P,Gc),e(P,ht),v(Eo,ht,null),e(ht,qc),e(ht,To),e(To,zc),e(To,Ba),e(Ba,Vc),e(To,Bc),e(P,Yc),e(P,ft),v(ko,ft,null),e(ft,Fc),e(ft,Te),e(Te,Qc),e(Te,Ya),e(Ya,Xc),e(Te,Kc),e(Te,Fa),e(Fa,em),e(Te,tm),e(P,om),e(P,ut),v(xo,ut,null),e(ut,rm),e(ut,Io),e(Io,am),e(Io,Qa),e(Qa,nm),e(Io,sm),e(P,lm),e(P,gt),v(Mo,gt,null),e(gt,im),e(gt,re),e(re,dm),e(re,Xa),e(Xa,cm),e(re,mm),e(re,Ka),e(Ka,pm),e(re,hm),e(re,en),e(en,fm),e(re,um),h(t,rs,p),h(t,ke,p),e(ke,_t),e(_t,tn),v(Po,tn,null),e(ke,gm),e(ke,on),e(on,_m),h(t,as,p),h(t,W,p),v(jo,W,null),e(W,vm),e(W,Jo),e(Jo,bm),e(Jo,vr),e(vr,$m),e(Jo,ym),e(W,wm),e(W,vt),v(Uo,vt,null),e(vt,Am),e(vt,Do),e(Do,Em),e(Do,br),e(br,Tm),e(Do,km),e(W,xm),e(W,ie),v(Ho,ie,null),e(ie,Im),e(ie,Co),e(Co,Mm),e(Co,rn),e(rn,Pm),e(Co,jm),e(ie,Jm),e(ie,No),e(No,Um),e(No,$r),e($r,Dm),e(No,Hm),h(t,ns,p),h(t,xe,p),e(xe,bt),e(bt,an),v(Oo,an,null),e(xe,Cm),e(xe,nn),e(nn,Nm),h(t,ss,p),h(t,Ie,p),v(Ro,Ie,null),e(Ie,Om),e(Ie,Me),e(Me,Rm),e(Me,sn),e(sn,Zm),e(Me,Lm),e(Me,ln),e(ln,Sm),e(Me,Wm),h(t,ls,p),h(t,Pe,p),e(Pe,$t),e($t,dn),v(Zo,dn,null),e(Pe,Gm),e(Pe,cn),e(cn,qm),h(t,is,p),h(t,yr,p),e(yr,zm),h(t,ds,p),h(t,yt,p),e(yt,Vm),e(yt,mn),e(mn,Bm),e(yt,Ym),h(t,cs,p),h(t,wr,p),e(wr,Fm),h(t,ms,p),h(t,de,p),e(de,Lo),e(Lo,Qm),e(Lo,pn),e(pn,Xm),e(Lo,Km),e(de,ep),e(de,je),e(je,tp),e(je,hn),e(hn,op),e(je,rp),e(je,fn),e(fn,ap),e(je,np),e(de,sp),e(de,un),e(un,lp),h(t,ps,p),h(t,Je,p),e(Je,wt),e(wt,gn),v(So,gn,null),e(Je,ip),e(Je,_n),e(_n,dp),h(t,hs,p),h(t,Ue,p),v(Wo,Ue,null),e(Ue,cp),e(Ue,vn),e(vn,mp),h(t,fs,p),h(t,De,p),e(De,At),e(At,bn),v(Go,bn,null),e(De,pp),e(De,$n),e($n,hp),h(t,us,p),h(t,G,p),v(qo,G,null),e(G,fp),e(G,yn),e(yn,up),e(G,gp),e(G,Et),v(zo,Et,null),e(Et,_p),e(Et,wn),e(wn,vp),e(G,bp),e(G,Tt),v(Vo,Tt,null),e(Tt,$p),e(Tt,An),e(An,yp),h(t,gs,p),h(t,He,p),e(He,kt),e(kt,En),v(Bo,En,null),e(He,wp),e(He,Tn),e(Tn,Ap),h(t,_s,p),h(t,q,p),v(Yo,q,null),e(q,Ep),e(q,kn),e(kn,Tp),e(q,kp),e(q,xt),v(Fo,xt,null),e(xt,xp),e(xt,Qo),e(Qo,Ip),e(Qo,xn),e(xn,Mp),e(Qo,Pp),e(q,jp),e(q,It),v(Xo,It,null),e(It,Jp),e(It,In),e(In,Up),vs=!0},p(t,[p]){const Ko={};p&2&&(Ko.$$scope={dirty:p,ctx:t}),N.$set(Ko);const Mn={};p&2&&(Mn.$$scope={dirty:p,ctx:t}),We.$set(Mn);const Pn={};p&2&&(Pn.$$scope={dirty:p,ctx:t}),qe.$set(Pn);const jn={};p&2&&(jn.$$scope={dirty:p,ctx:t}),ze.$set(jn);const er={};p&2&&(er.$$scope={dirty:p,ctx:t}),Be.$set(er);const Jn={};p&2&&(Jn.$$scope={dirty:p,ctx:t}),Ye.$set(Jn);const tr={};p&2&&(tr.$$scope={dirty:p,ctx:t}),Qe.$set(tr);const Un={};p&2&&(Un.$$scope={dirty:p,ctx:t}),Xe.$set(Un);const Dn={};p&2&&(Dn.$$scope={dirty:p,ctx:t}),et.$set(Dn);const Hn={};p&2&&(Hn.$$scope={dirty:p,ctx:t}),tt.$set(Hn)},i(t){vs||(b(c.$$.fragment,t),b(N.$$.fragment,t),b(Zt.$$.fragment,t),b(Lt.$$.fragment,t),b(St.$$.fragment,t),b(We.$$.fragment,t),b(Wt.$$.fragment,t),b(Gt.$$.fragment,t),b(qe.$$.fragment,t),b(qt.$$.fragment,t),b(ze.$$.fragment,t),b(Vt.$$.fragment,t),b(Bt.$$.fragment,t),b(Be.$$.fragment,t),b(Ye.$$.fragment,t),b(Yt.$$.fragment,t),b(Ft.$$.fragment,t),b(Qe.$$.fragment,t),b(Xe.$$.fragment,t),b(Kt.$$.fragment,t),b(eo.$$.fragment,t),b(to.$$.fragment,t),b(et.$$.fragment,t),b(oo.$$.fragment,t),b(tt.$$.fragment,t),b(ro.$$.fragment,t),b(no.$$.fragment,t),b(so.$$.fragment,t),b(lo.$$.fragment,t),b(io.$$.fragment,t),b(co.$$.fragment,t),b(po.$$.fragment,t),b(fo.$$.fragment,t),b(uo.$$.fragment,t),b(go.$$.fragment,t),b(yo.$$.fragment,t),b(wo.$$.fragment,t),b(Ao.$$.fragment,t),b(Eo.$$.fragment,t),b(ko.$$.fragment,t),b(xo.$$.fragment,t),b(Mo.$$.fragment,t),b(Po.$$.fragment,t),b(jo.$$.fragment,t),b(Uo.$$.fragment,t),b(Ho.$$.fragment,t),b(Oo.$$.fragment,t),b(Ro.$$.fragment,t),b(Zo.$$.fragment,t),b(So.$$.fragment,t),b(Wo.$$.fragment,t),b(Go.$$.fragment,t),b(qo.$$.fragment,t),b(zo.$$.fragment,t),b(Vo.$$.fragment,t),b(Bo.$$.fragment,t),b(Yo.$$.fragment,t),b(Fo.$$.fragment,t),b(Xo.$$.fragment,t),vs=!0)},o(t){$(c.$$.fragment,t),$(N.$$.fragment,t),$(Zt.$$.fragment,t),$(Lt.$$.fragment,t),$(St.$$.fragment,t),$(We.$$.fragment,t),$(Wt.$$.fragment,t),$(Gt.$$.fragment,t),$(qe.$$.fragment,t),$(qt.$$.fragment,t),$(ze.$$.fragment,t),$(Vt.$$.fragment,t),$(Bt.$$.fragment,t),$(Be.$$.fragment,t),$(Ye.$$.fragment,t),$(Yt.$$.fragment,t),$(Ft.$$.fragment,t),$(Qe.$$.fragment,t),$(Xe.$$.fragment,t),$(Kt.$$.fragment,t),$(eo.$$.fragment,t),$(to.$$.fragment,t),$(et.$$.fragment,t),$(oo.$$.fragment,t),$(tt.$$.fragment,t),$(ro.$$.fragment,t),$(no.$$.fragment,t),$(so.$$.fragment,t),$(lo.$$.fragment,t),$(io.$$.fragment,t),$(co.$$.fragment,t),$(po.$$.fragment,t),$(fo.$$.fragment,t),$(uo.$$.fragment,t),$(go.$$.fragment,t),$(yo.$$.fragment,t),$(wo.$$.fragment,t),$(Ao.$$.fragment,t),$(Eo.$$.fragment,t),$(ko.$$.fragment,t),$(xo.$$.fragment,t),$(Mo.$$.fragment,t),$(Po.$$.fragment,t),$(jo.$$.fragment,t),$(Uo.$$.fragment,t),$(Ho.$$.fragment,t),$(Oo.$$.fragment,t),$(Ro.$$.fragment,t),$(Zo.$$.fragment,t),$(So.$$.fragment,t),$(Wo.$$.fragment,t),$(Go.$$.fragment,t),$(qo.$$.fragment,t),$(zo.$$.fragment,t),$(Vo.$$.fragment,t),$(Bo.$$.fragment,t),$(Yo.$$.fragment,t),$(Fo.$$.fragment,t),$(Xo.$$.fragment,t),vs=!1},d(t){o(f),t&&o(T),t&&o(w),y(c),t&&o(M),y(N,t),t&&o(ae),t&&o(Ze),t&&o(On),t&&o(me),y(Zt),t&&o(Rn),t&&o(B),t&&o(Zn),t&&o(pe),y(Lt),t&&o(Ln),t&&o(ee),y(St),y(We),t&&o(Sn),t&&o(he),y(Wt),t&&o(Wn),t&&o(Z),y(Gt),y(qe),y(qt),y(ze),t&&o(Gn),t&&o(fe),y(Vt),t&&o(qn),t&&o(L),y(Bt),y(Be),y(Ye),t&&o(zn),t&&o(ue),y(Yt),t&&o(Vn),t&&o(S),y(Ft),y(Qe),y(Xe),t&&o(Bn),t&&o(ge),y(Kt),t&&o(Yn),t&&o(C),y(eo),y(to),y(et),y(oo),y(tt),y(ro),t&&o(Fn),t&&o(_e),y(no),t&&o(Qn),t&&o(ve),y(so),t&&o(Xn),t&&o(be),y(lo),t&&o(Kn),t&&o($e),y(io),t&&o(es),t&&o(x),y(co),y(po),y(fo),y(uo),y(go),y(yo),t&&o(ts),t&&o(Ae),y(wo),t&&o(os),t&&o(P),y(Ao),y(Eo),y(ko),y(xo),y(Mo),t&&o(rs),t&&o(ke),y(Po),t&&o(as),t&&o(W),y(jo),y(Uo),y(Ho),t&&o(ns),t&&o(xe),y(Oo),t&&o(ss),t&&o(Ie),y(Ro),t&&o(ls),t&&o(Pe),y(Zo),t&&o(is),t&&o(yr),t&&o(ds),t&&o(yt),t&&o(cs),t&&o(wr),t&&o(ms),t&&o(de),t&&o(ps),t&&o(Je),y(So),t&&o(hs),t&&o(Ue),y(Wo),t&&o(fs),t&&o(De),y(Go),t&&o(us),t&&o(G),y(qo),y(zo),y(Vo),t&&o(gs),t&&o(He),y(Bo),t&&o(_s),t&&o(q),y(Yo),y(Fo),y(Xo)}}}const wu={local:"agents-tools",sections:[{local:"agents",sections:[{local:"transformers.HfAgent",title:"HfAgent"},{local:"transformers.LocalAgent",title:"LocalAgent"},{local:"transformers.OpenAiAgent",title:"OpenAiAgent"},{local:"transformers.AzureOpenAiAgent",title:"AzureOpenAiAgent"},{local:"transformers.Agent",title:"Agent"}],title:"Agents"},{local:"tools",sections:[{local:"transformers.load_tool",title:"load_tool"},{local:"transformers.Tool",title:"Tool"},{local:"transformers.PipelineTool",title:"PipelineTool"},{local:"transformers.RemoteTool",title:"RemoteTool"},{local:"transformers.launch_gradio_demo",title:"launch_gradio_demo"}],title:"Tools"},{local:"agent-types",sections:[{local:"transformers.tools.agent_types.AgentText",title:"AgentText"},{local:"transformers.tools.agent_types.AgentImage",title:"AgentImage"},{local:"transformers.tools.agent_types.AgentAudio",title:"AgentAudio"}],title:"Agent Types"}],title:"Agents & Tools"};function Au(I){return cu(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pu extends su{constructor(f){super();lu(this,f,Au,yu,iu,{})}}export{Pu as default,wu as metadata};
