import{s as Us,f as tn,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 e,c as i,j as m,v as d,y as r,k as h,o as p,a as l,w as g,d as v,t as y,x as w}from"../chunks/index.78c82d43.js";import{T as ea}from"../chunks/Tip.87d55b76.js";import{I as J}from"../chunks/IconCopyLink.bedaa44d.js";import{C as x}from"../chunks/CodeBlock.48618ec2.js";function Hs(Q){let f,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(){f=a("p"),f.textContent=j},l($){f=s($,"P",{"data-svelte-h":!0}),r(f)!=="svelte-1fgfei3"&&(f.textContent=j)},m($,b){l($,f,b)},p:na,d($){$&&e(f)}}}function As(Q){let f,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(){f=a("p"),f.textContent=j},l($){f=s($,"P",{"data-svelte-h":!0}),r(f)!=="svelte-13io30c"&&(f.textContent=j)},m($,b){l($,f,b)},p:na,d($){$&&e(f)}}}function Gs(Q){let f,j="This can be helpful when the model is unable to understand your request and mixes tools. An example would be:",$,b,_,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>",it,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,rt;return b=new x({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMHRoZSUyMHBpY3R1cmUlMjBvZiUyMGElMjBjYXB5YmFyYSUyMHN3aW1taW5nJTIwaW4lMjB0aGUlMjBzZWElMjIp",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me the picture of a capybara swimming in the sea&quot;</span>)'}}),T=new x({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>)'}}),{c(){f=a("p"),f.textContent=j,$=o(),c(b.$$.fragment),_=o(),C=a("p"),C.textContent=X,k=o(),W=a("ul"),W.innerHTML=I,it=o(),U=a("p"),U.textContent=B,H=o(),c(T.$$.fragment)},l(u){f=s(u,"P",{"data-svelte-h":!0}),r(f)!=="svelte-xtdcfc"&&(f.textContent=j),$=i(u),d(b.$$.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),it=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,f,M),l(u,$,M),g(b,u,M),l(u,_,M),l(u,C,M),l(u,k,M),l(u,W,M),l(u,it,M),l(u,U,M),l(u,H,M),g(T,u,M),rt=!0},p:na,i(u){rt||(v(b.$$.fragment,u),v(T.$$.fragment,u),rt=!0)},o(u){y(b.$$.fragment,u),y(T.$$.fragment,u),rt=!1},d(u){u&&(e(f),e($),e(_),e(C),e(k),e(W),e(it),e(U),e(H)),w(b,u),w(T,u)}}}function Zs(Q){let f,j,$,b,_,C,X,k,W,I,it="Transformers Agents",U,B,H,T,rt=`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.`,en,ht,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,pt,ln,ut,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,mt,rn,ft,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,ct,mn,dt,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>',fn,A,z,Ee,gt,ql,ke,ra="Quickstart",cn,vt,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,yt,pa="To start with, please install the <code>agents</code> extras in order to install all default dependencies.",gn,wt,vn,$t,ua='To use openAI models, you instantiate an <a href="/docs/transformers/v4.33.3/en/main_classes/agent#transformers.OpenAiAgent">OpenAiAgent</a> after installing the <code>openai</code> dependency:',yn,Mt,wn,xt,$n,bt,ma="To use BigCode or OpenAssistant, start by logging in to have access to the Inference API:",Mn,Ct,xn,Tt,fa="Then, instantiate the agent",bn,_t,Cn,jt,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,kt,da="You’re now good to go! Let’s dive into the two APIs that you now have at your disposal.",jn,G,F,Le,Ut,Rl,Ue,ga="Single execution (run)",kn,Jt,va='The single execution method is when using the <a href="/docs/transformers/v4.33.3/en/main_classes/agent#transformers.Agent.run">run()</a> method of the agent:',Un,Wt,Jn,Bt,ya,Wn,It,wa=`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,Ht,In,At,$a,Hn,An,Gn,Gt,Ma='Every <a href="/docs/transformers/v4.33.3/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,Zt,xa=`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,Pt,ba=`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,Yt,En,K,Ln,Z,O,Se,Et,Ql,Je,Ca="Chat-based execution (chat)",Sn,Lt,Ta='The agent also has a chat-based approach, using the <a href="/docs/transformers/v4.33.3/en/main_classes/agent#transformers.Agent.chat">chat()</a> method:',Nn,St,qn,Nt,_a,Rn,qt,Qn,Rt,ja,Xn,zn,Vn,Qt,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.33.3/en/main_classes/agent#transformers.Agent.run">run()</a>
method is better at handling).`,Fn,Xt,Ua="This method can also take arguments if you would like to pass non-text types or specific prompts.",Kn,P,D,Ne,zt,Xl,We,Ja="⚠️ Remote execution",On,Vt,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,Ft,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>.`,tl,Y,tt,qe,Kt,zl,Be,Ia="What's happening here? What are tools, and what are agents?",el,Ie,Ha,nl,E,et,Re,Ot,Vl,He,Aa="Agents",ll,Dt,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,te,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,nt,Qe,ee,Fl,Ae,Pa="Tools",ol,ne,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,le,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,lt,Xe,ae,Kl,Ge,La="Code-execution?!",hl,se,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,oe,Na=`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,ie,qa=`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.`,ml,re,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.`,fl,N,at,ze,he,Ol,Ze,Qa="A curated set of tools",cl,pe,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,ue,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,me,Va="These tools have an integration in transformers, and can be used manually as well, for example:",vl,fe,yl,q,st,Ve,ce,Dl,Pe,Fa="Custom tools",wl,de,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,ge,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,ve,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>",xl,ye,ts=`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.`,bl,we,es=`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,ot,Fe,$e,ta,Ye,ns="Code generation",Tl,Me,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,xe,as="For example, the following instruction",jl,be,kl,Ce,ss="returns the following code",Ul,Te,Jl,_e,os="that you can then modify and execute yourself.",Wl,Ke,Bl;return k=new J({}),B=new ea({props:{warning:!0,$$slots:{default:[Hs]},$$scope:{ctx:Q}}}),pt=new x({props:{code:"YWdlbnQucnVuKCUyMkNhcHRpb24lMjB0aGUlMjBmb2xsb3dpbmclMjBpbWFnZSUyMiUyQyUyMGltYWdlJTNEaW1hZ2Up",highlighted:'agent.run(<span class="hljs-string">&quot;Caption the following image&quot;</span>, image=image)'}}),mt=new x({props:{code:"YWdlbnQucnVuKCUyMlJlYWQlMjB0aGUlMjBmb2xsb3dpbmclMjB0ZXh0JTIwb3V0JTIwbG91ZCUyMiUyQyUyMHRleHQlM0R0ZXh0KQ==",highlighted:'agent.run(<span class="hljs-string">&quot;Read the following text out loud&quot;</span>, text=text)'}}),ct=new x({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,
)`}}),gt=new J({}),wt=new x({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyU1QmFnZW50cyU1RA==",highlighted:"pip install transformers[agents]"}}),Mt=new x({props:{code:"cGlwJTIwaW5zdGFsbCUyMG9wZW5haQ==",highlighted:"pip install openai"}}),xt=new x({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>)`}}),Ct=new x({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>)`}}),_t=new x({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>`}}),V=new ea({props:{$$slots:{default:[As]},$$scope:{ctx:Q}}}),Ut=new J({}),Wt=new x({props:{code:"YWdlbnQucnVuKCUyMkRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcy4lMjIp",highlighted:'agent.run(<span class="hljs-string">&quot;Draw me a picture of rivers and lakes.&quot;</span>)'}}),Ht=new x({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>)'}}),Yt=new x({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)'}}),K=new ea({props:{$$slots:{default:[Gs]},$$scope:{ctx:Q}}}),Et=new J({}),St=new x({props:{code:"YWdlbnQuY2hhdCglMjJHZW5lcmF0ZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcyUyMik=",highlighted:'agent.chat(<span class="hljs-string">&quot;Generate a picture of rivers and lakes&quot;</span>)'}}),qt=new x({props:{code:"YWdlbnQuY2hhdCglMjJUcmFuc2Zvcm0lMjB0aGUlMjBwaWN0dXJlJTIwc28lMjB0aGF0JTIwdGhlcmUlMjBpcyUyMGElMjByb2NrJTIwaW4lMjB0aGVyZSUyMik=",highlighted:'agent.chat(<span class="hljs-string">&quot;Transform the picture so that there is a rock in there&quot;</span>)'}}),zt=new J({}),Kt=new J({}),Ot=new J({}),ee=new J({}),ae=new J({}),he=new J({}),fe=new x({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>)`}}),ce=new J({}),$e=new J({}),be=new x({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>)'}}),Te=new x({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>)`}}),{c(){f=a("meta"),j=o(),$=a("p"),b=o(),_=a("h1"),C=a("a"),X=a("span"),c(k.$$.fragment),W=o(),I=a("span"),I.textContent=it,U=o(),c(B.$$.fragment),H=o(),T=a("p"),T.innerHTML=rt,u=o(),M=a("p"),M.textContent=la,en=o(),ht=a("p"),ht.textContent=aa,nn=o(),c(pt.$$.fragment),ln=o(),ut=a("table"),ut.innerHTML=sa,an=o(),sn=a("hr"),on=o(),c(mt.$$.fragment),rn=o(),ft=a("table"),ft.innerHTML=oa,hn=o(),pn=a("hr"),un=o(),c(ct.$$.fragment),mn=o(),dt=a("table"),dt.innerHTML=ia,fn=o(),A=a("h2"),z=a("a"),Ee=a("span"),c(gt.$$.fragment),ql=o(),ke=a("span"),ke.textContent=ra,cn=o(),vt=a("p"),vt.innerHTML=ha,dn=o(),yt=a("p"),yt.innerHTML=pa,gn=o(),c(wt.$$.fragment),vn=o(),$t=a("p"),$t.innerHTML=ua,yn=o(),c(Mt.$$.fragment),wn=o(),c(xt.$$.fragment),$n=o(),bt=a("p"),bt.textContent=ma,Mn=o(),c(Ct.$$.fragment),xn=o(),Tt=a("p"),Tt.textContent=fa,bn=o(),c(_t.$$.fragment),Cn=o(),jt=a("p"),jt.textContent=ca,Tn=o(),c(V.$$.fragment),_n=o(),kt=a("p"),kt.textContent=da,jn=o(),G=a("h3"),F=a("a"),Le=a("span"),c(Ut.$$.fragment),Rl=o(),Ue=a("span"),Ue.textContent=ga,kn=o(),Jt=a("p"),Jt.innerHTML=va,Un=o(),c(Wt.$$.fragment),Jn=o(),Bt=a("img"),Wn=o(),It=a("p"),It.textContent=wa,Bn=o(),c(Ht.$$.fragment),In=o(),At=a("img"),Hn=o(),An=a("br"),Gn=o(),Gt=a("p"),Gt.innerHTML=Ma,Zn=o(),Zt=a("p"),Zt.innerHTML=xa,Pn=o(),Pt=a("p"),Pt.textContent=ba,Yn=o(),c(Yt.$$.fragment),En=o(),c(K.$$.fragment),Ln=o(),Z=a("h3"),O=a("a"),Se=a("span"),c(Et.$$.fragment),Ql=o(),Je=a("span"),Je.textContent=Ca,Sn=o(),Lt=a("p"),Lt.innerHTML=Ta,Nn=o(),c(St.$$.fragment),qn=o(),Nt=a("img"),Rn=o(),c(qt.$$.fragment),Qn=o(),Rt=a("img"),Xn=o(),zn=a("br"),Vn=o(),Qt=a("p"),Qt.innerHTML=ka,Fn=o(),Xt=a("p"),Xt.textContent=Ua,Kn=o(),P=a("h3"),D=a("a"),Ne=a("span"),c(zt.$$.fragment),Xl=o(),We=a("span"),We.textContent=Ja,On=o(),Vt=a("p"),Vt.innerHTML=Wa,Dn=o(),Ft=a("p"),Ft.innerHTML=Ba,tl=o(),Y=a("h3"),tt=a("a"),qe=a("span"),c(Kt.$$.fragment),zl=o(),Be=a("span"),Be.textContent=Ia,el=o(),Ie=a("img"),nl=o(),E=a("h4"),et=a("a"),Re=a("span"),c(Ot.$$.fragment),Vl=o(),He=a("span"),He.textContent=Aa,ll=o(),Dt=a("p"),Dt.textContent=Ga,al=o(),te=a("p"),te.textContent=Za,sl=o(),L=a("h4"),nt=a("a"),Qe=a("span"),c(ee.$$.fragment),Fl=o(),Ae=a("span"),Ae.textContent=Pa,ol=o(),ne=a("p"),ne.textContent=Ya,il=o(),le=a("p"),le.textContent=Ea,rl=o(),S=a("h4"),lt=a("a"),Xe=a("span"),c(ae.$$.fragment),Kl=o(),Ge=a("span"),Ge.textContent=La,hl=o(),se=a("p"),se.textContent=Sa,pl=o(),oe=a("p"),oe.textContent=Na,ul=o(),ie=a("p"),ie.textContent=qa,ml=o(),re=a("p"),re.textContent=Ra,fl=o(),N=a("h3"),at=a("a"),ze=a("span"),c(he.$$.fragment),Ol=o(),Ze=a("span"),Ze.textContent=Qa,cl=o(),pe=a("p"),pe.innerHTML=Xa,dl=o(),ue=a("ul"),ue.innerHTML=za,gl=o(),me=a("p"),me.textContent=Va,vl=o(),c(fe.$$.fragment),yl=o(),q=a("h3"),st=a("a"),Ve=a("span"),c(ce.$$.fragment),Dl=o(),Pe=a("span"),Pe.textContent=Fa,wl=o(),de=a("p"),de.textContent=Ka,$l=o(),ge=a("p"),ge.innerHTML=Oa,Ml=o(),ve=a("ul"),ve.innerHTML=Da,xl=o(),ye=a("p"),ye.innerHTML=ts,bl=o(),we=a("p"),we.innerHTML=es,Cl=o(),R=a("h3"),ot=a("a"),Fe=a("span"),c($e.$$.fragment),ta=o(),Ye=a("span"),Ye.textContent=ns,Tl=o(),Me=a("p"),Me.textContent=ls,_l=o(),xe=a("p"),xe.textContent=as,jl=o(),c(be.$$.fragment),kl=o(),Ce=a("p"),Ce.textContent=ss,Ul=o(),c(Te.$$.fragment),Jl=o(),_e=a("p"),_e.textContent=os,Wl=o(),Ke=a("p"),this.h()},l(t){const n=Is("svelte-1phssyn",document.head);f=s(n,"META",{name:!0,content:!0}),n.forEach(e),j=i(t),$=s(t,"P",{}),m($).forEach(e),b=i(t),_=s(t,"H1",{class:!0});var je=m(_);C=s(je,"A",{id:!0,class:!0,href:!0});var Oe=m(C);X=s(Oe,"SPAN",{});var De=m(X);d(k.$$.fragment,De),De.forEach(e),Oe.forEach(e),W=i(je),I=s(je,"SPAN",{"data-svelte-h":!0}),r(I)!=="svelte-1kdlnnd"&&(I.textContent=it),je.forEach(e),U=i(t),d(B.$$.fragment,t),H=i(t),T=s(t,"P",{"data-svelte-h":!0}),r(T)!=="svelte-hggcnq"&&(T.innerHTML=rt),u=i(t),M=s(t,"P",{"data-svelte-h":!0}),r(M)!=="svelte-g8wjpq"&&(M.textContent=la),en=i(t),ht=s(t,"P",{"data-svelte-h":!0}),r(ht)!=="svelte-ijizhx"&&(ht.textContent=aa),nn=i(t),d(pt.$$.fragment,t),ln=i(t),ut=s(t,"TABLE",{"data-svelte-h":!0}),r(ut)!=="svelte-gt1bz9"&&(ut.innerHTML=sa),an=i(t),sn=s(t,"HR",{}),on=i(t),d(mt.$$.fragment,t),rn=i(t),ft=s(t,"TABLE",{"data-svelte-h":!0}),r(ft)!=="svelte-1a2vad0"&&(ft.innerHTML=oa),hn=i(t),pn=s(t,"HR",{}),un=i(t),d(ct.$$.fragment,t),mn=i(t),dt=s(t,"TABLE",{"data-svelte-h":!0}),r(dt)!=="svelte-1iw5xoi"&&(dt.innerHTML=ia),fn=i(t),A=s(t,"H2",{class:!0});var Il=m(A);z=s(Il,"A",{id:!0,class:!0,href:!0});var is=m(z);Ee=s(is,"SPAN",{});var rs=m(Ee);d(gt.$$.fragment,rs),rs.forEach(e),is.forEach(e),ql=i(Il),ke=s(Il,"SPAN",{"data-svelte-h":!0}),r(ke)!=="svelte-1nw2yoa"&&(ke.textContent=ra),Il.forEach(e),cn=i(t),vt=s(t,"P",{"data-svelte-h":!0}),r(vt)!=="svelte-1dmdrm1"&&(vt.innerHTML=ha),dn=i(t),yt=s(t,"P",{"data-svelte-h":!0}),r(yt)!=="svelte-1dv7sdf"&&(yt.innerHTML=pa),gn=i(t),d(wt.$$.fragment,t),vn=i(t),$t=s(t,"P",{"data-svelte-h":!0}),r($t)!=="svelte-1ajiaw8"&&($t.innerHTML=ua),yn=i(t),d(Mt.$$.fragment,t),wn=i(t),d(xt.$$.fragment,t),$n=i(t),bt=s(t,"P",{"data-svelte-h":!0}),r(bt)!=="svelte-1jiytcn"&&(bt.textContent=ma),Mn=i(t),d(Ct.$$.fragment,t),xn=i(t),Tt=s(t,"P",{"data-svelte-h":!0}),r(Tt)!=="svelte-ezmlbn"&&(Tt.textContent=fa),bn=i(t),d(_t.$$.fragment,t),Cn=i(t),jt=s(t,"P",{"data-svelte-h":!0}),r(jt)!=="svelte-4zoxn5"&&(jt.textContent=ca),Tn=i(t),d(V.$$.fragment,t),_n=i(t),kt=s(t,"P",{"data-svelte-h":!0}),r(kt)!=="svelte-1pylma2"&&(kt.textContent=da),jn=i(t),G=s(t,"H3",{class:!0});var Hl=m(G);F=s(Hl,"A",{id:!0,class:!0,href:!0});var hs=m(F);Le=s(hs,"SPAN",{});var ps=m(Le);d(Ut.$$.fragment,ps),ps.forEach(e),hs.forEach(e),Rl=i(Hl),Ue=s(Hl,"SPAN",{"data-svelte-h":!0}),r(Ue)!=="svelte-2v9j7z"&&(Ue.textContent=ga),Hl.forEach(e),kn=i(t),Jt=s(t,"P",{"data-svelte-h":!0}),r(Jt)!=="svelte-e7ijyv"&&(Jt.innerHTML=va),Un=i(t),d(Wt.$$.fragment,t),Jn=i(t),Bt=s(t,"IMG",{src:!0,width:!0}),Wn=i(t),It=s(t,"P",{"data-svelte-h":!0}),r(It)!=="svelte-aarw7i"&&(It.textContent=wa),Bn=i(t),d(Ht.$$.fragment,t),In=i(t),At=s(t,"IMG",{src:!0,width:!0}),Hn=i(t),An=s(t,"BR",{}),Gn=i(t),Gt=s(t,"P",{"data-svelte-h":!0}),r(Gt)!=="svelte-1f0rktw"&&(Gt.innerHTML=Ma),Zn=i(t),Zt=s(t,"P",{"data-svelte-h":!0}),r(Zt)!=="svelte-1kxdglx"&&(Zt.innerHTML=xa),Pn=i(t),Pt=s(t,"P",{"data-svelte-h":!0}),r(Pt)!=="svelte-pifkum"&&(Pt.textContent=ba),Yn=i(t),d(Yt.$$.fragment,t),En=i(t),d(K.$$.fragment,t),Ln=i(t),Z=s(t,"H3",{class:!0});var Al=m(Z);O=s(Al,"A",{id:!0,class:!0,href:!0});var us=m(O);Se=s(us,"SPAN",{});var ms=m(Se);d(Et.$$.fragment,ms),ms.forEach(e),us.forEach(e),Ql=i(Al),Je=s(Al,"SPAN",{"data-svelte-h":!0}),r(Je)!=="svelte-2sh1vs"&&(Je.textContent=Ca),Al.forEach(e),Sn=i(t),Lt=s(t,"P",{"data-svelte-h":!0}),r(Lt)!=="svelte-1djrn20"&&(Lt.innerHTML=Ta),Nn=i(t),d(St.$$.fragment,t),qn=i(t),Nt=s(t,"IMG",{src:!0,width:!0}),Rn=i(t),d(qt.$$.fragment,t),Qn=i(t),Rt=s(t,"IMG",{src:!0,width:!0}),Xn=i(t),zn=s(t,"BR",{}),Vn=i(t),Qt=s(t,"P",{"data-svelte-h":!0}),r(Qt)!=="svelte-lvz9xv"&&(Qt.innerHTML=ka),Fn=i(t),Xt=s(t,"P",{"data-svelte-h":!0}),r(Xt)!=="svelte-16wygo5"&&(Xt.textContent=Ua),Kn=i(t),P=s(t,"H3",{class:!0});var Gl=m(P);D=s(Gl,"A",{id:!0,class:!0,href:!0});var fs=m(D);Ne=s(fs,"SPAN",{});var cs=m(Ne);d(zt.$$.fragment,cs),cs.forEach(e),fs.forEach(e),Xl=i(Gl),We=s(Gl,"SPAN",{"data-svelte-h":!0}),r(We)!=="svelte-1f21k2c"&&(We.textContent=Ja),Gl.forEach(e),On=i(t),Vt=s(t,"P",{"data-svelte-h":!0}),r(Vt)!=="svelte-1y37z6"&&(Vt.innerHTML=Wa),Dn=i(t),Ft=s(t,"P",{"data-svelte-h":!0}),r(Ft)!=="svelte-h6dg90"&&(Ft.innerHTML=Ba),tl=i(t),Y=s(t,"H3",{class:!0});var Zl=m(Y);tt=s(Zl,"A",{id:!0,class:!0,href:!0});var ds=m(tt);qe=s(ds,"SPAN",{});var gs=m(qe);d(Kt.$$.fragment,gs),gs.forEach(e),ds.forEach(e),zl=i(Zl),Be=s(Zl,"SPAN",{"data-svelte-h":!0}),r(Be)!=="svelte-uj4lc5"&&(Be.textContent=Ia),Zl.forEach(e),el=i(t),Ie=s(t,"IMG",{src:!0}),nl=i(t),E=s(t,"H4",{class:!0});var Pl=m(E);et=s(Pl,"A",{id:!0,class:!0,href:!0});var vs=m(et);Re=s(vs,"SPAN",{});var ys=m(Re);d(Ot.$$.fragment,ys),ys.forEach(e),vs.forEach(e),Vl=i(Pl),He=s(Pl,"SPAN",{"data-svelte-h":!0}),r(He)!=="svelte-mjfvi7"&&(He.textContent=Aa),Pl.forEach(e),ll=i(t),Dt=s(t,"P",{"data-svelte-h":!0}),r(Dt)!=="svelte-1h1hsmq"&&(Dt.textContent=Ga),al=i(t),te=s(t,"P",{"data-svelte-h":!0}),r(te)!=="svelte-1yih65e"&&(te.textContent=Za),sl=i(t),L=s(t,"H4",{class:!0});var Yl=m(L);nt=s(Yl,"A",{id:!0,class:!0,href:!0});var ws=m(nt);Qe=s(ws,"SPAN",{});var $s=m(Qe);d(ee.$$.fragment,$s),$s.forEach(e),ws.forEach(e),Fl=i(Yl),Ae=s(Yl,"SPAN",{"data-svelte-h":!0}),r(Ae)!=="svelte-7l60uo"&&(Ae.textContent=Pa),Yl.forEach(e),ol=i(t),ne=s(t,"P",{"data-svelte-h":!0}),r(ne)!=="svelte-1pl6quz"&&(ne.textContent=Ya),il=i(t),le=s(t,"P",{"data-svelte-h":!0}),r(le)!=="svelte-owbr46"&&(le.textContent=Ea),rl=i(t),S=s(t,"H4",{class:!0});var El=m(S);lt=s(El,"A",{id:!0,class:!0,href:!0});var Ms=m(lt);Xe=s(Ms,"SPAN",{});var xs=m(Xe);d(ae.$$.fragment,xs),xs.forEach(e),Ms.forEach(e),Kl=i(El),Ge=s(El,"SPAN",{"data-svelte-h":!0}),r(Ge)!=="svelte-hkv69r"&&(Ge.textContent=La),El.forEach(e),hl=i(t),se=s(t,"P",{"data-svelte-h":!0}),r(se)!=="svelte-17ipo1r"&&(se.textContent=Sa),pl=i(t),oe=s(t,"P",{"data-svelte-h":!0}),r(oe)!=="svelte-or0pg0"&&(oe.textContent=Na),ul=i(t),ie=s(t,"P",{"data-svelte-h":!0}),r(ie)!=="svelte-fb990x"&&(ie.textContent=qa),ml=i(t),re=s(t,"P",{"data-svelte-h":!0}),r(re)!=="svelte-1ri56my"&&(re.textContent=Ra),fl=i(t),N=s(t,"H3",{class:!0});var Ll=m(N);at=s(Ll,"A",{id:!0,class:!0,href:!0});var bs=m(at);ze=s(bs,"SPAN",{});var Cs=m(ze);d(he.$$.fragment,Cs),Cs.forEach(e),bs.forEach(e),Ol=i(Ll),Ze=s(Ll,"SPAN",{"data-svelte-h":!0}),r(Ze)!=="svelte-1w9pyi6"&&(Ze.textContent=Qa),Ll.forEach(e),cl=i(t),pe=s(t,"P",{"data-svelte-h":!0}),r(pe)!=="svelte-lbnuw"&&(pe.innerHTML=Xa),dl=i(t),ue=s(t,"UL",{"data-svelte-h":!0}),r(ue)!=="svelte-5hcxax"&&(ue.innerHTML=za),gl=i(t),me=s(t,"P",{"data-svelte-h":!0}),r(me)!=="svelte-u6begh"&&(me.textContent=Va),vl=i(t),d(fe.$$.fragment,t),yl=i(t),q=s(t,"H3",{class:!0});var Sl=m(q);st=s(Sl,"A",{id:!0,class:!0,href:!0});var Ts=m(st);Ve=s(Ts,"SPAN",{});var _s=m(Ve);d(ce.$$.fragment,_s),_s.forEach(e),Ts.forEach(e),Dl=i(Sl),Pe=s(Sl,"SPAN",{"data-svelte-h":!0}),r(Pe)!=="svelte-ab1gvt"&&(Pe.textContent=Fa),Sl.forEach(e),wl=i(t),de=s(t,"P",{"data-svelte-h":!0}),r(de)!=="svelte-1qgu66u"&&(de.textContent=Ka),$l=i(t),ge=s(t,"P",{"data-svelte-h":!0}),r(ge)!=="svelte-32uplk"&&(ge.innerHTML=Oa),Ml=i(t),ve=s(t,"UL",{"data-svelte-h":!0}),r(ve)!=="svelte-18r1pun"&&(ve.innerHTML=Da),xl=i(t),ye=s(t,"P",{"data-svelte-h":!0}),r(ye)!=="svelte-np3cvk"&&(ye.innerHTML=ts),bl=i(t),we=s(t,"P",{"data-svelte-h":!0}),r(we)!=="svelte-10s0ieo"&&(we.innerHTML=es),Cl=i(t),R=s(t,"H3",{class:!0});var Nl=m(R);ot=s(Nl,"A",{id:!0,class:!0,href:!0});var js=m(ot);Fe=s(js,"SPAN",{});var ks=m(Fe);d($e.$$.fragment,ks),ks.forEach(e),js.forEach(e),ta=i(Nl),Ye=s(Nl,"SPAN",{"data-svelte-h":!0}),r(Ye)!=="svelte-8bgefq"&&(Ye.textContent=ns),Nl.forEach(e),Tl=i(t),Me=s(t,"P",{"data-svelte-h":!0}),r(Me)!=="svelte-er9qni"&&(Me.textContent=ls),_l=i(t),xe=s(t,"P",{"data-svelte-h":!0}),r(xe)!=="svelte-16j3iq1"&&(xe.textContent=as),jl=i(t),d(be.$$.fragment,t),kl=i(t),Ce=s(t,"P",{"data-svelte-h":!0}),r(Ce)!=="svelte-pibxgg"&&(Ce.textContent=ss),Ul=i(t),d(Te.$$.fragment,t),Jl=i(t),_e=s(t,"P",{"data-svelte-h":!0}),r(_e)!=="svelte-rbbu3k"&&(_e.textContent=os),Wl=i(t),Ke=s(t,"P",{}),m(Ke).forEach(e),this.h()},h(){h(f,"name","hf:doc:metadata"),h(f,"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"),tn(Bt.src,ya="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes.png")||h(Bt,"src",ya),h(Bt,"width","200"),tn(At.src,$a="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/sea_and_island.png")||h(At,"src",$a),h(At,"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"),tn(Nt.src,_a="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes.png")||h(Nt,"src",_a),h(Nt,"width","200"),tn(Rt.src,ja="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/rivers_and_lakes_and_beaver.png")||h(Rt,"src",ja),h(Rt,"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(tt,"id","whats-happening-here-what-are-tools-and-what-are-agents"),h(tt,"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(tt,"href","#whats-happening-here-what-are-tools-and-what-are-agents"),h(Y,"class","relative group"),tn(Ie.src,Ha="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/diagram.png")||h(Ie,"src",Ha),h(et,"id","agents"),h(et,"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(et,"href","#agents"),h(E,"class","relative group"),h(nt,"id","tools"),h(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"),h(nt,"href","#tools"),h(L,"class","relative group"),h(lt,"id","codeexecution"),h(lt,"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(lt,"href","#codeexecution"),h(S,"class","relative group"),h(at,"id","a-curated-set-of-tools"),h(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"),h(at,"href","#a-curated-set-of-tools"),h(N,"class","relative group"),h(st,"id","custom-tools"),h(st,"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(st,"href","#custom-tools"),h(q,"class","relative group"),h(ot,"id","code-generation"),h(ot,"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(ot,"href","#code-generation"),h(R,"class","relative group")},m(t,n){p(document.head,f),l(t,j,n),l(t,$,n),l(t,b,n),l(t,_,n),p(_,C),p(C,X),g(k,X,null),p(_,W),p(_,I),l(t,U,n),g(B,t,n),l(t,H,n),l(t,T,n),l(t,u,n),l(t,M,n),l(t,en,n),l(t,ht,n),l(t,nn,n),g(pt,t,n),l(t,ln,n),l(t,ut,n),l(t,an,n),l(t,sn,n),l(t,on,n),g(mt,t,n),l(t,rn,n),l(t,ft,n),l(t,hn,n),l(t,pn,n),l(t,un,n),g(ct,t,n),l(t,mn,n),l(t,dt,n),l(t,fn,n),l(t,A,n),p(A,z),p(z,Ee),g(gt,Ee,null),p(A,ql),p(A,ke),l(t,cn,n),l(t,vt,n),l(t,dn,n),l(t,yt,n),l(t,gn,n),g(wt,t,n),l(t,vn,n),l(t,$t,n),l(t,yn,n),g(Mt,t,n),l(t,wn,n),g(xt,t,n),l(t,$n,n),l(t,bt,n),l(t,Mn,n),g(Ct,t,n),l(t,xn,n),l(t,Tt,n),l(t,bn,n),g(_t,t,n),l(t,Cn,n),l(t,jt,n),l(t,Tn,n),g(V,t,n),l(t,_n,n),l(t,kt,n),l(t,jn,n),l(t,G,n),p(G,F),p(F,Le),g(Ut,Le,null),p(G,Rl),p(G,Ue),l(t,kn,n),l(t,Jt,n),l(t,Un,n),g(Wt,t,n),l(t,Jn,n),l(t,Bt,n),l(t,Wn,n),l(t,It,n),l(t,Bn,n),g(Ht,t,n),l(t,In,n),l(t,At,n),l(t,Hn,n),l(t,An,n),l(t,Gn,n),l(t,Gt,n),l(t,Zn,n),l(t,Zt,n),l(t,Pn,n),l(t,Pt,n),l(t,Yn,n),g(Yt,t,n),l(t,En,n),g(K,t,n),l(t,Ln,n),l(t,Z,n),p(Z,O),p(O,Se),g(Et,Se,null),p(Z,Ql),p(Z,Je),l(t,Sn,n),l(t,Lt,n),l(t,Nn,n),g(St,t,n),l(t,qn,n),l(t,Nt,n),l(t,Rn,n),g(qt,t,n),l(t,Qn,n),l(t,Rt,n),l(t,Xn,n),l(t,zn,n),l(t,Vn,n),l(t,Qt,n),l(t,Fn,n),l(t,Xt,n),l(t,Kn,n),l(t,P,n),p(P,D),p(D,Ne),g(zt,Ne,null),p(P,Xl),p(P,We),l(t,On,n),l(t,Vt,n),l(t,Dn,n),l(t,Ft,n),l(t,tl,n),l(t,Y,n),p(Y,tt),p(tt,qe),g(Kt,qe,null),p(Y,zl),p(Y,Be),l(t,el,n),l(t,Ie,n),l(t,nl,n),l(t,E,n),p(E,et),p(et,Re),g(Ot,Re,null),p(E,Vl),p(E,He),l(t,ll,n),l(t,Dt,n),l(t,al,n),l(t,te,n),l(t,sl,n),l(t,L,n),p(L,nt),p(nt,Qe),g(ee,Qe,null),p(L,Fl),p(L,Ae),l(t,ol,n),l(t,ne,n),l(t,il,n),l(t,le,n),l(t,rl,n),l(t,S,n),p(S,lt),p(lt,Xe),g(ae,Xe,null),p(S,Kl),p(S,Ge),l(t,hl,n),l(t,se,n),l(t,pl,n),l(t,oe,n),l(t,ul,n),l(t,ie,n),l(t,ml,n),l(t,re,n),l(t,fl,n),l(t,N,n),p(N,at),p(at,ze),g(he,ze,null),p(N,Ol),p(N,Ze),l(t,cl,n),l(t,pe,n),l(t,dl,n),l(t,ue,n),l(t,gl,n),l(t,me,n),l(t,vl,n),g(fe,t,n),l(t,yl,n),l(t,q,n),p(q,st),p(st,Ve),g(ce,Ve,null),p(q,Dl),p(q,Pe),l(t,wl,n),l(t,de,n),l(t,$l,n),l(t,ge,n),l(t,Ml,n),l(t,ve,n),l(t,xl,n),l(t,ye,n),l(t,bl,n),l(t,we,n),l(t,Cl,n),l(t,R,n),p(R,ot),p(ot,Fe),g($e,Fe,null),p(R,ta),p(R,Ye),l(t,Tl,n),l(t,Me,n),l(t,_l,n),l(t,xe,n),l(t,jl,n),g(be,t,n),l(t,kl,n),l(t,Ce,n),l(t,Ul,n),g(Te,t,n),l(t,Jl,n),l(t,_e,n),l(t,Wl,n),l(t,Ke,n),Bl=!0},p(t,[n]){const je={};n&2&&(je.$$scope={dirty:n,ctx:t}),B.$set(je);const Oe={};n&2&&(Oe.$$scope={dirty:n,ctx:t}),V.$set(Oe);const De={};n&2&&(De.$$scope={dirty:n,ctx:t}),K.$set(De)},i(t){Bl||(v(k.$$.fragment,t),v(B.$$.fragment,t),v(pt.$$.fragment,t),v(mt.$$.fragment,t),v(ct.$$.fragment,t),v(gt.$$.fragment,t),v(wt.$$.fragment,t),v(Mt.$$.fragment,t),v(xt.$$.fragment,t),v(Ct.$$.fragment,t),v(_t.$$.fragment,t),v(V.$$.fragment,t),v(Ut.$$.fragment,t),v(Wt.$$.fragment,t),v(Ht.$$.fragment,t),v(Yt.$$.fragment,t),v(K.$$.fragment,t),v(Et.$$.fragment,t),v(St.$$.fragment,t),v(qt.$$.fragment,t),v(zt.$$.fragment,t),v(Kt.$$.fragment,t),v(Ot.$$.fragment,t),v(ee.$$.fragment,t),v(ae.$$.fragment,t),v(he.$$.fragment,t),v(fe.$$.fragment,t),v(ce.$$.fragment,t),v($e.$$.fragment,t),v(be.$$.fragment,t),v(Te.$$.fragment,t),Bl=!0)},o(t){y(k.$$.fragment,t),y(B.$$.fragment,t),y(pt.$$.fragment,t),y(mt.$$.fragment,t),y(ct.$$.fragment,t),y(gt.$$.fragment,t),y(wt.$$.fragment,t),y(Mt.$$.fragment,t),y(xt.$$.fragment,t),y(Ct.$$.fragment,t),y(_t.$$.fragment,t),y(V.$$.fragment,t),y(Ut.$$.fragment,t),y(Wt.$$.fragment,t),y(Ht.$$.fragment,t),y(Yt.$$.fragment,t),y(K.$$.fragment,t),y(Et.$$.fragment,t),y(St.$$.fragment,t),y(qt.$$.fragment,t),y(zt.$$.fragment,t),y(Kt.$$.fragment,t),y(Ot.$$.fragment,t),y(ee.$$.fragment,t),y(ae.$$.fragment,t),y(he.$$.fragment,t),y(fe.$$.fragment,t),y(ce.$$.fragment,t),y($e.$$.fragment,t),y(be.$$.fragment,t),y(Te.$$.fragment,t),Bl=!1},d(t){t&&(e(j),e($),e(b),e(_),e(U),e(H),e(T),e(u),e(M),e(en),e(ht),e(nn),e(ln),e(ut),e(an),e(sn),e(on),e(rn),e(ft),e(hn),e(pn),e(un),e(mn),e(dt),e(fn),e(A),e(cn),e(vt),e(dn),e(yt),e(gn),e(vn),e($t),e(yn),e(wn),e($n),e(bt),e(Mn),e(xn),e(Tt),e(bn),e(Cn),e(jt),e(Tn),e(_n),e(kt),e(jn),e(G),e(kn),e(Jt),e(Un),e(Jn),e(Bt),e(Wn),e(It),e(Bn),e(In),e(At),e(Hn),e(An),e(Gn),e(Gt),e(Zn),e(Zt),e(Pn),e(Pt),e(Yn),e(En),e(Ln),e(Z),e(Sn),e(Lt),e(Nn),e(qn),e(Nt),e(Rn),e(Qn),e(Rt),e(Xn),e(zn),e(Vn),e(Qt),e(Fn),e(Xt),e(Kn),e(P),e(On),e(Vt),e(Dn),e(Ft),e(tl),e(Y),e(el),e(Ie),e(nl),e(E),e(ll),e(Dt),e(al),e(te),e(sl),e(L),e(ol),e(ne),e(il),e(le),e(rl),e(S),e(hl),e(se),e(pl),e(oe),e(ul),e(ie),e(ml),e(re),e(fl),e(N),e(cl),e(pe),e(dl),e(ue),e(gl),e(me),e(vl),e(yl),e(q),e(wl),e(de),e($l),e(ge),e(Ml),e(ve),e(xl),e(ye),e(bl),e(we),e(Cl),e(R),e(Tl),e(Me),e(_l),e(xe),e(jl),e(kl),e(Ce),e(Ul),e(Jl),e(_e),e(Wl),e(Ke)),e(f),w(k),w(B,t),w(pt,t),w(mt,t),w(ct,t),w(gt),w(wt,t),w(Mt,t),w(xt,t),w(Ct,t),w(_t,t),w(V,t),w(Ut),w(Wt,t),w(Ht,t),w(Yt,t),w(K,t),w(Et),w(St,t),w(qt,t),w(zt),w(Kt),w(Ot),w(ee),w(ae),w(he),w(fe,t),w(ce),w($e),w(be,t),w(Te,t)}}}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(f){super(),Bs(this,f,Ys,Zs,Us,{})}}export{Rs as component};
