import{s as Us,f as en,o as Js,n as na}from"../chunks/scheduler.9bc65507.js";import{S as Ws,i as Bs,g as a,s as o,u as c,A as Is,h as s,f as t,c as i,j as f,v as d,y as r,k as h,o as p,a as l,w as g,d as v,t as w,x as y}from"../chunks/index.78c82d43.js";import{T as ta}from"../chunks/Tip.87d55b76.js";import{I as J}from"../chunks/IconCopyLink.bedaa44d.js";import{C as b}from"../chunks/CodeBlock.73e038be.js";function Hs(Q){let m,j=`Transformers Agents 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.`;return{c(){m=a("p"),m.textContent=j},l($){m=s($,"P",{"data-svelte-h":!0}),r(m)!=="svelte-1fgfei3"&&(m.textContent=j)},m($,x){l($,m,x)},p:na,d($){$&&t(m)}}}function As(Q){let m,j=`StarCoder and OpenAssistant are free to use and perform admirably well on simple tasks. However, the checkpoints
don’t hold up when handling more complex prompts. If you’re facing such an issue, we recommend trying out the OpenAI
model which, while sadly not open-source, performs better at this given time.`;return{c(){m=a("p"),m.textContent=j},l($){m=s($,"P",{"data-svelte-h":!0}),r(m)!=="svelte-13io30c"&&(m.textContent=j)},m($,x){l($,m,x)},p:na,d($){$&&t(m)}}}function Gs(Q){let m,j="This can be helpful when the model is unable to understand your request and mixes tools. An example would be:",$,x,_,C,X="Here, the model could interpret in two ways:",k,W,I="<li>Have the <code>text-to-image</code> generate a capybara swimming in the sea</li> <li>Or, have the <code>text-to-image</code> generate capybara, then use the <code>image-transformation</code> tool to have it swim in the sea</li>",ie,U,B="In case you would like to force the first scenario, you could do so by passing it the prompt as an argument:",H,T,re;return x=new b({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMHRoZSUyMHBpY3R1cmUlMjBvZiUyMGElMjBjYXB5YmFyYSUyMHN3aW1taW5nJTIwaW4lMjB0aGUlMjBzZWElMjIp",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me the picture of a capybara swimming in the sea&quot;</span>)',wrap:!1}}),T=new b({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjB0aGUlMjAlNjBwcm9tcHQlNjAlMjIlMkMlMjBwcm9tcHQlM0QlMjJhJTIwY2FweWJhcmElMjBzd2ltbWluZyUyMGluJTIwdGhlJTIwc2VhJTIyKQ==",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me a picture of the `prompt`&quot;</span>, prompt=<span class="hljs-string">&quot;a capybara swimming in the sea&quot;</span>)',wrap:!1}}),{c(){m=a("p"),m.textContent=j,$=o(),c(x.$$.fragment),_=o(),C=a("p"),C.textContent=X,k=o(),W=a("ul"),W.innerHTML=I,ie=o(),U=a("p"),U.textContent=B,H=o(),c(T.$$.fragment)},l(u){m=s(u,"P",{"data-svelte-h":!0}),r(m)!=="svelte-xtdcfc"&&(m.textContent=j),$=i(u),d(x.$$.fragment,u),_=i(u),C=s(u,"P",{"data-svelte-h":!0}),r(C)!=="svelte-1d3eg7h"&&(C.textContent=X),k=i(u),W=s(u,"UL",{"data-svelte-h":!0}),r(W)!=="svelte-6h7gti"&&(W.innerHTML=I),ie=i(u),U=s(u,"P",{"data-svelte-h":!0}),r(U)!=="svelte-17vcsom"&&(U.textContent=B),H=i(u),d(T.$$.fragment,u)},m(u,M){l(u,m,M),l(u,$,M),g(x,u,M),l(u,_,M),l(u,C,M),l(u,k,M),l(u,W,M),l(u,ie,M),l(u,U,M),l(u,H,M),g(T,u,M),re=!0},p:na,i(u){re||(v(x.$$.fragment,u),v(T.$$.fragment,u),re=!0)},o(u){w(x.$$.fragment,u),w(T.$$.fragment,u),re=!1},d(u){u&&(t(m),t($),t(_),t(C),t(k),t(W),t(ie),t(U),t(H)),y(x,u),y(T,u)}}}function Zs(Q){let m,j,$,x,_,C,X,k,W,I,ie="Transformers Agents",U,B,H,T,re=`Transformers version v4.29.0, building on the concept of <em>tools</em> and <em>agents</em>. You can play with in
<a href="https://colab.research.google.com/drive/1c7MHD-T1forUPGcC_jlwsIptOzpG3hSj" rel="nofollow">this colab</a>.`,u,M,la=`In short, it provides a natural language API on top of transformers: we define a set of curated tools and design an
agent to interpret natural language and to use these tools. It is extensible by design; we curated some relevant tools,
but we’ll show you how the system can be extended easily to use any tool developed by the community.`,tn,he,aa=`Let’s start with a few examples of what can be achieved with this new API. It is particularly powerful when it comes
to multimodal tasks, so let’s take it for a spin to generate images and read text out loud.`,nn,pe,ln,ue,sa='<thead><tr><th><strong>Input</strong></th> <th><strong>Output</strong></th></tr></thead> <tbody><tr><td><img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/beaver.png" width="200"/></td> <td>A beaver is swimming in the water</td></tr></tbody>',an,sn,on,fe,rn,me,oa='<thead><tr><th><strong>Input</strong></th> <th><strong>Output</strong></th></tr></thead> <tbody><tr><td>A beaver is swimming in the water</td> <td><audio controls=""><source src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tts_example.wav" type="audio/wav"/> your browser does not support the audio element.</audio></td></tr></tbody>',hn,pn,un,ce,fn,de,ia='<thead><tr><th><strong>Input</strong></th> <th><strong>Output</strong></th></tr></thead> <tbody><tr><td><img src="https://datasets-server.huggingface.co/assets/hf-internal-testing/example-documents/--/hf-internal-testing--example-documents/test/0/image/image.jpg" width="200"/></td> <td>ballroom foyer</td></tr></tbody>',mn,A,z,Et,ge,Nl,kt,ra="Quickstart",cn,ve,ha=`Before being able to use <code>agent.run</code>, you will need to instantiate an agent, which is a large language model (LLM).
We provide support for openAI models as well as opensource alternatives from BigCode and OpenAssistant. The openAI
models perform better (but require you to have an openAI API key, so cannot be used for free); Hugging Face is
providing free access to endpoints for BigCode and OpenAssistant models.`,dn,we,pa="To start with, please install the <code>agents</code> extras in order to install all default dependencies.",gn,ye,vn,$e,ua='To use openAI models, you instantiate an <a href="/docs/transformers/v4.34.0/en/main_classes/agent#transformers.OpenAiAgent">OpenAiAgent</a> after installing the <code>openai</code> dependency:',wn,Me,yn,be,$n,xe,fa="To use BigCode or OpenAssistant, start by logging in to have access to the Inference API:",Mn,Ce,bn,Te,ma="Then, instantiate the agent",xn,_e,Cn,je,ca=`This is using the inference API that Hugging Face provides for free at the moment. If you have your own inference
endpoint for this model (or another one) you can replace the URL above with your URL endpoint.`,Tn,V,_n,ke,da="You’re now good to go! Let’s dive into the two APIs that you now have at your disposal.",jn,G,F,Lt,Ue,Rl,Ut,ga="Single execution (run)",kn,Je,va='The single execution method is when using the <a href="/docs/transformers/v4.34.0/en/main_classes/agent#transformers.Agent.run">run()</a> method of the agent:',Un,We,Jn,Be,wa,Wn,Ie,ya=`It automatically selects the tool (or tools) appropriate for the task you want to perform and runs them appropriately. It
can perform one or several tasks in the same instruction (though the more complex your instruction, the more likely
the agent is to fail).`,Bn,He,In,Ae,$a,Hn,An,Gn,Ge,Ma='Every <a href="/docs/transformers/v4.34.0/en/main_classes/agent#transformers.Agent.run">run()</a> operation is independent, so you can run it several times in a row with different tasks.',Zn,Ze,ba=`Note that your <code>agent</code> is just a large-language model, so small variations in your prompt might yield completely
different results. It’s important to explain as clearly as possible the task you want to perform. We go more in-depth
on how to write good prompts <a href="custom_tools#writing-good-user-inputs">here</a>.`,Pn,Pe,xa=`If you’d like to keep a state across executions or to pass non-text objects to the agent, you can do so by specifying
variables that you would like the agent to use. For example, you could generate the first image of rivers and lakes,
and ask the model to update that picture to add an island by doing the following:`,Yn,Ye,En,K,Ln,Z,O,St,Ee,Ql,Jt,Ca="Chat-based execution (chat)",Sn,Le,Ta='The agent also has a chat-based approach, using the <a href="/docs/transformers/v4.34.0/en/main_classes/agent#transformers.Agent.chat">chat()</a> method:',qn,Se,Nn,qe,_a,Rn,Ne,Qn,Re,ja,Xn,zn,Vn,Qe,ka=`This is an interesting approach when you want to keep the state across instructions. It’s better for experimentation,
but will tend to be much better at single instructions rather than complex instructions (which the <a href="/docs/transformers/v4.34.0/en/main_classes/agent#transformers.Agent.run">run()</a>
method is better at handling).`,Fn,Xe,Ua="This method can also take arguments if you would like to pass non-text types or specific prompts.",Kn,P,D,qt,ze,Xl,Wt,Ja="⚠️ Remote execution",On,Ve,Wa=`For demonstration purposes and so that it could be used with all setups, we had created remote executors for several
of the default tools the agent has access for the release. These are created using
<a href="https://huggingface.co/inference-endpoints" rel="nofollow">inference endpoints</a>.`,Dn,Fe,Ba=`We have turned these off for now, but in order to see how to set up remote executors tools yourself,
we recommend reading the <a href="./custom_tools">custom tool guide</a>.`,el,Y,ee,Nt,Ke,zl,Bt,Ia="What's happening here? What are tools, and what are agents?",tl,It,Ha,nl,E,te,Rt,Oe,Vl,Ht,Aa="Agents",ll,De,Ga="The “agent” here is a large language model, and we’re prompting it so that it has access to a specific set of tools.",al,et,Za=`LLMs are pretty good at generating small samples of code, so this API takes advantage of that by prompting the
LLM gives a small sample of code performing a task with a set of tools. This prompt is then completed by the
task you give your agent and the description of the tools you give it. This way it gets access to the doc of the
tools you are using, especially their expected inputs and outputs, and can generate the relevant code.`,sl,L,ne,Qt,tt,Fl,At,Pa="Tools",ol,nt,Ya=`Tools are very simple: they’re a single function, with a name, and a description. We then use these tools’ descriptions
to prompt the agent. Through the prompt, we show the agent how it would leverage tools to perform what was
requested in the query.`,il,lt,Ea=`This is using brand-new tools and not pipelines, because the agent writes better code with very atomic tools.
Pipelines are more refactored and often combine several tasks in one. Tools are meant to be focused on
one very simple task only.`,rl,S,le,Xt,at,Kl,Gt,La="Code-execution?!",hl,st,Sa=`This code is then executed with our small Python interpreter on the set of inputs passed along with your tools.
We hear you screaming “Arbitrary code execution!” in the back, but let us explain why that is not the case.`,pl,ot,qa=`The only functions that can be called are the tools you provided and the print function, so you’re already
limited in what can be executed. You should be safe if it’s limited to Hugging Face tools.`,ul,it,Na=`Then, we don’t allow any attribute lookup or imports (which shouldn’t be needed anyway for passing along
inputs/outputs to a small set of functions) so all the most obvious attacks (and you’d need to prompt the LLM
to output them anyway) shouldn’t be an issue. If you want to be on the super safe side, you can execute the
run() method with the additional argument return_code=True, in which case the agent will just return the code
to execute and you can decide whether to do it or not.`,fl,rt,Ra=`The execution will stop at any line trying to perform an illegal operation or if there is a regular Python error
with the code generated by the agent.`,ml,q,ae,zt,ht,Ol,Zt,Qa="A curated set of tools",cl,pt,Xa=`We identify a set of tools that can empower such agents. Here is an updated list of the tools we have integrated
in <code>transformers</code>:`,dl,ut,za='<li><strong>Document question answering</strong>: given a document (such as a PDF) in image format, answer a question on this document (<a href="./model_doc/donut">Donut</a>)</li> <li><strong>Text question answering</strong>: given a long text and a question, answer the question in the text (<a href="./model_doc/flan-t5">Flan-T5</a>)</li> <li><strong>Unconditional image captioning</strong>: Caption the image! (<a href="./model_doc/blip">BLIP</a>)</li> <li><strong>Image question answering</strong>: given an image, answer a question on this image (<a href="./model_doc/vilt">VILT</a>)</li> <li><strong>Image segmentation</strong>: given an image and a prompt, output the segmentation mask of that prompt (<a href="./model_doc/clipseg">CLIPSeg</a>)</li> <li><strong>Speech to text</strong>: given an audio recording of a person talking, transcribe the speech into text (<a href="./model_doc/whisper">Whisper</a>)</li> <li><strong>Text to speech</strong>: convert text to speech (<a href="./model_doc/speecht5">SpeechT5</a>)</li> <li><strong>Zero-shot text classification</strong>: given a text and a list of labels, identify to which label the text corresponds the most (<a href="./model_doc/bart">BART</a>)</li> <li><strong>Text summarization</strong>: summarize a long text in one or a few sentences (<a href="./model_doc/bart">BART</a>)</li> <li><strong>Translation</strong>: translate the text into a given language (<a href="./model_doc/nllb">NLLB</a>)</li>',gl,ft,Va="These tools have an integration in transformers, and can be used manually as well, for example:",vl,mt,wl,N,se,Vt,ct,Dl,Pt,Fa="Custom tools",yl,dt,Ka=`While we identify a curated set of tools, we strongly believe that the main value provided by this implementation is
the ability to quickly create and share custom tools.`,$l,gt,Oa=`By pushing the code of a tool to a Hugging Face Space or a model repository, you’re then able to leverage the tool
directly with the agent. We’ve added a few
<strong>transformers-agnostic</strong> tools to the <a href="https://huggingface.co/huggingface-tools" rel="nofollow"><code>huggingface-tools</code> organization</a>:`,Ml,vt,Da="<li><strong>Text downloader</strong>: to download a text from a web URL</li> <li><strong>Text to image</strong>: generate an image according to a prompt, leveraging stable diffusion</li> <li><strong>Image transformation</strong>: modify an image given an initial image and a prompt, leveraging instruct pix2pix stable diffusion</li> <li><strong>Text to video</strong>: generate a small video according to a prompt, leveraging damo-vilab</li>",bl,wt,es=`The text-to-image tool we have been using since the beginning is a remote tool that lives in
<a href="https://huggingface.co/spaces/huggingface-tools/text-to-image" rel="nofollow"><em>huggingface-tools/text-to-image</em></a>! We will
continue releasing such tools on this and other organizations, to further supercharge this implementation.`,xl,yt,ts=`The agents have by default access to tools that reside on <a href="https://huggingface.co/huggingface-tools" rel="nofollow"><code>huggingface-tools</code></a>.
We explain how to you can write and share your tools as well as leverage any custom tool that resides on the Hub in <a href="custom_tools">following guide</a>.`,Cl,R,oe,Ft,$t,ea,Yt,ns="Code generation",Tl,Mt,ls=`So far we have shown how to use the agents to perform actions for you. However, the agent is only generating code
that we then execute using a very restricted Python interpreter. In case you would like to use the code generated in
a different setting, the agent can be prompted to return the code, along with tool definition and accurate imports.`,_l,bt,as="For example, the following instruction",jl,xt,kl,Ct,ss="returns the following code",Ul,Tt,Jl,_t,os="that you can then modify and execute yourself.",Wl,Kt,Bl;return k=new J({}),B=new ta({props:{warning:!0,$$slots:{default:[Hs]},$$scope:{ctx:Q}}}),pe=new b({props:{code:"YWdlbnQucnVuKCUyMkNhcHRpb24lMjB0aGUlMjBmb2xsb3dpbmclMjBpbWFnZSUyMiUyQyUyMGltYWdlJTNEaW1hZ2Up",highlighted:'agent.run(<span class="hljs-string">&quot;Caption the following image&quot;</span>, image=image)',wrap:!1}}),fe=new b({props:{code:"YWdlbnQucnVuKCUyMlJlYWQlMjB0aGUlMjBmb2xsb3dpbmclMjB0ZXh0JTIwb3V0JTIwbG91ZCUyMiUyQyUyMHRleHQlM0R0ZXh0KQ==",highlighted:'agent.run(<span class="hljs-string">&quot;Read the following text out loud&quot;</span>, text=text)',wrap:!1}}),ce=new b({props:{code:"YWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkluJTIwdGhlJTIwZm9sbG93aW5nJTIwJTYwZG9jdW1lbnQlNjAlMkMlMjB3aGVyZSUyMHdpbGwlMjB0aGUlMjBUUlJGJTIwU2NpZW50aWZpYyUyMEFkdmlzb3J5JTIwQ291bmNpbCUyME1lZXRpbmclMjB0YWtlJTIwcGxhY2UlM0YlMjIlMkMlMEElMjAlMjAlMjAlMjBkb2N1bWVudCUzRGRvY3VtZW50JTJDJTBBKQ==",highlighted:`agent.run(
    <span class="hljs-string">&quot;In the following \`document\`, where will the TRRF Scientific Advisory Council Meeting take place?&quot;</span>,
    document=document,
)`,wrap:!1}}),ge=new J({}),ye=new b({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyU1QmFnZW50cyU1RA==",highlighted:"pip install transformers[agents]",wrap:!1}}),Me=new b({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5haQ==",highlighted:"pip install openai",wrap:!1}}),be=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME9wZW5BaUFnZW50JTBBJTBBYWdlbnQlMjAlM0QlMjBPcGVuQWlBZ2VudChtb2RlbCUzRCUyMnRleHQtZGF2aW5jaS0wMDMlMjIlMkMlMjBhcGlfa2V5JTNEJTIyJTNDeW91cl9hcGlfa2V5JTNFJTIyKQ==",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=<span class="hljs-string">&quot;&lt;your_api_key&gt;&quot;</span>)`,wrap:!1}}),Ce=new b({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTBBJTBBbG9naW4oJTIyJTNDWU9VUl9UT0tFTiUzRSUyMik=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login

login(<span class="hljs-string">&quot;&lt;YOUR_TOKEN&gt;&quot;</span>)`,wrap:!1}}),_e=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhmQWdlbnQlMEElMEElMjMlMjBTdGFyY29kZXIlMEFhZ2VudCUyMCUzRCUyMEhmQWdlbnQoJTIyaHR0cHMlM0ElMkYlMkZhcGktaW5mZXJlbmNlLmh1Z2dpbmdmYWNlLmNvJTJGbW9kZWxzJTJGYmlnY29kZSUyRnN0YXJjb2RlciUyMiklMEElMjMlMjBTdGFyY29kZXJCYXNlJTBBJTIzJTIwYWdlbnQlMjAlM0QlMjBIZkFnZW50KCUyMmh0dHBzJTNBJTJGJTJGYXBpLWluZmVyZW5jZS5odWdnaW5nZmFjZS5jbyUyRm1vZGVscyUyRmJpZ2NvZGUlMkZzdGFyY29kZXJiYXNlJTIyKSUwQSUyMyUyME9wZW5Bc3Npc3RhbnQlMEElMjMlMjBhZ2VudCUyMCUzRCUyMEhmQWdlbnQodXJsX2VuZHBvaW50JTNEJTIyaHR0cHMlM0ElMkYlMkZhcGktaW5mZXJlbmNlLmh1Z2dpbmdmYWNlLmNvJTJGbW9kZWxzJTJGT3BlbkFzc2lzdGFudCUyRm9hc3N0LXNmdC00LXB5dGhpYS0xMmItZXBvY2gtMy41JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HfAgent

<span class="hljs-comment"># Starcoder</span>
agent = HfAgent(<span class="hljs-string">&quot;https://api-inference.huggingface.co/models/bigcode/starcoder&quot;</span>)
<span class="hljs-comment"># StarcoderBase</span>
<span class="hljs-comment"># agent = HfAgent(&quot;https://api-inference.huggingface.co/models/bigcode/starcoderbase&quot;)</span>
<span class="hljs-comment"># OpenAssistant</span>
<span class="hljs-comment"># agent = HfAgent(url_endpoint=&quot;https://api-inference.huggingface.co/models/OpenAssistant/oasst-sft-4-pythia-12b-epoch-3.5&quot;)</span>`,wrap:!1}}),V=new ta({props:{$$slots:{default:[As]},$$scope:{ctx:Q}}}),Ue=new J({}),We=new b({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcy4lMjIp",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes.&quot;</span>)',wrap:!1}}),He=new b({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjB0aGUlMjBzZWElMjB0aGVuJTIwdHJhbnNmb3JtJTIwdGhlJTIwcGljdHVyZSUyMHRvJTIwYWRkJTIwYW4lMjBpc2xhbmQlMjIp",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me a picture of the sea then transform the picture to add an island&quot;</span>)',wrap:!1}}),Ye=new b({props:{code:"cGljdHVyZSUyMCUzRCUyMGFnZW50LnJ1biglMjJHZW5lcmF0ZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcy4lMjIpJTBBdXBkYXRlZF9waWN0dXJlJTIwJTNEJTIwYWdlbnQucnVuKCUyMlRyYW5zZm9ybSUyMHRoZSUyMGltYWdlJTIwaW4lMjAlNjBwaWN0dXJlJTYwJTIwdG8lMjBhZGQlMjBhbiUyMGlzbGFuZCUyMHRvJTIwaXQuJTIyJTJDJTIwcGljdHVyZSUzRHBpY3R1cmUp",highlighted:'picture = agent.run(<span class="hljs-string">&quot;Generate a picture of rivers and lakes.&quot;</span>)\nupdated_picture = agent.run(<span class="hljs-string">&quot;Transform the image in `picture` to add an island to it.&quot;</span>, picture=picture)',wrap:!1}}),K=new ta({props:{$$slots:{default:[Gs]},$$scope:{ctx:Q}}}),Ee=new J({}),Se=new b({props:{code:"YWdlbnQuY2hhdCglMjJHZW5lcmF0ZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcyUyMik=",highlighted:'agent.chat(<span class="hljs-string">&quot;Generate a picture of rivers and lakes&quot;</span>)',wrap:!1}}),Ne=new b({props:{code:"YWdlbnQuY2hhdCglMjJUcmFuc2Zvcm0lMjB0aGUlMjBwaWN0dXJlJTIwc28lMjB0aGF0JTIwdGhlcmUlMjBpcyUyMGElMjByb2NrJTIwaW4lMjB0aGVyZSUyMik=",highlighted:'agent.chat(<span class="hljs-string">&quot;Transform the picture so that there is a rock in there&quot;</span>)',wrap:!1}}),ze=new J({}),Ke=new J({}),Oe=new J({}),tt=new J({}),at=new J({}),ht=new J({}),mt=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGxvYWRfdG9vbCUwQSUwQXRvb2wlMjAlM0QlMjBsb2FkX3Rvb2woJTIydGV4dC10by1zcGVlY2glMjIpJTBBYXVkaW8lMjAlM0QlMjB0b29sKCUyMlRoaXMlMjBpcyUyMGElMjB0ZXh0JTIwdG8lMjBzcGVlY2glMjB0b29sJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> load_tool

tool = load_tool(<span class="hljs-string">&quot;text-to-speech&quot;</span>)
audio = tool(<span class="hljs-string">&quot;This is a text to speech tool&quot;</span>)`,wrap:!1}}),ct=new J({}),$t=new J({}),xt=new b({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcyUyMiUyQyUyMHJldHVybl9jb2RlJTNEVHJ1ZSk=",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes&quot;</span>, return_code=<span class="hljs-literal">True</span>)',wrap:!1}}),Tt=new b({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGxvYWRfdG9vbCUwQSUwQWltYWdlX2dlbmVyYXRvciUyMCUzRCUyMGxvYWRfdG9vbCglMjJodWdnaW5nZmFjZS10b29scyUyRnRleHQtdG8taW1hZ2UlMjIpJTBBJTBBaW1hZ2UlMjAlM0QlMjBpbWFnZV9nZW5lcmF0b3IocHJvbXB0JTNEJTIycml2ZXJzJTIwYW5kJTIwbGFrZXMlMjIp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> load_tool

image_generator = load_tool(<span class="hljs-string">&quot;huggingface-tools/text-to-image&quot;</span>)

image = image_generator(prompt=<span class="hljs-string">&quot;rivers and lakes&quot;</span>)`,wrap:!1}}),{c(){m=a("meta"),j=o(),$=a("p"),x=o(),_=a("h1"),C=a("a"),X=a("span"),c(k.$$.fragment),W=o(),I=a("span"),I.textContent=ie,U=o(),c(B.$$.fragment),H=o(),T=a("p"),T.innerHTML=re,u=o(),M=a("p"),M.textContent=la,tn=o(),he=a("p"),he.textContent=aa,nn=o(),c(pe.$$.fragment),ln=o(),ue=a("table"),ue.innerHTML=sa,an=o(),sn=a("hr"),on=o(),c(fe.$$.fragment),rn=o(),me=a("table"),me.innerHTML=oa,hn=o(),pn=a("hr"),un=o(),c(ce.$$.fragment),fn=o(),de=a("table"),de.innerHTML=ia,mn=o(),A=a("h2"),z=a("a"),Et=a("span"),c(ge.$$.fragment),Nl=o(),kt=a("span"),kt.textContent=ra,cn=o(),ve=a("p"),ve.innerHTML=ha,dn=o(),we=a("p"),we.innerHTML=pa,gn=o(),c(ye.$$.fragment),vn=o(),$e=a("p"),$e.innerHTML=ua,wn=o(),c(Me.$$.fragment),yn=o(),c(be.$$.fragment),$n=o(),xe=a("p"),xe.textContent=fa,Mn=o(),c(Ce.$$.fragment),bn=o(),Te=a("p"),Te.textContent=ma,xn=o(),c(_e.$$.fragment),Cn=o(),je=a("p"),je.textContent=ca,Tn=o(),c(V.$$.fragment),_n=o(),ke=a("p"),ke.textContent=da,jn=o(),G=a("h3"),F=a("a"),Lt=a("span"),c(Ue.$$.fragment),Rl=o(),Ut=a("span"),Ut.textContent=ga,kn=o(),Je=a("p"),Je.innerHTML=va,Un=o(),c(We.$$.fragment),Jn=o(),Be=a("img"),Wn=o(),Ie=a("p"),Ie.textContent=ya,Bn=o(),c(He.$$.fragment),In=o(),Ae=a("img"),Hn=o(),An=a("br"),Gn=o(),Ge=a("p"),Ge.innerHTML=Ma,Zn=o(),Ze=a("p"),Ze.innerHTML=ba,Pn=o(),Pe=a("p"),Pe.textContent=xa,Yn=o(),c(Ye.$$.fragment),En=o(),c(K.$$.fragment),Ln=o(),Z=a("h3"),O=a("a"),St=a("span"),c(Ee.$$.fragment),Ql=o(),Jt=a("span"),Jt.textContent=Ca,Sn=o(),Le=a("p"),Le.innerHTML=Ta,qn=o(),c(Se.$$.fragment),Nn=o(),qe=a("img"),Rn=o(),c(Ne.$$.fragment),Qn=o(),Re=a("img"),Xn=o(),zn=a("br"),Vn=o(),Qe=a("p"),Qe.innerHTML=ka,Fn=o(),Xe=a("p"),Xe.textContent=Ua,Kn=o(),P=a("h3"),D=a("a"),qt=a("span"),c(ze.$$.fragment),Xl=o(),Wt=a("span"),Wt.textContent=Ja,On=o(),Ve=a("p"),Ve.innerHTML=Wa,Dn=o(),Fe=a("p"),Fe.innerHTML=Ba,el=o(),Y=a("h3"),ee=a("a"),Nt=a("span"),c(Ke.$$.fragment),zl=o(),Bt=a("span"),Bt.textContent=Ia,tl=o(),It=a("img"),nl=o(),E=a("h4"),te=a("a"),Rt=a("span"),c(Oe.$$.fragment),Vl=o(),Ht=a("span"),Ht.textContent=Aa,ll=o(),De=a("p"),De.textContent=Ga,al=o(),et=a("p"),et.textContent=Za,sl=o(),L=a("h4"),ne=a("a"),Qt=a("span"),c(tt.$$.fragment),Fl=o(),At=a("span"),At.textContent=Pa,ol=o(),nt=a("p"),nt.textContent=Ya,il=o(),lt=a("p"),lt.textContent=Ea,rl=o(),S=a("h4"),le=a("a"),Xt=a("span"),c(at.$$.fragment),Kl=o(),Gt=a("span"),Gt.textContent=La,hl=o(),st=a("p"),st.textContent=Sa,pl=o(),ot=a("p"),ot.textContent=qa,ul=o(),it=a("p"),it.textContent=Na,fl=o(),rt=a("p"),rt.textContent=Ra,ml=o(),q=a("h3"),ae=a("a"),zt=a("span"),c(ht.$$.fragment),Ol=o(),Zt=a("span"),Zt.textContent=Qa,cl=o(),pt=a("p"),pt.innerHTML=Xa,dl=o(),ut=a("ul"),ut.innerHTML=za,gl=o(),ft=a("p"),ft.textContent=Va,vl=o(),c(mt.$$.fragment),wl=o(),N=a("h3"),se=a("a"),Vt=a("span"),c(ct.$$.fragment),Dl=o(),Pt=a("span"),Pt.textContent=Fa,yl=o(),dt=a("p"),dt.textContent=Ka,$l=o(),gt=a("p"),gt.innerHTML=Oa,Ml=o(),vt=a("ul"),vt.innerHTML=Da,bl=o(),wt=a("p"),wt.innerHTML=es,xl=o(),yt=a("p"),yt.innerHTML=ts,Cl=o(),R=a("h3"),oe=a("a"),Ft=a("span"),c($t.$$.fragment),ea=o(),Yt=a("span"),Yt.textContent=ns,Tl=o(),Mt=a("p"),Mt.textContent=ls,_l=o(),bt=a("p"),bt.textContent=as,jl=o(),c(xt.$$.fragment),kl=o(),Ct=a("p"),Ct.textContent=ss,Ul=o(),c(Tt.$$.fragment),Jl=o(),_t=a("p"),_t.textContent=os,Wl=o(),Kt=a("p"),this.h()},l(e){const n=Is("svelte-1phssyn",document.head);m=s(n,"META",{name:!0,content:!0}),n.forEach(t),j=i(e),$=s(e,"P",{}),f($).forEach(t),x=i(e),_=s(e,"H1",{class:!0});var jt=f(_);C=s(jt,"A",{id:!0,class:!0,href:!0});var Ot=f(C);X=s(Ot,"SPAN",{});var Dt=f(X);d(k.$$.fragment,Dt),Dt.forEach(t),Ot.forEach(t),W=i(jt),I=s(jt,"SPAN",{"data-svelte-h":!0}),r(I)!=="svelte-1kdlnnd"&&(I.textContent=ie),jt.forEach(t),U=i(e),d(B.$$.fragment,e),H=i(e),T=s(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-hggcnq"&&(T.innerHTML=re),u=i(e),M=s(e,"P",{"data-svelte-h":!0}),r(M)!=="svelte-g8wjpq"&&(M.textContent=la),tn=i(e),he=s(e,"P",{"data-svelte-h":!0}),r(he)!=="svelte-ijizhx"&&(he.textContent=aa),nn=i(e),d(pe.$$.fragment,e),ln=i(e),ue=s(e,"TABLE",{"data-svelte-h":!0}),r(ue)!=="svelte-gt1bz9"&&(ue.innerHTML=sa),an=i(e),sn=s(e,"HR",{}),on=i(e),d(fe.$$.fragment,e),rn=i(e),me=s(e,"TABLE",{"data-svelte-h":!0}),r(me)!=="svelte-1a2vad0"&&(me.innerHTML=oa),hn=i(e),pn=s(e,"HR",{}),un=i(e),d(ce.$$.fragment,e),fn=i(e),de=s(e,"TABLE",{"data-svelte-h":!0}),r(de)!=="svelte-1iw5xoi"&&(de.innerHTML=ia),mn=i(e),A=s(e,"H2",{class:!0});var Il=f(A);z=s(Il,"A",{id:!0,class:!0,href:!0});var is=f(z);Et=s(is,"SPAN",{});var rs=f(Et);d(ge.$$.fragment,rs),rs.forEach(t),is.forEach(t),Nl=i(Il),kt=s(Il,"SPAN",{"data-svelte-h":!0}),r(kt)!=="svelte-1nw2yoa"&&(kt.textContent=ra),Il.forEach(t),cn=i(e),ve=s(e,"P",{"data-svelte-h":!0}),r(ve)!=="svelte-1dmdrm1"&&(ve.innerHTML=ha),dn=i(e),we=s(e,"P",{"data-svelte-h":!0}),r(we)!=="svelte-1dv7sdf"&&(we.innerHTML=pa),gn=i(e),d(ye.$$.fragment,e),vn=i(e),$e=s(e,"P",{"data-svelte-h":!0}),r($e)!=="svelte-1yg69m0"&&($e.innerHTML=ua),wn=i(e),d(Me.$$.fragment,e),yn=i(e),d(be.$$.fragment,e),$n=i(e),xe=s(e,"P",{"data-svelte-h":!0}),r(xe)!=="svelte-1jiytcn"&&(xe.textContent=fa),Mn=i(e),d(Ce.$$.fragment,e),bn=i(e),Te=s(e,"P",{"data-svelte-h":!0}),r(Te)!=="svelte-ezmlbn"&&(Te.textContent=ma),xn=i(e),d(_e.$$.fragment,e),Cn=i(e),je=s(e,"P",{"data-svelte-h":!0}),r(je)!=="svelte-4zoxn5"&&(je.textContent=ca),Tn=i(e),d(V.$$.fragment,e),_n=i(e),ke=s(e,"P",{"data-svelte-h":!0}),r(ke)!=="svelte-1pylma2"&&(ke.textContent=da),jn=i(e),G=s(e,"H3",{class:!0});var Hl=f(G);F=s(Hl,"A",{id:!0,class:!0,href:!0});var hs=f(F);Lt=s(hs,"SPAN",{});var ps=f(Lt);d(Ue.$$.fragment,ps),ps.forEach(t),hs.forEach(t),Rl=i(Hl),Ut=s(Hl,"SPAN",{"data-svelte-h":!0}),r(Ut)!=="svelte-2v9j7z"&&(Ut.textContent=ga),Hl.forEach(t),kn=i(e),Je=s(e,"P",{"data-svelte-h":!0}),r(Je)!=="svelte-c6znrr"&&(Je.innerHTML=va),Un=i(e),d(We.$$.fragment,e),Jn=i(e),Be=s(e,"IMG",{src:!0,width:!0}),Wn=i(e),Ie=s(e,"P",{"data-svelte-h":!0}),r(Ie)!=="svelte-aarw7i"&&(Ie.textContent=ya),Bn=i(e),d(He.$$.fragment,e),In=i(e),Ae=s(e,"IMG",{src:!0,width:!0}),Hn=i(e),An=s(e,"BR",{}),Gn=i(e),Ge=s(e,"P",{"data-svelte-h":!0}),r(Ge)!=="svelte-1q2u75g"&&(Ge.innerHTML=Ma),Zn=i(e),Ze=s(e,"P",{"data-svelte-h":!0}),r(Ze)!=="svelte-1kxdglx"&&(Ze.innerHTML=ba),Pn=i(e),Pe=s(e,"P",{"data-svelte-h":!0}),r(Pe)!=="svelte-pifkum"&&(Pe.textContent=xa),Yn=i(e),d(Ye.$$.fragment,e),En=i(e),d(K.$$.fragment,e),Ln=i(e),Z=s(e,"H3",{class:!0});var Al=f(Z);O=s(Al,"A",{id:!0,class:!0,href:!0});var us=f(O);St=s(us,"SPAN",{});var fs=f(St);d(Ee.$$.fragment,fs),fs.forEach(t),us.forEach(t),Ql=i(Al),Jt=s(Al,"SPAN",{"data-svelte-h":!0}),r(Jt)!=="svelte-2sh1vs"&&(Jt.textContent=Ca),Al.forEach(t),Sn=i(e),Le=s(e,"P",{"data-svelte-h":!0}),r(Le)!=="svelte-4p3vjk"&&(Le.innerHTML=Ta),qn=i(e),d(Se.$$.fragment,e),Nn=i(e),qe=s(e,"IMG",{src:!0,width:!0}),Rn=i(e),d(Ne.$$.fragment,e),Qn=i(e),Re=s(e,"IMG",{src:!0,width:!0}),Xn=i(e),zn=s(e,"BR",{}),Vn=i(e),Qe=s(e,"P",{"data-svelte-h":!0}),r(Qe)!=="svelte-1ke1qqb"&&(Qe.innerHTML=ka),Fn=i(e),Xe=s(e,"P",{"data-svelte-h":!0}),r(Xe)!=="svelte-16wygo5"&&(Xe.textContent=Ua),Kn=i(e),P=s(e,"H3",{class:!0});var Gl=f(P);D=s(Gl,"A",{id:!0,class:!0,href:!0});var ms=f(D);qt=s(ms,"SPAN",{});var cs=f(qt);d(ze.$$.fragment,cs),cs.forEach(t),ms.forEach(t),Xl=i(Gl),Wt=s(Gl,"SPAN",{"data-svelte-h":!0}),r(Wt)!=="svelte-1f21k2c"&&(Wt.textContent=Ja),Gl.forEach(t),On=i(e),Ve=s(e,"P",{"data-svelte-h":!0}),r(Ve)!=="svelte-1y37z6"&&(Ve.innerHTML=Wa),Dn=i(e),Fe=s(e,"P",{"data-svelte-h":!0}),r(Fe)!=="svelte-h6dg90"&&(Fe.innerHTML=Ba),el=i(e),Y=s(e,"H3",{class:!0});var Zl=f(Y);ee=s(Zl,"A",{id:!0,class:!0,href:!0});var ds=f(ee);Nt=s(ds,"SPAN",{});var gs=f(Nt);d(Ke.$$.fragment,gs),gs.forEach(t),ds.forEach(t),zl=i(Zl),Bt=s(Zl,"SPAN",{"data-svelte-h":!0}),r(Bt)!=="svelte-uj4lc5"&&(Bt.textContent=Ia),Zl.forEach(t),tl=i(e),It=s(e,"IMG",{src:!0}),nl=i(e),E=s(e,"H4",{class:!0});var Pl=f(E);te=s(Pl,"A",{id:!0,class:!0,href:!0});var vs=f(te);Rt=s(vs,"SPAN",{});var ws=f(Rt);d(Oe.$$.fragment,ws),ws.forEach(t),vs.forEach(t),Vl=i(Pl),Ht=s(Pl,"SPAN",{"data-svelte-h":!0}),r(Ht)!=="svelte-mjfvi7"&&(Ht.textContent=Aa),Pl.forEach(t),ll=i(e),De=s(e,"P",{"data-svelte-h":!0}),r(De)!=="svelte-1h1hsmq"&&(De.textContent=Ga),al=i(e),et=s(e,"P",{"data-svelte-h":!0}),r(et)!=="svelte-1yih65e"&&(et.textContent=Za),sl=i(e),L=s(e,"H4",{class:!0});var Yl=f(L);ne=s(Yl,"A",{id:!0,class:!0,href:!0});var ys=f(ne);Qt=s(ys,"SPAN",{});var $s=f(Qt);d(tt.$$.fragment,$s),$s.forEach(t),ys.forEach(t),Fl=i(Yl),At=s(Yl,"SPAN",{"data-svelte-h":!0}),r(At)!=="svelte-7l60uo"&&(At.textContent=Pa),Yl.forEach(t),ol=i(e),nt=s(e,"P",{"data-svelte-h":!0}),r(nt)!=="svelte-1pl6quz"&&(nt.textContent=Ya),il=i(e),lt=s(e,"P",{"data-svelte-h":!0}),r(lt)!=="svelte-owbr46"&&(lt.textContent=Ea),rl=i(e),S=s(e,"H4",{class:!0});var El=f(S);le=s(El,"A",{id:!0,class:!0,href:!0});var Ms=f(le);Xt=s(Ms,"SPAN",{});var bs=f(Xt);d(at.$$.fragment,bs),bs.forEach(t),Ms.forEach(t),Kl=i(El),Gt=s(El,"SPAN",{"data-svelte-h":!0}),r(Gt)!=="svelte-hkv69r"&&(Gt.textContent=La),El.forEach(t),hl=i(e),st=s(e,"P",{"data-svelte-h":!0}),r(st)!=="svelte-17ipo1r"&&(st.textContent=Sa),pl=i(e),ot=s(e,"P",{"data-svelte-h":!0}),r(ot)!=="svelte-or0pg0"&&(ot.textContent=qa),ul=i(e),it=s(e,"P",{"data-svelte-h":!0}),r(it)!=="svelte-fb990x"&&(it.textContent=Na),fl=i(e),rt=s(e,"P",{"data-svelte-h":!0}),r(rt)!=="svelte-1ri56my"&&(rt.textContent=Ra),ml=i(e),q=s(e,"H3",{class:!0});var Ll=f(q);ae=s(Ll,"A",{id:!0,class:!0,href:!0});var xs=f(ae);zt=s(xs,"SPAN",{});var Cs=f(zt);d(ht.$$.fragment,Cs),Cs.forEach(t),xs.forEach(t),Ol=i(Ll),Zt=s(Ll,"SPAN",{"data-svelte-h":!0}),r(Zt)!=="svelte-1w9pyi6"&&(Zt.textContent=Qa),Ll.forEach(t),cl=i(e),pt=s(e,"P",{"data-svelte-h":!0}),r(pt)!=="svelte-lbnuw"&&(pt.innerHTML=Xa),dl=i(e),ut=s(e,"UL",{"data-svelte-h":!0}),r(ut)!=="svelte-5hcxax"&&(ut.innerHTML=za),gl=i(e),ft=s(e,"P",{"data-svelte-h":!0}),r(ft)!=="svelte-u6begh"&&(ft.textContent=Va),vl=i(e),d(mt.$$.fragment,e),wl=i(e),N=s(e,"H3",{class:!0});var Sl=f(N);se=s(Sl,"A",{id:!0,class:!0,href:!0});var Ts=f(se);Vt=s(Ts,"SPAN",{});var _s=f(Vt);d(ct.$$.fragment,_s),_s.forEach(t),Ts.forEach(t),Dl=i(Sl),Pt=s(Sl,"SPAN",{"data-svelte-h":!0}),r(Pt)!=="svelte-ab1gvt"&&(Pt.textContent=Fa),Sl.forEach(t),yl=i(e),dt=s(e,"P",{"data-svelte-h":!0}),r(dt)!=="svelte-1qgu66u"&&(dt.textContent=Ka),$l=i(e),gt=s(e,"P",{"data-svelte-h":!0}),r(gt)!=="svelte-32uplk"&&(gt.innerHTML=Oa),Ml=i(e),vt=s(e,"UL",{"data-svelte-h":!0}),r(vt)!=="svelte-18r1pun"&&(vt.innerHTML=Da),bl=i(e),wt=s(e,"P",{"data-svelte-h":!0}),r(wt)!=="svelte-np3cvk"&&(wt.innerHTML=es),xl=i(e),yt=s(e,"P",{"data-svelte-h":!0}),r(yt)!=="svelte-10s0ieo"&&(yt.innerHTML=ts),Cl=i(e),R=s(e,"H3",{class:!0});var ql=f(R);oe=s(ql,"A",{id:!0,class:!0,href:!0});var js=f(oe);Ft=s(js,"SPAN",{});var ks=f(Ft);d($t.$$.fragment,ks),ks.forEach(t),js.forEach(t),ea=i(ql),Yt=s(ql,"SPAN",{"data-svelte-h":!0}),r(Yt)!=="svelte-8bgefq"&&(Yt.textContent=ns),ql.forEach(t),Tl=i(e),Mt=s(e,"P",{"data-svelte-h":!0}),r(Mt)!=="svelte-er9qni"&&(Mt.textContent=ls),_l=i(e),bt=s(e,"P",{"data-svelte-h":!0}),r(bt)!=="svelte-16j3iq1"&&(bt.textContent=as),jl=i(e),d(xt.$$.fragment,e),kl=i(e),Ct=s(e,"P",{"data-svelte-h":!0}),r(Ct)!=="svelte-pibxgg"&&(Ct.textContent=ss),Ul=i(e),d(Tt.$$.fragment,e),Jl=i(e),_t=s(e,"P",{"data-svelte-h":!0}),r(_t)!=="svelte-rbbu3k"&&(_t.textContent=os),Wl=i(e),Kt=s(e,"P",{}),f(Kt).forEach(t),this.h()},h(){h(m,"name","hf:doc:metadata"),h(m,"content",JSON.stringify(Ps)),h(C,"id","transformers-agents"),h(C,"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"),h(C,"href","#transformers-agents"),h(_,"class","relative group"),h(z,"id","quickstart"),h(z,"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"),h(z,"href","#quickstart"),h(A,"class","relative group"),h(F,"id","single-execution-run"),h(F,"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"),h(F,"href","#single-execution-run"),h(G,"class","relative group"),en(Be.src,wa="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes.png")||h(Be,"src",wa),h(Be,"width","200"),en(Ae.src,$a="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/sea_and_island.png")||h(Ae,"src",$a),h(Ae,"width","200"),h(O,"id","chatbased-execution-chat"),h(O,"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"),h(O,"href","#chatbased-execution-chat"),h(Z,"class","relative group"),en(qe.src,_a="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes.png")||h(qe,"src",_a),h(qe,"width","200"),en(Re.src,ja="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes_and_beaver.png")||h(Re,"src",ja),h(Re,"width","200"),h(D,"id","remote-execution"),h(D,"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"),h(D,"href","#remote-execution"),h(P,"class","relative group"),h(ee,"id","whats-happening-here-what-are-tools-and-what-are-agents"),h(ee,"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"),h(ee,"href","#whats-happening-here-what-are-tools-and-what-are-agents"),h(Y,"class","relative group"),en(It.src,Ha="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/diagram.png")||h(It,"src",Ha),h(te,"id","agents"),h(te,"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"),h(te,"href","#agents"),h(E,"class","relative group"),h(ne,"id","tools"),h(ne,"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"),h(ne,"href","#tools"),h(L,"class","relative group"),h(le,"id","codeexecution"),h(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"),h(le,"href","#codeexecution"),h(S,"class","relative group"),h(ae,"id","a-curated-set-of-tools"),h(ae,"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"),h(ae,"href","#a-curated-set-of-tools"),h(q,"class","relative group"),h(se,"id","custom-tools"),h(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"),h(se,"href","#custom-tools"),h(N,"class","relative group"),h(oe,"id","code-generation"),h(oe,"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"),h(oe,"href","#code-generation"),h(R,"class","relative group")},m(e,n){p(document.head,m),l(e,j,n),l(e,$,n),l(e,x,n),l(e,_,n),p(_,C),p(C,X),g(k,X,null),p(_,W),p(_,I),l(e,U,n),g(B,e,n),l(e,H,n),l(e,T,n),l(e,u,n),l(e,M,n),l(e,tn,n),l(e,he,n),l(e,nn,n),g(pe,e,n),l(e,ln,n),l(e,ue,n),l(e,an,n),l(e,sn,n),l(e,on,n),g(fe,e,n),l(e,rn,n),l(e,me,n),l(e,hn,n),l(e,pn,n),l(e,un,n),g(ce,e,n),l(e,fn,n),l(e,de,n),l(e,mn,n),l(e,A,n),p(A,z),p(z,Et),g(ge,Et,null),p(A,Nl),p(A,kt),l(e,cn,n),l(e,ve,n),l(e,dn,n),l(e,we,n),l(e,gn,n),g(ye,e,n),l(e,vn,n),l(e,$e,n),l(e,wn,n),g(Me,e,n),l(e,yn,n),g(be,e,n),l(e,$n,n),l(e,xe,n),l(e,Mn,n),g(Ce,e,n),l(e,bn,n),l(e,Te,n),l(e,xn,n),g(_e,e,n),l(e,Cn,n),l(e,je,n),l(e,Tn,n),g(V,e,n),l(e,_n,n),l(e,ke,n),l(e,jn,n),l(e,G,n),p(G,F),p(F,Lt),g(Ue,Lt,null),p(G,Rl),p(G,Ut),l(e,kn,n),l(e,Je,n),l(e,Un,n),g(We,e,n),l(e,Jn,n),l(e,Be,n),l(e,Wn,n),l(e,Ie,n),l(e,Bn,n),g(He,e,n),l(e,In,n),l(e,Ae,n),l(e,Hn,n),l(e,An,n),l(e,Gn,n),l(e,Ge,n),l(e,Zn,n),l(e,Ze,n),l(e,Pn,n),l(e,Pe,n),l(e,Yn,n),g(Ye,e,n),l(e,En,n),g(K,e,n),l(e,Ln,n),l(e,Z,n),p(Z,O),p(O,St),g(Ee,St,null),p(Z,Ql),p(Z,Jt),l(e,Sn,n),l(e,Le,n),l(e,qn,n),g(Se,e,n),l(e,Nn,n),l(e,qe,n),l(e,Rn,n),g(Ne,e,n),l(e,Qn,n),l(e,Re,n),l(e,Xn,n),l(e,zn,n),l(e,Vn,n),l(e,Qe,n),l(e,Fn,n),l(e,Xe,n),l(e,Kn,n),l(e,P,n),p(P,D),p(D,qt),g(ze,qt,null),p(P,Xl),p(P,Wt),l(e,On,n),l(e,Ve,n),l(e,Dn,n),l(e,Fe,n),l(e,el,n),l(e,Y,n),p(Y,ee),p(ee,Nt),g(Ke,Nt,null),p(Y,zl),p(Y,Bt),l(e,tl,n),l(e,It,n),l(e,nl,n),l(e,E,n),p(E,te),p(te,Rt),g(Oe,Rt,null),p(E,Vl),p(E,Ht),l(e,ll,n),l(e,De,n),l(e,al,n),l(e,et,n),l(e,sl,n),l(e,L,n),p(L,ne),p(ne,Qt),g(tt,Qt,null),p(L,Fl),p(L,At),l(e,ol,n),l(e,nt,n),l(e,il,n),l(e,lt,n),l(e,rl,n),l(e,S,n),p(S,le),p(le,Xt),g(at,Xt,null),p(S,Kl),p(S,Gt),l(e,hl,n),l(e,st,n),l(e,pl,n),l(e,ot,n),l(e,ul,n),l(e,it,n),l(e,fl,n),l(e,rt,n),l(e,ml,n),l(e,q,n),p(q,ae),p(ae,zt),g(ht,zt,null),p(q,Ol),p(q,Zt),l(e,cl,n),l(e,pt,n),l(e,dl,n),l(e,ut,n),l(e,gl,n),l(e,ft,n),l(e,vl,n),g(mt,e,n),l(e,wl,n),l(e,N,n),p(N,se),p(se,Vt),g(ct,Vt,null),p(N,Dl),p(N,Pt),l(e,yl,n),l(e,dt,n),l(e,$l,n),l(e,gt,n),l(e,Ml,n),l(e,vt,n),l(e,bl,n),l(e,wt,n),l(e,xl,n),l(e,yt,n),l(e,Cl,n),l(e,R,n),p(R,oe),p(oe,Ft),g($t,Ft,null),p(R,ea),p(R,Yt),l(e,Tl,n),l(e,Mt,n),l(e,_l,n),l(e,bt,n),l(e,jl,n),g(xt,e,n),l(e,kl,n),l(e,Ct,n),l(e,Ul,n),g(Tt,e,n),l(e,Jl,n),l(e,_t,n),l(e,Wl,n),l(e,Kt,n),Bl=!0},p(e,[n]){const jt={};n&2&&(jt.$$scope={dirty:n,ctx:e}),B.$set(jt);const Ot={};n&2&&(Ot.$$scope={dirty:n,ctx:e}),V.$set(Ot);const Dt={};n&2&&(Dt.$$scope={dirty:n,ctx:e}),K.$set(Dt)},i(e){Bl||(v(k.$$.fragment,e),v(B.$$.fragment,e),v(pe.$$.fragment,e),v(fe.$$.fragment,e),v(ce.$$.fragment,e),v(ge.$$.fragment,e),v(ye.$$.fragment,e),v(Me.$$.fragment,e),v(be.$$.fragment,e),v(Ce.$$.fragment,e),v(_e.$$.fragment,e),v(V.$$.fragment,e),v(Ue.$$.fragment,e),v(We.$$.fragment,e),v(He.$$.fragment,e),v(Ye.$$.fragment,e),v(K.$$.fragment,e),v(Ee.$$.fragment,e),v(Se.$$.fragment,e),v(Ne.$$.fragment,e),v(ze.$$.fragment,e),v(Ke.$$.fragment,e),v(Oe.$$.fragment,e),v(tt.$$.fragment,e),v(at.$$.fragment,e),v(ht.$$.fragment,e),v(mt.$$.fragment,e),v(ct.$$.fragment,e),v($t.$$.fragment,e),v(xt.$$.fragment,e),v(Tt.$$.fragment,e),Bl=!0)},o(e){w(k.$$.fragment,e),w(B.$$.fragment,e),w(pe.$$.fragment,e),w(fe.$$.fragment,e),w(ce.$$.fragment,e),w(ge.$$.fragment,e),w(ye.$$.fragment,e),w(Me.$$.fragment,e),w(be.$$.fragment,e),w(Ce.$$.fragment,e),w(_e.$$.fragment,e),w(V.$$.fragment,e),w(Ue.$$.fragment,e),w(We.$$.fragment,e),w(He.$$.fragment,e),w(Ye.$$.fragment,e),w(K.$$.fragment,e),w(Ee.$$.fragment,e),w(Se.$$.fragment,e),w(Ne.$$.fragment,e),w(ze.$$.fragment,e),w(Ke.$$.fragment,e),w(Oe.$$.fragment,e),w(tt.$$.fragment,e),w(at.$$.fragment,e),w(ht.$$.fragment,e),w(mt.$$.fragment,e),w(ct.$$.fragment,e),w($t.$$.fragment,e),w(xt.$$.fragment,e),w(Tt.$$.fragment,e),Bl=!1},d(e){e&&(t(j),t($),t(x),t(_),t(U),t(H),t(T),t(u),t(M),t(tn),t(he),t(nn),t(ln),t(ue),t(an),t(sn),t(on),t(rn),t(me),t(hn),t(pn),t(un),t(fn),t(de),t(mn),t(A),t(cn),t(ve),t(dn),t(we),t(gn),t(vn),t($e),t(wn),t(yn),t($n),t(xe),t(Mn),t(bn),t(Te),t(xn),t(Cn),t(je),t(Tn),t(_n),t(ke),t(jn),t(G),t(kn),t(Je),t(Un),t(Jn),t(Be),t(Wn),t(Ie),t(Bn),t(In),t(Ae),t(Hn),t(An),t(Gn),t(Ge),t(Zn),t(Ze),t(Pn),t(Pe),t(Yn),t(En),t(Ln),t(Z),t(Sn),t(Le),t(qn),t(Nn),t(qe),t(Rn),t(Qn),t(Re),t(Xn),t(zn),t(Vn),t(Qe),t(Fn),t(Xe),t(Kn),t(P),t(On),t(Ve),t(Dn),t(Fe),t(el),t(Y),t(tl),t(It),t(nl),t(E),t(ll),t(De),t(al),t(et),t(sl),t(L),t(ol),t(nt),t(il),t(lt),t(rl),t(S),t(hl),t(st),t(pl),t(ot),t(ul),t(it),t(fl),t(rt),t(ml),t(q),t(cl),t(pt),t(dl),t(ut),t(gl),t(ft),t(vl),t(wl),t(N),t(yl),t(dt),t($l),t(gt),t(Ml),t(vt),t(bl),t(wt),t(xl),t(yt),t(Cl),t(R),t(Tl),t(Mt),t(_l),t(bt),t(jl),t(kl),t(Ct),t(Ul),t(Jl),t(_t),t(Wl),t(Kt)),t(m),y(k),y(B,e),y(pe,e),y(fe,e),y(ce,e),y(ge),y(ye,e),y(Me,e),y(be,e),y(Ce,e),y(_e,e),y(V,e),y(Ue),y(We,e),y(He,e),y(Ye,e),y(K,e),y(Ee),y(Se,e),y(Ne,e),y(ze),y(Ke),y(Oe),y(tt),y(at),y(ht),y(mt,e),y(ct),y($t),y(xt,e),y(Tt,e)}}}const Ps={local:"transformers-agents",sections:[{local:"quickstart",sections:[{local:"single-execution-run",title:"Single execution (run)"},{local:"chatbased-execution-chat",title:"Chat-based execution (chat)"},{local:"remote-execution",title:"⚠️ Remote execution"},{local:"whats-happening-here-what-are-tools-and-what-are-agents",sections:[{local:"agents",title:"Agents"},{local:"tools",title:"Tools"},{local:"codeexecution",title:"Code-execution?!"}],title:"What's happening here? What are tools, and what are agents?"},{local:"a-curated-set-of-tools",title:"A curated set of tools"},{local:"custom-tools",title:"Custom tools"},{local:"code-generation",title:"Code generation"}],title:"Quickstart"}],title:"Transformers Agents"};function Ys(Q){return Js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rs extends Ws{constructor(m){super(),Bs(this,m,Ys,Zs,Us,{})}}export{Rs as component};
