import{s as ul,o as fl,n as ln}from"../chunks/scheduler.25b97de1.js";import{S as bl,i as vl,g as r,s as n,r as d,A as _l,h as s,f as a,c as o,j as v,u as m,x as u,k as _,y as t,a as i,v as c,d as h,t as g,w as p}from"../chunks/index.d9030fc9.js";import{T as ls}from"../chunks/Tip.baa67368.js";import{D as $}from"../chunks/Docstring.e257edda.js";import{C as go}from"../chunks/CodeBlock.e6cd0d95.js";import{E as Aa}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as L,E as $l}from"../chunks/EditOnGithub.91d95064.js";function yl(j){let f,x=`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=r("p"),f.textContent=x},l(y){f=s(y,"P",{"data-svelte-h":!0}),u(f)!=="svelte-1fgfei3"&&(f.textContent=x)},m(y,w){i(y,f,w)},p:ln,d(y){y&&a(f)}}}function wl(j){let f,x="Example:",y,w,T;return w=new go({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5hZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBQeXRob25JbnRlcnByZXRlclRvb2wlMEElMEFweXRob25faW50ZXJwcmV0ZXIlMjAlM0QlMjBQeXRob25JbnRlcnByZXRlclRvb2woKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCcHl0aG9uX2ludGVycHJldGVyJTVEKSUwQWFnZW50LnJ1biglMjJXaGF0JTIwaXMlMjB0aGUlMjByZXN1bHQlMjBvZiUyMDIlMjBwb3dlciUyMDMuNzM4NCUzRiUyMik=",highlighted:`<span class="hljs-keyword">from</span> transformers.agents <span class="hljs-keyword">import</span> CodeAgent, PythonInterpreterTool

python_interpreter = PythonInterpreterTool()
agent = CodeAgent(tools=[python_interpreter])
agent.run(<span class="hljs-string">&quot;What is the result of 2 power 3.7384?&quot;</span>)`,wrap:!1}}),{c(){f=r("p"),f.textContent=x,y=n(),d(w.$$.fragment)},l(b){f=s(b,"P",{"data-svelte-h":!0}),u(f)!=="svelte-11lpom8"&&(f.textContent=x),y=o(b),m(w.$$.fragment,b)},m(b,C){i(b,f,C),i(b,y,C),c(w,b,C),T=!0},p:ln,i(b){T||(h(w.$$.fragment,b),T=!0)},o(b){g(w.$$.fragment,b),T=!1},d(b){b&&(a(f),a(y)),p(w,b)}}}function Tl(j){let f,x="Example:",y,w,T;return w=new go({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5hZ2VudHMlMjBpbXBvcnQlMjBSZWFjdENvZGVBZ2VudCUwQWFnZW50JTIwJTNEJTIwUmVhY3RDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQpJTBBYWdlbnQucnVuKCUyMldoYXQlMjBpcyUyMHRoZSUyMHJlc3VsdCUyMG9mJTIwMiUyMHBvd2VyJTIwMy43Mzg0JTNGJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers.agents <span class="hljs-keyword">import</span> ReactCodeAgent
agent = ReactCodeAgent(tools=[])
agent.run(<span class="hljs-string">&quot;What is the result of 2 power 3.7384?&quot;</span>)`,wrap:!1}}),{c(){f=r("p"),f.textContent=x,y=n(),d(w.$$.fragment)},l(b){f=s(b,"P",{"data-svelte-h":!0}),u(f)!=="svelte-11lpom8"&&(f.textContent=x),y=o(b),m(w.$$.fragment,b)},m(b,C){i(b,f,C),i(b,y,C),c(w,b,C),T=!0},p:ln,i(b){T||(h(w.$$.fragment,b),T=!0)},o(b){g(w.$$.fragment,b),T=!1},d(b){b&&(a(f),a(y)),p(w,b)}}}function xl(j){let f,x=`Loading a tool means that you’ll download the tool and execute it locally.
ALWAYS inspect the tool you’re downloading before loading it within your runtime, as you would do when
installing a package using pip/npm/apt.`;return{c(){f=r("p"),f.textContent=x},l(y){f=s(y,"P",{"data-svelte-h":!0}),u(f)!=="svelte-1kcherd"&&(f.textContent=x)},m(y,w){i(y,f,w)},p:ln,d(y){y&&a(f)}}}function kl(j){let f,x=`Loading a tool from the Hub means that you’ll download the tool and execute it locally.
ALWAYS inspect the tool you’re downloading before loading it within your runtime, as you would do when
installing a package using pip/npm/apt.`;return{c(){f=r("p"),f.textContent=x},l(y){f=s(y,"P",{"data-svelte-h":!0}),u(f)!=="svelte-fpk7e5"&&(f.textContent=x)},m(y,w){i(y,f,w)},p:ln,d(y){y&&a(f)}}}function Cl(j){let f,x="For instance:",y,w,T;return w=new go({props:{code:"ZnJvbSUyMG15X3Rvb2xfbW9kdWxlJTIwaW1wb3J0JTIwTXlUb29sJTBBbXlfdG9vbCUyMCUzRCUyME15VG9vbCgpJTBBbXlfdG9vbC5wdXNoX3RvX2h1YiglMjJteS11c2VybmFtZSUyRm15LXNwYWNlJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> my_tool_module <span class="hljs-keyword">import</span> MyTool
my_tool = MyTool()
my_tool.push_to_hub(<span class="hljs-string">&quot;my-username/my-space&quot;</span>)`,wrap:!1}}),{c(){f=r("p"),f.textContent=x,y=n(),d(w.$$.fragment)},l(b){f=s(b,"P",{"data-svelte-h":!0}),u(f)!=="svelte-4vay6o"&&(f.textContent=x),y=o(b),m(w.$$.fragment,b)},m(b,C){i(b,f,C),i(b,y,C),c(w,b,C),T=!0},p:ln,i(b){T||(h(w.$$.fragment,b),T=!0)},o(b){g(w.$$.fragment,b),T=!1},d(b){b&&(a(f),a(y)),p(w,b)}}}function Il(j){let f,x="Example:",y,w,T;return w=new go({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRvb2xDb2xsZWN0aW9uJTJDJTIwUmVhY3RDb2RlQWdlbnQlMEElMEFpbWFnZV90b29sX2NvbGxlY3Rpb24lMjAlM0QlMjBUb29sQ29sbGVjdGlvbihjb2xsZWN0aW9uX3NsdWclM0QlMjJodWdnaW5nZmFjZS10b29scyUyRmRpZmZ1c2lvbi10b29scy02NjMwYmIxOWE5NDJjMjMwNmEyY2RiNmYlMjIpJTBBYWdlbnQlMjAlM0QlMjBSZWFjdENvZGVBZ2VudCh0b29scyUzRCU1QippbWFnZV90b29sX2NvbGxlY3Rpb24udG9vbHMlNUQlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUyMlBsZWFzZSUyMGRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcy4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ToolCollection, ReactCodeAgent

<span class="hljs-meta">&gt;&gt;&gt; </span>image_tool_collection = ToolCollection(collection_slug=<span class="hljs-string">&quot;huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent = ReactCodeAgent(tools=[*image_tool_collection.tools], add_base_tools=<span class="hljs-literal">True</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>agent.run(<span class="hljs-string">&quot;Please draw me a picture of rivers and lakes.&quot;</span>)`,wrap:!1}}),{c(){f=r("p"),f.textContent=x,y=n(),d(w.$$.fragment)},l(b){f=s(b,"P",{"data-svelte-h":!0}),u(f)!=="svelte-11lpom8"&&(f.textContent=x),y=o(b),m(w.$$.fragment,b)},m(b,C){i(b,f,C),i(b,y,C),c(w,b,C),T=!0},p:ln,i(b){T||(h(w.$$.fragment,b),T=!0)},o(b){g(w.$$.fragment,b),T=!1},d(b){b&&(a(f),a(y)),p(w,b)}}}function Al(j){let f,x,y,w,T,b,C,po,Je,is=`To learn more about agents and tools make sure to read the <a href="../transformers_agents">introductory guide</a>. This page
contains the API docs for the underlying classes.`,uo,Ee,fo,He,ds='We provide two types of agents, based on the main <a href="/docs/transformers/main/en/main_classes/agent#transformers.Agent">Agent</a> class:',bo,De,ms='<li><a href="/docs/transformers/main/en/main_classes/agent#transformers.CodeAgent">CodeAgent</a> acts in one shot, generating code to solve the task, then executes it at once.</li> <li><a href="/docs/transformers/main/en/main_classes/agent#transformers.ReactAgent">ReactAgent</a> acts step by step, each step consisting of one thought, then one tool call and execution. It has two classes:<ul><li><a href="/docs/transformers/main/en/main_classes/agent#transformers.ReactJsonAgent">ReactJsonAgent</a> writes its tool calls in JSON.</li> <li><a href="/docs/transformers/main/en/main_classes/agent#transformers.ReactCodeAgent">ReactCodeAgent</a> writes its tool calls in Python code.</li></ul></li>',vo,Ue,_o,q,We,Ma,K,Be,La,dn,cs=`Execute tool with the provided input and returns the result.
This method replaces arguments with the actual values from the state if they refer to state variables.`,ja,ee,Se,qa,mn,hs="Parse action from the LLM output",Pa,te,Re,Na,cn,gs="To be implemented in the child class",Ja,ne,Oe,Ea,hn,ps=`Reads past llm_outputs, actions, and observations or errors from the logs into a series of messages
that can be used as input to the LLM.`,$o,Ve,yo,E,ze,Ha,gn,us="A class for an agent that solves the given task using a single block of code. It plans all its actions, then executes all in one shot.",Da,oe,Ze,Ua,pn,fs=`Override this method if you want to change the way the code is
cleaned in the <code>run</code> method.`,Wa,Z,Ge,Ba,un,bs="Runs the agent for the given task.",Sa,ae,wo,Ye,To,H,Fe,Ra,fn,vs=`This agent that solves the given task step by step, using the ReAct framework:
While the objective is not reached, the agent will perform a cycle of thinking and acting.
The action will be parsed from the LLM output: it consists in calls to tools from the toolbox, with arguments chosen by the LLM engine.`,Oa,re,Qe,Va,bn,_s="This method provides a final answer to the task, based on the logs of the agent’s interactions.",za,G,Xe,Za,vn,$s="Runs the agent for the given task.",Ga,se,xo,R,Ke,Ya,_n,ys=`This agent that solves the given task step by step, using the ReAct framework:
While the objective is not reached, the agent will perform a cycle of thinking and acting.
The tool calls will be formulated by the LLM in JSON format, then parsed and executed.`,Fa,le,et,Qa,$n,ws=`Perform one step in the ReAct framework: the agent thinks, acts, and observes the result.
The errors are raised here, they are caught and logged in the run() method.`,ko,O,tt,Xa,yn,Ts=`This agent that solves the given task step by step, using the ReAct framework:
While the objective is not reached, the agent will perform a cycle of thinking and acting.
The tool calls will be formulated by the LLM in code format, then parsed and executed.`,Ka,ie,nt,er,wn,xs=`Perform one step in the ReAct framework: the agent thinks, acts, and observes the result.
The errors are raised here, they are caught and logged in the run() method.`,Co,ot,Io,at,Ao,V,rt,tr,Tn,ks="Main function to quickly load a tool, be it on the Hub or in the Transformers library.",nr,de,Mo,st,Lo,k,lt,or,xn,Cs=`A base class for the functions used by the agent. Subclass this and implement the <code>__call__</code> method as well as the
following class attributes:`,ar,kn,Is=`<li><strong>description</strong> (<code>str</code>) — A short description of what your tool does, the inputs it expects and the output(s) it
will return. For instance ‘This is a tool that downloads a file from a <code>url</code>. It takes the <code>url</code> as input, and
returns the text contained in the file’.</li> <li><strong>name</strong> (<code>str</code>) — A performative name that will be used for your tool in the prompt to the agent. For instance
<code>&quot;text-classifier&quot;</code> or <code>&quot;image_generator&quot;</code>.</li> <li><strong>inputs</strong> (<code>Dict[str, Dict[str, Union[str, type]]]</code>) — The dict of modalities expected for the inputs.
It has one <code>type</code>key and a <code>description</code>key.
This is used by <code>launch_gradio_demo</code> or to make a nice space from your tool, and also can be used in the generated
description for your tool.</li> <li><strong>output_type</strong> (<code>type</code>) — The type of the tool output. This is used by <code>launch_gradio_demo</code>
or to make a nice space from your tool, and also can be used in the generated description for your tool.</li>`,rr,Cn,As=`You can also override the method <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool.setup">setup()</a> if your tool as an expensive operation to perform before being
usable (such as loading a model). <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool.setup">setup()</a> will be called the first time you use your tool, but not at
instantiation.`,sr,me,it,lr,In,Ms='Creates a <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a> from a gradio tool.',ir,Y,dt,dr,An,Ls="Loads a tool defined on the Hub.",mr,ce,cr,he,mt,hr,Mn,js='Creates a <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a> from a langchain tool.',gr,B,ct,pr,Ln,qs="Upload the tool to the Hub.",ur,jn,Ps="For this method to work properly, your tool must have been defined in a separate module (not <code>__main__</code>).",fr,ge,br,S,ht,vr,qn,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 <code>output_dir</code> as well as autogenerate:`,_r,Pn,Js=`<li>a config file named <code>tool_config.json</code></li> <li>an <code>app.py</code> file so that your tool can be converted to a space</li> <li>a <code>requirements.txt</code> containing the names of the module used by your tool (as detected when inspecting its
code)</li>`,$r,Nn,Es="You should only use this method to save tools that are defined in a separate module (not <code>__main__</code>).",yr,pe,gt,wr,Jn,Hs=`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.`,jo,pt,qo,A,ut,Tr,En,Ds=`The toolbox contains all tools that the agent can perform operations with, as well as a few methods to
manage them.`,xr,ue,ft,kr,Hn,Us="Adds a tool to the toolbox",Cr,fe,bt,Ir,Dn,Ws="Clears the toolbox",Ar,be,vt,Mr,Un,Bs="Removes a tool from the toolbox",Lr,ve,_t,jr,Wn,Ss="Returns the description of all tools in the toolbox",qr,_e,$t,Pr,Bn,Rs="Updates a tool in the toolbox according to its name.",Po,yt,No,M,wt,Nr,Sn,Os=`A <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a> tailored towards Transformer models. On top of the class attributes of the base class <a href="/docs/transformers/main/en/main_classes/agent#transformers.Tool">Tool</a>, you will
need to specify:`,Jr,Rn,Vs=`<li><strong>model_class</strong> (<code>type</code>) — The class to use to load the model in this tool.</li> <li><strong>default_checkpoint</strong> (<code>str</code>) — The default checkpoint that should be used when the user doesn’t specify one.</li> <li><strong>pre_processor_class</strong> (<code>type</code>, <em>optional</em>, defaults to <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>) — The class to use to load the
pre-processor</li> <li><strong>post_processor_class</strong> (<code>type</code>, <em>optional</em>, defaults to <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoProcessor">AutoProcessor</a>) — The class to use to load the
post-processor (when different from the pre-processor).</li>`,Er,$e,Tt,Hr,On,zs="Uses the <code>post_processor</code> to decode the model output.",Dr,ye,xt,Ur,Vn,Zs="Uses the <code>pre_processor</code> to prepare the inputs for the <code>model</code>.",Wr,we,kt,Br,zn,Gs="Sends the inputs through the <code>model</code>.",Sr,Te,Ct,Rr,Zn,Ys="Instantiates the <code>pre_processor</code>, <code>model</code> and <code>post_processor</code> if necessary.",Jo,It,Eo,Q,At,Or,Gn,Fs=`Launches a gradio demo for a tool. The corresponding tool class needs to properly implement the class attributes
<code>inputs</code> and <code>output_type</code>.`,Ho,Mt,Do,D,Lt,Vr,Yn,Qs="Tool collections enable loading all Spaces from a collection in order to be added to the agent’s toolbox.",zr,Fn,Xs=`<p>[!NOTE]
Only Spaces will be fetched, so you can feel free to add models and datasets to your collection if you’d
like for this collection to showcase them.</p>`,Zr,xe,Uo,jt,Wo,qt,Ks=`You’re free to create and use your own engines to be usable by the Agents framework.
These engines have the following specification:`,Bo,Pt,el='<li>Follow the <a href="../chat_templating.md">messages format</a> for its input (<code>List[Dict[str, str]]</code>) and return a string.</li> <li>Stop generating outputs <em>before</em> the sequences passed in the argument <code>stop_sequences</code></li>',So,Nt,Ro,Jt,tl="For convenience, we have added a <code>HfEngine</code> that implements the points above and uses an inference endpoint for the execution of the LLM.",Oo,Et,Vo,Ht,Dt,zo,Ut,Zo,Wt,nl=`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, …), we implement wrapper classes
around these types.`,Go,Bt,ol=`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 <code>PIL.Image</code>.`,Yo,St,al="These types have three specific purposes:",Fo,Rt,rl=`<li>Calling <code>to_raw</code> on the type should return the underlying object</li> <li>Calling <code>to_string</code> on the type should return the object as a string: that can be the string in case of an <code>AgentText</code>
but will be the path of the serialized version of the object in other instances</li> <li>Displaying it in an ipython kernel should display the object correctly</li>`,Qo,Ot,Xo,X,Vt,Gr,Qn,sl="Text type returned by the agent. Behaves as a string.",Ko,zt,ea,P,Zt,Yr,Xn,ll="Image type returned by the agent. Behaves as a PIL.Image.",Fr,ke,Gt,Qr,Kn,il="Saves the image to a file.",Xr,Ce,Yt,Kr,eo,dl="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.",es,Ie,Ft,ts,to,ml=`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`,ta,Qt,na,U,Xt,ns,no,cl="Audio type returned by the agent.",os,Ae,Kt,as,oo,hl="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",rs,Me,en,ss,ao,gl=`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`,oa,tn,aa,ho,ra;return T=new L({props:{title:"Agents & Tools",local:"agents--tools",headingTag:"h1"}}),C=new ls({props:{warning:!0,$$slots:{default:[yl]},$$scope:{ctx:j}}}),Ee=new L({props:{title:"Agents",local:"agents",headingTag:"h2"}}),Ue=new L({props:{title:"Agent",local:"transformers.Agent",headingTag:"h3"}}),We=new $({props:{name:"class transformers.Agent",anchor:"transformers.Agent",parameters:[{name:"tools",val:": Union"},{name:"llm_engine",val:": Callable = <transformers.agents.llm_engine.HfEngine object at 0x7fe715f540d0>"},{name:"system_prompt",val:` = 'You are an expert assistant who can solve any task using JSON tool calls. You will be given a task to solve as best you can.\\nTo do so, you have been given access to the following tools: <<tool_names>>\\nThe way you use the tools is by specifying a json blob, ending with \\'<end_action>\\'.\\nSpecifically, this json should have an \`action\` key (name of the tool to use) and an \`action_input\` key (input to the tool).\\n\\nThe $ACTION_JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. It should be formatted in json. Do not try to escape special characters. Here is the template of a valid $ACTION_JSON_BLOB:\\n{\\n  "action": $TOOL_NAME,\\n  "action_input": $INPUT\\n}<end_action>\\n\\nMake sure to have the $INPUT as a dictionary in the right format for the tool you are using, and do not put variable names as input if you can find the right values.\\n\\nYou should ALWAYS use the following format:\\n\\nThought: you should always think about one action to take. Then use the action as follows:\\nAction:\\n$ACTION_JSON_BLOB\\nObservation: the result of the action\\n... (this Thought/Action/Observation can repeat N times, you should take several steps when needed. The $ACTION_JSON_BLOB must only use a SINGLE action at a time.)\\n\\nYou can use the result of the previous action as input for the next action.\\nThe observation will always be a string: it can represent a file, like "image_1.jpg".\\nThen you can use it as input for the next action. You can do it for instance as follows:\\n\\nObservation: "image_1.jpg"\\n\\nThought: I need to transform the image that I received in the previous observation to make it green.\\nAction:\\n{\\n  "action": "image_transformer",\\n  "action_input": {"image": "image_1.jpg"}\\n}<end_action>\\n\\nTo provide the final answer to the task, use an action blob with "action": "final_answer" tool. It is the only way to complete the task, else you will be stuck on a loop. So your final output should look like this:\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": {"answer": "insert your final answer here"}\\n}<end_action>\\n\\n\\nHere are a few examples using notional tools:\\n---\\nTask: "Generate an image of the oldest person in this document."\\n\\nThought: I will proceed step by step and use the following tools: \`document_qa\` to find the oldest person in the document, then \`image_generator\` to generate an image according to the answer.\\nAction:\\n{\\n  "action": "document_qa",\\n  "action_input": {"document": "document.pdf", "question": "Who is the oldest person mentioned?"}\\n}<end_action>\\nObservation: "The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland."\\n\\n\\nThought: I will now generate an image showcasing the oldest person.\\nAction:\\n{\\n  "action": "image_generator",\\n  "action_input": {"text": ""A portrait of John Doe, a 55-year-old man living in Canada.""}\\n}<end_action>\\nObservation: "image.png"\\n\\nThought: I will now return the generated image.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "image.png"\\n}<end_action>\\n\\n---\\nTask: "What is the result of the following operation: 5 + 3 + 1294.678?"\\n\\nThought: I will use python code evaluator to compute the result of the operation and then return the final answer using the \`final_answer\` tool\\nAction:\\n{\\n    "action": "python_interpreter",\\n    "action_input": {"code": "5 + 3 + 1294.678"}\\n}<end_action>\\nObservation: 1302.678\\n\\nThought: Now that I know the result, I will now return it.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "1302.678"\\n}<end_action>\\n\\n---\\nTask: "Which city has the highest population , Guangzhou or Shanghai?"\\n\\nThought: I need to get the populations for both cities and compare them: I will use the tool \`search\` to get the population of both cities.\\nAction:\\n{\\n    "action": "search",\\n    "action_input": "Population Guangzhou"\\n}<end_action>\\nObservation: [\\'Guangzhou has a population of 15 million inhabitants as of 2021.\\']\\n\\n\\nThought: Now let\\'s get the population of Shanghai using the tool \\'search\\'.\\nAction:\\n{\\n    "action": "search",\\n    "action_input": "Population Shanghai"\\n}\\nObservation: \\'26 million (2019)\\'\\n\\nThought: Now I know that Shanghai has a larger population. Let\\'s return the result.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "Shanghai"\\n}<end_action>\\n\\n\\nAbove example were using notional tools that might not exist for you. You only have acces to those tools:\\n<<tool_descriptions>>\\n\\nHere are the rules you should always follow to solve your task:\\n1. ALWAYS provide a \\'Thought:\\' sequence, and an \\'Action:\\' sequence that ends with <end_action>, else you will fail.\\n2. Always use the right arguments for the tools. Never use variable names in the \\'action_input\\' field, use the value instead.\\n3. Call a tool only when needed: do not call the search agent if you do not need information, try to solve the task yourself.\\n4. Never re-do a tool call that you previously did with the exact same parameters.\\n\\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\\n'`},{name:"tool_description_template",val:" = None"},{name:"additional_args",val:" = {}"},{name:"max_iterations",val:": int = 6"},{name:"tool_parser",val:" = <function parse_json_tool_call at 0x7fe715f439a0>"},{name:"add_base_tools",val:": bool = False"},{name:"verbose",val:": int = 0"},{name:"memory_verbose",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L306"}}),Be=new $({props:{name:"execute_tool_call",anchor:"transformers.Agent.execute_tool_call",parameters:[{name:"tool_name",val:": str"},{name:"arguments",val:": Dict"}],parametersDescription:[{anchor:"transformers.Agent.execute_tool_call.tool_name",description:"<strong>tool_name</strong> (<code>str</code>) &#x2014; Name of the Tool to execute (shoulde be one from self.toolbox).",name:"tool_name"},{anchor:"transformers.Agent.execute_tool_call.arguments",description:"<strong>arguments</strong> (Dict[str, str]) &#x2014; Arguments passed to the Tool.",name:"arguments"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L456"}}),Se=new $({props:{name:"extract_action",anchor:"transformers.Agent.extract_action",parameters:[{name:"llm_output",val:": str"},{name:"split_token",val:": str"}],parametersDescription:[{anchor:"transformers.Agent.extract_action.llm_output",description:"<strong>llm_output</strong> (<code>str</code>) &#x2014; Output of the LLM",name:"llm_output"},{anchor:"transformers.Agent.extract_action.split_token",description:"<strong>split_token</strong> (<code>str</code>) &#x2014; Separator for the action. Should match the example in the system prompt.",name:"split_token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L435"}}),Re=new $({props:{name:"run",anchor:"transformers.Agent.run",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L496"}}),Oe=new $({props:{name:"write_inner_memory_from_logs",anchor:"transformers.Agent.write_inner_memory_from_logs",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L383"}}),Ve=new L({props:{title:"CodeAgent",local:"transformers.CodeAgent",headingTag:"h3"}}),ze=new $({props:{name:"class transformers.CodeAgent",anchor:"transformers.CodeAgent",parameters:[{name:"tools",val:": List"},{name:"llm_engine",val:": Callable = <transformers.agents.llm_engine.HfEngine object at 0x7fe715f54310>"},{name:"system_prompt",val:': str = \'You will be given a task to solve, your job is to come up with a series of simple commands in Python that will perform the task.\\nTo help you, I will give you access to a set of tools that you can use. Each tool is a Python function and has a description explaining the task it performs, the inputs it expects and the outputs it returns.\\nYou should first explain which tool you will use to perform the task and for what reason, then write the code in Python.\\nEach instruction in Python should be a simple assignment. You can print intermediate results if it makes sense to do so.\\nIn the end, use tool \\\'final_answer\\\' to return your answer, its argument will be what gets returned.\\nYou can use imports in your code, but only from the following list of modules: <<authorized_imports>>\\nBe sure to provide a \\\'Code:\\\' token, else the run will fail.\\n\\nTools:\\n<<tool_descriptions>>\\n\\nExamples:\\n---\\nTask: "Answer the question in the variable `question` about the image stored in the variable `image`. The question is in French."\\n\\nI will use the following tools: `translator` to translate the question into English and then `image_qa` to answer the question on the input image.\\nCode:\\n```py\\ntranslated_question = translator(question=question, src_lang="French", tgt_lang="English")\\nprint(f"The translated question is {translated_question}.")\\nanswer = image_qa(image=image, question=translated_question)\\nfinal_answer(f"The answer is {answer}")\\n```<end_action>\\n\\n---\\nTask: "Identify the oldest person in the `document` and create an image showcasing the result."\\n\\nI will use the following tools: `document_qa` to find the oldest person in the document, then `image_generator` to generate an image according to the answer.\\nCode:\\n```py\\nanswer = document_qa(document, question="What is the oldest person?")\\nprint(f"The answer is {answer}.")\\nimage = image_generator(answer)\\nfinal_answer(image)\\n```<end_action>\\n\\n---\\nTask: "Generate an image using the text given in the variable `caption`."\\n\\nI will use the following tool: `image_generator` to generate an image.\\nCode:\\n```py\\nimage = image_generator(prompt=caption)\\nfinal_answer(image)\\n```<end_action>\\n\\n---\\nTask: "Summarize the text given in the variable `text` and read it out loud."\\n\\nI will use the following tools: `summarizer` to create a summary of the input text, then `text_reader` to read it out loud.\\nCode:\\n```py\\nsummarized_text = summarizer(text)\\nprint(f"Summary: {summarized_text}")\\naudio_summary = text_reader(summarized_text)\\nfinal_answer(audio_summary)\\n```<end_action>\\n\\n---\\nTask: "Answer the question in the variable `question` about the text in the variable `text`. Use the answer to generate an image."\\n\\nI will use the following tools: `text_qa` to create the answer, then `image_generator` to generate an image according to the answer.\\nCode:\\n```py\\nanswer = text_qa(text=text, question=question)\\nprint(f"The answer is {answer}.")\\nimage = image_generator(answer)\\nfinal_answer(image)\\n```<end_action>\\n\\n---\\nTask: "Caption the following `image`."\\n\\nI will use the following tool: `image_captioner` to generate a caption for the image.\\nCode:\\n```py\\ncaption = image_captioner(image)\\nfinal_answer(caption)\\n```<end_action>\\n\\n---\\nAbove example were using tools that might not exist for you. You only have acces to those Tools:\\n<<tool_names>>\\n\\nRemember to make sure that variables you use are all defined.\\nBe sure to provide a \\\'Code:\\n```\\\' sequence before the code and \\\'```<end_action>\\\' after, else you will get an error.\\nDO NOT pass the arguments as a dict as in \\\'answer = ask_search_agent({\\\'query\\\': "What is the place where James Bond lives?"})\\\', but use the arguments directly as in \\\'answer = ask_search_agent(query="What is the place where James Bond lives?")\\\'.\\n\\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\\n\''},{name:"tool_description_template",val:": str = '\\n- {{ tool.name }}: {{ tool.description }}\\n    Takes inputs: {{tool.inputs}}\\n'"},{name:"additional_authorized_imports",val:": Optional = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L501"}}),Ze=new $({props:{name:"parse_code_blob",anchor:"transformers.CodeAgent.parse_code_blob",parameters:[{name:"result",val:": str"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L535"}}),Ge=new $({props:{name:"run",anchor:"transformers.CodeAgent.run",parameters:[{name:"task",val:": str"},{name:"return_generated_code",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.CodeAgent.run.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; The task to perform",name:"task"},{anchor:"transformers.CodeAgent.run.return_generated_code",description:"<strong>return_generated_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to return the generated code instead of running it",name:"return_generated_code"},{anchor:"transformers.CodeAgent.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/agents/agents.py#L542"}}),ae=new Aa({props:{anchor:"transformers.CodeAgent.run.example",$$slots:{default:[wl]},$$scope:{ctx:j}}}),Ye=new L({props:{title:"React agents",local:"transformers.ReactAgent",headingTag:"h3"}}),Fe=new $({props:{name:"class transformers.ReactAgent",anchor:"transformers.ReactAgent",parameters:[{name:"tools",val:": List"},{name:"llm_engine",val:": Callable = <transformers.agents.llm_engine.HfEngine object at 0x7fe715f544f0>"},{name:"system_prompt",val:": str = 'You are an expert assistant who can solve any task using code blobs. You will be given a task to solve as best you can.\\nTo do so, you have been given access to a list of tools: these tools are basically Python functions which you can call with code.\\nTo solve the task, you must plan forward to proceed in a series of steps, in a cycle of \\'Thought:\\', \\'Code:\\', and \\'Observation:\\' sequences.\\n\\nAt each step, in the \\'Thought:\\' sequence, you should first explain your reasoning towards solving the task and the tools that you want to use.\\nThen in the \\'Code:\\' sequence, you should write the code in simple Python. The code sequence must end with \\'<end_action>\\' sequence.\\nDuring each intermediate step, you can use \\'print()\\' to save whatever important information you will then need.\\nThese print outputs will then appear in the \\'Observation:\\' field, which will be available as input for the next step.\\nIn the end you have to return a final answer using the `final_answer` tool.\\n\\nHere are a few examples using notional tools:\\n---\\nTask: \"Generate an image of the oldest person in this document.\"\\n\\nThought: I will proceed step by step and use the following tools: `document_qa` to find the oldest person in the document, then `image_generator` to generate an image according to the answer.\\nCode:\\n```py\\nanswer = document_qa(document=document, question=\"Who is the oldest person mentioned?\")\\nprint(answer)\\n```<end_action>\\nObservation: \"The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland.\"\\n\\nThought: I will now generate an image showcasing the oldest person.\\n\\nCode:\\n```py\\nimage = image_generator(\"A portrait of John Doe, a 55-year-old man living in Canada.\")\\nfinal_answer(image)\\n```<end_action>\\n\\n---\\nTask: \"What is the result of the following operation: 5 + 3 + 1294.678?\"\\n\\nThought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool\\n\\nCode:\\n```py\\nresult = 5 + 3 + 1294.678\\nfinal_answer(result)\\n```<end_action>\\n\\n---\\nTask: \"Which city has the highest population: Guangzhou or Shanghai?\"\\n\\nThought: I need to get the populations for both cities and compare them: I will use the tool `search` to get the population of both cities.\\nCode:\\n```py\\npopulation_guangzhou = search(\"Guangzhou population\")\\nprint(\"Population Guangzhou:\", population_guangzhou)\\npopulation_shanghai = search(\"Shanghai population\")\\nprint(\"Population Shanghai:\", population_shanghai)\\n```<end_action>\\nObservation:\\nPopulation Guangzhou: [\\'Guangzhou has a population of 15 million inhabitants as of 2021.\\']\\nPopulation Shanghai: \\'26 million (2019)\\'\\n\\nThought: Now I know that Shanghai has the highest population.\\nCode:\\n```py\\nfinal_answer(\"Shanghai\")\\n```<end_action>\\n\\n---\\nTask: \"What is the current age of the pope, raised to the power 0.36?\"\\n\\nThought: I will use the tool `search` to get the age of the pope, then raise it to the power 0.36.\\nCode:\\n```py\\npope_age = search(query=\"current pope age\")\\nprint(\"Pope age:\", pope_age)\\n```<end_action>\\nObservation:\\nPope age: \"The pope Francis is currently 85 years old.\"\\n\\nThought: I know that the pope is 85 years old. Let\\'s compute the result using python code.\\nCode:\\n```py\\npope_current_age = 85 ** 0.36\\nfinal_answer(pope_current_age)\\n```<end_action>\\n\\nAbove example were using notional tools that might not exist for you. You only have acces to those tools:\\n\\n<<tool_descriptions>>\\n\\nYou also can perform computations in the Python code that you generate.\\n\\nHere are the rules you should always follow to solve your task:\\n1. Always provide a \\'Thought:\\' sequence, and a \\'Code:\\n```py\\' sequence ending with \\'```<end_action>\\' sequence, else you will fail.\\n2. Use only variables that you have defined!\\n3. Always use the right arguments for the tools. DO NOT pass the arguments as a dict as in \\'answer = ask_search_agent({\\'query\\': \"What is the place where James Bond lives?\"})\\', but use the arguments directly as in \\'answer = ask_search_agent(query=\"What is the place where James Bond lives?\")\\'.\\n4. Take care to not chain too many sequential tool calls in the same code block, especially when the output format is unpredictable. For instance, a call to search has an unpredictable return format, so do not have another tool call that depends on its output in the same block: rather output results with print() to use them in the next block.\\n5. Call a tool only when needed, and never re-do a tool call that you previously did with the exact same parameters.\\n6. Don\\'t name any new variable with the same name as a tool: for instance don\\'t name a variable \\'final_answer\\'.\\n7. Never create any notional variables in our code, as having these in your logs might derail you from the true variables.\\n8. You can use imports in your code, but only from the following list of modules: <<authorized_imports>>\\n9. Don\\'t give up! You\\'re in charge of solving the task, not providing directions to solve it.\\n\\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\\n'"},{name:"tool_description_template",val:": str = '\\n- {{ tool.name }}: {{ tool.description }}\\n    Takes inputs: {{tool.inputs}}\\n'"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L613"}}),Qe=new $({props:{name:"provide_final_answer",anchor:"transformers.ReactAgent.provide_final_answer",parameters:[{name:"task",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L636"}}),Xe=new $({props:{name:"run",anchor:"transformers.ReactAgent.run",parameters:[{name:"task",val:": str"},{name:"stream",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ReactAgent.run.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; The task to perform",name:"task"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L658"}}),se=new Aa({props:{anchor:"transformers.ReactAgent.run.example",$$slots:{default:[Tl]},$$scope:{ctx:j}}}),Ke=new $({props:{name:"class transformers.ReactJsonAgent",anchor:"transformers.ReactJsonAgent",parameters:[{name:"tools",val:": List"},{name:"llm_engine",val:": Callable = <transformers.agents.llm_engine.HfEngine object at 0x7fe715f546a0>"},{name:"system_prompt",val:`: str = 'You are an expert assistant who can solve any task using JSON tool calls. You will be given a task to solve as best you can.\\nTo do so, you have been given access to the following tools: <<tool_names>>\\nThe way you use the tools is by specifying a json blob, ending with \\'<end_action>\\'.\\nSpecifically, this json should have an \`action\` key (name of the tool to use) and an \`action_input\` key (input to the tool).\\n\\nThe $ACTION_JSON_BLOB should only contain a SINGLE action, do NOT return a list of multiple actions. It should be formatted in json. Do not try to escape special characters. Here is the template of a valid $ACTION_JSON_BLOB:\\n{\\n  "action": $TOOL_NAME,\\n  "action_input": $INPUT\\n}<end_action>\\n\\nMake sure to have the $INPUT as a dictionary in the right format for the tool you are using, and do not put variable names as input if you can find the right values.\\n\\nYou should ALWAYS use the following format:\\n\\nThought: you should always think about one action to take. Then use the action as follows:\\nAction:\\n$ACTION_JSON_BLOB\\nObservation: the result of the action\\n... (this Thought/Action/Observation can repeat N times, you should take several steps when needed. The $ACTION_JSON_BLOB must only use a SINGLE action at a time.)\\n\\nYou can use the result of the previous action as input for the next action.\\nThe observation will always be a string: it can represent a file, like "image_1.jpg".\\nThen you can use it as input for the next action. You can do it for instance as follows:\\n\\nObservation: "image_1.jpg"\\n\\nThought: I need to transform the image that I received in the previous observation to make it green.\\nAction:\\n{\\n  "action": "image_transformer",\\n  "action_input": {"image": "image_1.jpg"}\\n}<end_action>\\n\\nTo provide the final answer to the task, use an action blob with "action": "final_answer" tool. It is the only way to complete the task, else you will be stuck on a loop. So your final output should look like this:\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": {"answer": "insert your final answer here"}\\n}<end_action>\\n\\n\\nHere are a few examples using notional tools:\\n---\\nTask: "Generate an image of the oldest person in this document."\\n\\nThought: I will proceed step by step and use the following tools: \`document_qa\` to find the oldest person in the document, then \`image_generator\` to generate an image according to the answer.\\nAction:\\n{\\n  "action": "document_qa",\\n  "action_input": {"document": "document.pdf", "question": "Who is the oldest person mentioned?"}\\n}<end_action>\\nObservation: "The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland."\\n\\n\\nThought: I will now generate an image showcasing the oldest person.\\nAction:\\n{\\n  "action": "image_generator",\\n  "action_input": {"text": ""A portrait of John Doe, a 55-year-old man living in Canada.""}\\n}<end_action>\\nObservation: "image.png"\\n\\nThought: I will now return the generated image.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "image.png"\\n}<end_action>\\n\\n---\\nTask: "What is the result of the following operation: 5 + 3 + 1294.678?"\\n\\nThought: I will use python code evaluator to compute the result of the operation and then return the final answer using the \`final_answer\` tool\\nAction:\\n{\\n    "action": "python_interpreter",\\n    "action_input": {"code": "5 + 3 + 1294.678"}\\n}<end_action>\\nObservation: 1302.678\\n\\nThought: Now that I know the result, I will now return it.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "1302.678"\\n}<end_action>\\n\\n---\\nTask: "Which city has the highest population , Guangzhou or Shanghai?"\\n\\nThought: I need to get the populations for both cities and compare them: I will use the tool \`search\` to get the population of both cities.\\nAction:\\n{\\n    "action": "search",\\n    "action_input": "Population Guangzhou"\\n}<end_action>\\nObservation: [\\'Guangzhou has a population of 15 million inhabitants as of 2021.\\']\\n\\n\\nThought: Now let\\'s get the population of Shanghai using the tool \\'search\\'.\\nAction:\\n{\\n    "action": "search",\\n    "action_input": "Population Shanghai"\\n}\\nObservation: \\'26 million (2019)\\'\\n\\nThought: Now I know that Shanghai has a larger population. Let\\'s return the result.\\nAction:\\n{\\n  "action": "final_answer",\\n  "action_input": "Shanghai"\\n}<end_action>\\n\\n\\nAbove example were using notional tools that might not exist for you. You only have acces to those tools:\\n<<tool_descriptions>>\\n\\nHere are the rules you should always follow to solve your task:\\n1. ALWAYS provide a \\'Thought:\\' sequence, and an \\'Action:\\' sequence that ends with <end_action>, else you will fail.\\n2. Always use the right arguments for the tools. Never use variable names in the \\'action_input\\' field, use the value instead.\\n3. Call a tool only when needed: do not call the search agent if you do not need information, try to solve the task yourself.\\n4. Never re-do a tool call that you previously did with the exact same parameters.\\n\\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\\n'`},{name:"tool_description_template",val:": str = '\\n- {{ tool.name }}: {{ tool.description }}\\n    Takes inputs: {{tool.inputs}}\\n'"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L730"}}),et=new $({props:{name:"step",anchor:"transformers.ReactJsonAgent.step",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L753"}}),tt=new $({props:{name:"class transformers.ReactCodeAgent",anchor:"transformers.ReactCodeAgent",parameters:[{name:"tools",val:": List"},{name:"llm_engine",val:": Callable = <transformers.agents.llm_engine.HfEngine object at 0x7fe715f54850>"},{name:"system_prompt",val:": str = 'You are an expert assistant who can solve any task using code blobs. You will be given a task to solve as best you can.\\nTo do so, you have been given access to a list of tools: these tools are basically Python functions which you can call with code.\\nTo solve the task, you must plan forward to proceed in a series of steps, in a cycle of \\'Thought:\\', \\'Code:\\', and \\'Observation:\\' sequences.\\n\\nAt each step, in the \\'Thought:\\' sequence, you should first explain your reasoning towards solving the task and the tools that you want to use.\\nThen in the \\'Code:\\' sequence, you should write the code in simple Python. The code sequence must end with \\'<end_action>\\' sequence.\\nDuring each intermediate step, you can use \\'print()\\' to save whatever important information you will then need.\\nThese print outputs will then appear in the \\'Observation:\\' field, which will be available as input for the next step.\\nIn the end you have to return a final answer using the `final_answer` tool.\\n\\nHere are a few examples using notional tools:\\n---\\nTask: \"Generate an image of the oldest person in this document.\"\\n\\nThought: I will proceed step by step and use the following tools: `document_qa` to find the oldest person in the document, then `image_generator` to generate an image according to the answer.\\nCode:\\n```py\\nanswer = document_qa(document=document, question=\"Who is the oldest person mentioned?\")\\nprint(answer)\\n```<end_action>\\nObservation: \"The oldest person in the document is John Doe, a 55 year old lumberjack living in Newfoundland.\"\\n\\nThought: I will now generate an image showcasing the oldest person.\\n\\nCode:\\n```py\\nimage = image_generator(\"A portrait of John Doe, a 55-year-old man living in Canada.\")\\nfinal_answer(image)\\n```<end_action>\\n\\n---\\nTask: \"What is the result of the following operation: 5 + 3 + 1294.678?\"\\n\\nThought: I will use python code to compute the result of the operation and then return the final answer using the `final_answer` tool\\n\\nCode:\\n```py\\nresult = 5 + 3 + 1294.678\\nfinal_answer(result)\\n```<end_action>\\n\\n---\\nTask: \"Which city has the highest population: Guangzhou or Shanghai?\"\\n\\nThought: I need to get the populations for both cities and compare them: I will use the tool `search` to get the population of both cities.\\nCode:\\n```py\\npopulation_guangzhou = search(\"Guangzhou population\")\\nprint(\"Population Guangzhou:\", population_guangzhou)\\npopulation_shanghai = search(\"Shanghai population\")\\nprint(\"Population Shanghai:\", population_shanghai)\\n```<end_action>\\nObservation:\\nPopulation Guangzhou: [\\'Guangzhou has a population of 15 million inhabitants as of 2021.\\']\\nPopulation Shanghai: \\'26 million (2019)\\'\\n\\nThought: Now I know that Shanghai has the highest population.\\nCode:\\n```py\\nfinal_answer(\"Shanghai\")\\n```<end_action>\\n\\n---\\nTask: \"What is the current age of the pope, raised to the power 0.36?\"\\n\\nThought: I will use the tool `search` to get the age of the pope, then raise it to the power 0.36.\\nCode:\\n```py\\npope_age = search(query=\"current pope age\")\\nprint(\"Pope age:\", pope_age)\\n```<end_action>\\nObservation:\\nPope age: \"The pope Francis is currently 85 years old.\"\\n\\nThought: I know that the pope is 85 years old. Let\\'s compute the result using python code.\\nCode:\\n```py\\npope_current_age = 85 ** 0.36\\nfinal_answer(pope_current_age)\\n```<end_action>\\n\\nAbove example were using notional tools that might not exist for you. You only have acces to those tools:\\n\\n<<tool_descriptions>>\\n\\nYou also can perform computations in the Python code that you generate.\\n\\nHere are the rules you should always follow to solve your task:\\n1. Always provide a \\'Thought:\\' sequence, and a \\'Code:\\n```py\\' sequence ending with \\'```<end_action>\\' sequence, else you will fail.\\n2. Use only variables that you have defined!\\n3. Always use the right arguments for the tools. DO NOT pass the arguments as a dict as in \\'answer = ask_search_agent({\\'query\\': \"What is the place where James Bond lives?\"})\\', but use the arguments directly as in \\'answer = ask_search_agent(query=\"What is the place where James Bond lives?\")\\'.\\n4. Take care to not chain too many sequential tool calls in the same code block, especially when the output format is unpredictable. For instance, a call to search has an unpredictable return format, so do not have another tool call that depends on its output in the same block: rather output results with print() to use them in the next block.\\n5. Call a tool only when needed, and never re-do a tool call that you previously did with the exact same parameters.\\n6. Don\\'t name any new variable with the same name as a tool: for instance don\\'t name a variable \\'final_answer\\'.\\n7. Never create any notional variables in our code, as having these in your logs might derail you from the true variables.\\n8. You can use imports in your code, but only from the following list of modules: <<authorized_imports>>\\n9. Don\\'t give up! You\\'re in charge of solving the task, not providing directions to solve it.\\n\\nNow Begin! If you solve the task correctly, you will receive a reward of $1,000,000.\\n'"},{name:"tool_description_template",val:": str = '\\n- {{ tool.name }}: {{ tool.description }}\\n    Takes inputs: {{tool.inputs}}\\n'"},{name:"additional_authorized_imports",val:": Optional = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L824"}}),nt=new $({props:{name:"step",anchor:"transformers.ReactCodeAgent.step",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L864"}}),ot=new L({props:{title:"Tools",local:"tools",headingTag:"h2"}}),at=new L({props:{title:"load_tool",local:"transformers.load_tool",headingTag:"h3"}}),rt=new $({props:{name:"transformers.load_tool",anchor:"transformers.load_tool",parameters:[{name:"task_or_repo_id",val:""},{name:"model_repo_id",val:" = None"},{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-question-answering&quot;</code></li>
<li><code>&quot;speech-to-text&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.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/agents/tools.py#L656"}}),de=new ls({props:{warning:!0,$$slots:{default:[xl]},$$scope:{ctx:j}}}),st=new L({props:{title:"Tool",local:"transformers.Tool",headingTag:"h3"}}),lt=new $({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/agents/tools.py#L87"}}),it=new $({props:{name:"from_gradio",anchor:"transformers.Tool.from_gradio",parameters:[{name:"gradio_tool",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L373"}}),dt=new $({props:{name:"from_hub",anchor:"transformers.Tool.from_hub",parameters:[{name:"repo_id",val:": str"},{name:"model_repo_id",val:": Optional = None"},{name:"token",val:": Optional = None"},{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.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/agents/tools.py#L204"}}),ce=new ls({props:{warning:!0,$$slots:{default:[kl]},$$scope:{ctx:j}}}),mt=new $({props:{name:"from_langchain",anchor:"transformers.Tool.from_langchain",parameters:[{name:"langchain_tool",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L395"}}),ct=new $({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:": Optional = None"},{name:"token",val:": Union = 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/agents/tools.py#L316"}}),ge=new Aa({props:{anchor:"transformers.Tool.push_to_hub.example",$$slots:{default:[Cl]},$$scope:{ctx:j}}}),ht=new $({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/agents/tools.py#L144"}}),gt=new $({props:{name:"setup",anchor:"transformers.Tool.setup",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L137"}}),pt=new L({props:{title:"Toolbox",local:"transformers.Toolbox",headingTag:"h3"}}),ut=new $({props:{name:"class transformers.Toolbox",anchor:"transformers.Toolbox",parameters:[{name:"tools",val:": List"},{name:"add_base_tools",val:": bool = False"}],parametersDescription:[{anchor:"transformers.Toolbox.tools",description:`<strong>tools</strong> (<code>List[Tool]</code>) &#x2014;
The list of tools to instantiate the toolbox with`,name:"tools"},{anchor:"transformers.Toolbox.add_base_tools",description:`<strong>add_base_tools</strong> (<code>bool</code>, defaults to <code>False</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to add the tools available within <code>transformers</code> to the toolbox.`,name:"add_base_tools"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L156"}}),ft=new $({props:{name:"add_tool",anchor:"transformers.Toolbox.add_tool",parameters:[{name:"tool",val:": Tool"}],parametersDescription:[{anchor:"transformers.Toolbox.add_tool.tool",description:`<strong>tool</strong> (<code>Tool</code>) &#x2014;
The tool to add to the toolbox.`,name:"tool"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L202"}}),bt=new $({props:{name:"clear_toolbox",anchor:"transformers.Toolbox.clear_toolbox",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L242"}}),vt=new $({props:{name:"remove_tool",anchor:"transformers.Toolbox.remove_tool",parameters:[{name:"tool_name",val:": str"}],parametersDescription:[{anchor:"transformers.Toolbox.remove_tool.tool_name",description:`<strong>tool_name</strong> (<code>str</code>) &#x2014;
The tool to remove from the toolbox.`,name:"tool_name"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L214"}}),_t=new $({props:{name:"show_tool_descriptions",anchor:"transformers.Toolbox.show_tool_descriptions",parameters:[{name:"tool_description_template",val:": str = None"}],parametersDescription:[{anchor:"transformers.Toolbox.show_tool_descriptions.tool_description_template",description:`<strong>tool_description_template</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The template to use to describe the tools. If not provided, the default template will be used.`,name:"tool_description_template"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L190"}}),$t=new $({props:{name:"update_tool",anchor:"transformers.Toolbox.update_tool",parameters:[{name:"tool",val:": Tool"}],parametersDescription:[{anchor:"transformers.Toolbox.update_tool.tool",description:`<strong>tool</strong> (<code>Tool</code>) &#x2014;
The tool to update to the toolbox.`,name:"tool"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agents.py#L228"}}),yt=new L({props:{title:"PipelineTool",local:"transformers.PipelineTool",headingTag:"h3"}}),wt=new $({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/agents/tools.py#L455"}}),Tt=new $({props:{name:"decode",anchor:"transformers.PipelineTool.decode",parameters:[{name:"outputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L578"}}),xt=new $({props:{name:"encode",anchor:"transformers.PipelineTool.encode",parameters:[{name:"raw_inputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L565"}}),kt=new $({props:{name:"forward",anchor:"transformers.PipelineTool.forward",parameters:[{name:"inputs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L571"}}),Ct=new $({props:{name:"setup",anchor:"transformers.PipelineTool.setup",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L539"}}),It=new L({props:{title:"launch_gradio_demo",local:"transformers.launch_gradio_demo",headingTag:"h3"}}),At=new $({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/agents/tools.py#L603"}}),Mt=new L({props:{title:"ToolCollection",local:"transformers.ToolCollection",headingTag:"h3"}}),Lt=new $({props:{name:"class transformers.ToolCollection",anchor:"transformers.ToolCollection",parameters:[{name:"collection_slug",val:": str"},{name:"token",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.ToolCollection.collection_slug",description:`<strong>collection_slug</strong> (str) &#x2014;
The collection slug referencing the collection.`,name:"collection_slug"},{anchor:"transformers.ToolCollection.token",description:`<strong>token</strong> (str, <em>optional</em>) &#x2014;
The authentication token if the collection is private.`,name:"token"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/tools.py#L780"}}),xe=new Aa({props:{anchor:"transformers.ToolCollection.example",$$slots:{default:[Il]},$$scope:{ctx:j}}}),jt=new L({props:{title:"Engines",local:"engines",headingTag:"h2"}}),Nt=new L({props:{title:"HfEngine",local:"transformers.HfEngine",headingTag:"h3"}}),Et=new go({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhmRW5naW5lJTBBJTBBbWVzc2FnZXMlMjAlM0QlMjAlNUIlMEElMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJIZWxsbyUyQyUyMGhvdyUyMGFyZSUyMHlvdSUzRiUyMiU3RCUyQyUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJhc3Npc3RhbnQlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySSdtJTIwZG9pbmclMjBncmVhdC4lMjBIb3clMjBjYW4lMjBJJTIwaGVscCUyMHlvdSUyMHRvZGF5JTNGJTIyJTdEJTJDJTBBJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyTm8lMjBuZWVkJTIwdG8lMjBoZWxwJTJDJTIwdGFrZSUyMGl0JTIwZWFzeS4lMjIlN0QlMkMlMEElNUQlMEElMEFIZkVuZ2luZSgpKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJjb252ZXJzYXRpb24lMjIlNUQpJTBB",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HfEngine

<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
<span class="hljs-meta">... </span>  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>},
<span class="hljs-meta">... </span>  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;I&#x27;m doing great. How can I help you today?&quot;</span>},
<span class="hljs-meta">... </span>  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;No need to help, take it easy.&quot;</span>},
<span class="hljs-meta">... </span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>HfEngine()(messages, stop_sequences=[<span class="hljs-string">&quot;conversation&quot;</span>])

<span class="hljs-string">&quot;That&#x27;s very kind of you to say! It&#x27;s always nice to have a relaxed &quot;</span>`,wrap:!1}}),Dt=new $({props:{name:"class transformers.HfEngine",anchor:"transformers.HfEngine",parameters:[{name:"model",val:": str = 'meta-llama/Meta-Llama-3-8B-Instruct'"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/llm_engine.py#L68"}}),Ut=new L({props:{title:"Agent Types",local:"agent-types",headingTag:"h2"}}),Ot=new L({props:{title:"AgentText",local:"transformers.agents.agent_types.AgentText",headingTag:"h3"}}),Vt=new $({props:{name:"class transformers.agents.agent_types.AgentText",anchor:"transformers.agents.agent_types.AgentText",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L73"}}),zt=new L({props:{title:"AgentImage",local:"transformers.agents.agent_types.AgentImage",headingTag:"h3"}}),Zt=new $({props:{name:"class transformers.agents.agent_types.AgentImage",anchor:"transformers.agents.agent_types.AgentImage",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L85"}}),Gt=new $({props:{name:"save",anchor:"transformers.agents.agent_types.AgentImage.save",parameters:[{name:"output_bytes",val:""},{name:"format",val:""},{name:"**params",val:""}],parametersDescription:[{anchor:"transformers.agents.agent_types.AgentImage.save.output_bytes",description:"<strong>output_bytes</strong> (bytes) &#x2014; The output bytes to save the image to.",name:"output_bytes"},{anchor:"transformers.agents.agent_types.AgentImage.save.format",description:`<strong>format</strong> (str) &#x2014; The format to use for the output image. The format is the same as in PIL.Image.save.
**params &#x2014; Additional parameters to pass to PIL.Image.save.`,name:"format"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L162"}}),Yt=new $({props:{name:"to_raw",anchor:"transformers.agents.agent_types.AgentImage.to_raw",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L120"}}),Ft=new $({props:{name:"to_string",anchor:"transformers.agents.agent_types.AgentImage.to_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L135"}}),Qt=new L({props:{title:"AgentAudio",local:"transformers.agents.agent_types.AgentAudio",headingTag:"h3"}}),Xt=new $({props:{name:"class transformers.agents.agent_types.AgentAudio",anchor:"transformers.agents.agent_types.AgentAudio",parameters:[{name:"value",val:""},{name:"samplerate",val:" = 16000"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L174"}}),Kt=new $({props:{name:"to_raw",anchor:"transformers.agents.agent_types.AgentAudio.to_raw",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L207"}}),en=new $({props:{name:"to_string",anchor:"transformers.agents.agent_types.AgentAudio.to_string",parameters:[],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/agents/agent_types.py#L219"}}),tn=new $l({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/main_classes/agent.md"}}),{c(){f=r("meta"),x=n(),y=r("p"),w=n(),d(T.$$.fragment),b=n(),d(C.$$.fragment),po=n(),Je=r("p"),Je.innerHTML=is,uo=n(),d(Ee.$$.fragment),fo=n(),He=r("p"),He.innerHTML=ds,bo=n(),De=r("ul"),De.innerHTML=ms,vo=n(),d(Ue.$$.fragment),_o=n(),q=r("div"),d(We.$$.fragment),Ma=n(),K=r("div"),d(Be.$$.fragment),La=n(),dn=r("p"),dn.textContent=cs,ja=n(),ee=r("div"),d(Se.$$.fragment),qa=n(),mn=r("p"),mn.textContent=hs,Pa=n(),te=r("div"),d(Re.$$.fragment),Na=n(),cn=r("p"),cn.textContent=gs,Ja=n(),ne=r("div"),d(Oe.$$.fragment),Ea=n(),hn=r("p"),hn.textContent=ps,$o=n(),d(Ve.$$.fragment),yo=n(),E=r("div"),d(ze.$$.fragment),Ha=n(),gn=r("p"),gn.textContent=us,Da=n(),oe=r("div"),d(Ze.$$.fragment),Ua=n(),pn=r("p"),pn.innerHTML=fs,Wa=n(),Z=r("div"),d(Ge.$$.fragment),Ba=n(),un=r("p"),un.textContent=bs,Sa=n(),d(ae.$$.fragment),wo=n(),d(Ye.$$.fragment),To=n(),H=r("div"),d(Fe.$$.fragment),Ra=n(),fn=r("p"),fn.textContent=vs,Oa=n(),re=r("div"),d(Qe.$$.fragment),Va=n(),bn=r("p"),bn.textContent=_s,za=n(),G=r("div"),d(Xe.$$.fragment),Za=n(),vn=r("p"),vn.textContent=$s,Ga=n(),d(se.$$.fragment),xo=n(),R=r("div"),d(Ke.$$.fragment),Ya=n(),_n=r("p"),_n.textContent=ys,Fa=n(),le=r("div"),d(et.$$.fragment),Qa=n(),$n=r("p"),$n.textContent=ws,ko=n(),O=r("div"),d(tt.$$.fragment),Xa=n(),yn=r("p"),yn.textContent=Ts,Ka=n(),ie=r("div"),d(nt.$$.fragment),er=n(),wn=r("p"),wn.textContent=xs,Co=n(),d(ot.$$.fragment),Io=n(),d(at.$$.fragment),Ao=n(),V=r("div"),d(rt.$$.fragment),tr=n(),Tn=r("p"),Tn.textContent=ks,nr=n(),d(de.$$.fragment),Mo=n(),d(st.$$.fragment),Lo=n(),k=r("div"),d(lt.$$.fragment),or=n(),xn=r("p"),xn.innerHTML=Cs,ar=n(),kn=r("ul"),kn.innerHTML=Is,rr=n(),Cn=r("p"),Cn.innerHTML=As,sr=n(),me=r("div"),d(it.$$.fragment),lr=n(),In=r("p"),In.innerHTML=Ms,ir=n(),Y=r("div"),d(dt.$$.fragment),dr=n(),An=r("p"),An.textContent=Ls,mr=n(),d(ce.$$.fragment),cr=n(),he=r("div"),d(mt.$$.fragment),hr=n(),Mn=r("p"),Mn.innerHTML=js,gr=n(),B=r("div"),d(ct.$$.fragment),pr=n(),Ln=r("p"),Ln.textContent=qs,ur=n(),jn=r("p"),jn.innerHTML=Ps,fr=n(),d(ge.$$.fragment),br=n(),S=r("div"),d(ht.$$.fragment),vr=n(),qn=r("p"),qn.innerHTML=Ns,_r=n(),Pn=r("ul"),Pn.innerHTML=Js,$r=n(),Nn=r("p"),Nn.innerHTML=Es,yr=n(),pe=r("div"),d(gt.$$.fragment),wr=n(),Jn=r("p"),Jn.textContent=Hs,jo=n(),d(pt.$$.fragment),qo=n(),A=r("div"),d(ut.$$.fragment),Tr=n(),En=r("p"),En.textContent=Ds,xr=n(),ue=r("div"),d(ft.$$.fragment),kr=n(),Hn=r("p"),Hn.textContent=Us,Cr=n(),fe=r("div"),d(bt.$$.fragment),Ir=n(),Dn=r("p"),Dn.textContent=Ws,Ar=n(),be=r("div"),d(vt.$$.fragment),Mr=n(),Un=r("p"),Un.textContent=Bs,Lr=n(),ve=r("div"),d(_t.$$.fragment),jr=n(),Wn=r("p"),Wn.textContent=Ss,qr=n(),_e=r("div"),d($t.$$.fragment),Pr=n(),Bn=r("p"),Bn.textContent=Rs,Po=n(),d(yt.$$.fragment),No=n(),M=r("div"),d(wt.$$.fragment),Nr=n(),Sn=r("p"),Sn.innerHTML=Os,Jr=n(),Rn=r("ul"),Rn.innerHTML=Vs,Er=n(),$e=r("div"),d(Tt.$$.fragment),Hr=n(),On=r("p"),On.innerHTML=zs,Dr=n(),ye=r("div"),d(xt.$$.fragment),Ur=n(),Vn=r("p"),Vn.innerHTML=Zs,Wr=n(),we=r("div"),d(kt.$$.fragment),Br=n(),zn=r("p"),zn.innerHTML=Gs,Sr=n(),Te=r("div"),d(Ct.$$.fragment),Rr=n(),Zn=r("p"),Zn.innerHTML=Ys,Jo=n(),d(It.$$.fragment),Eo=n(),Q=r("div"),d(At.$$.fragment),Or=n(),Gn=r("p"),Gn.innerHTML=Fs,Ho=n(),d(Mt.$$.fragment),Do=n(),D=r("div"),d(Lt.$$.fragment),Vr=n(),Yn=r("p"),Yn.textContent=Qs,zr=n(),Fn=r("blockquote"),Fn.innerHTML=Xs,Zr=n(),d(xe.$$.fragment),Uo=n(),d(jt.$$.fragment),Wo=n(),qt=r("p"),qt.textContent=Ks,Bo=n(),Pt=r("ol"),Pt.innerHTML=el,So=n(),d(Nt.$$.fragment),Ro=n(),Jt=r("p"),Jt.innerHTML=tl,Oo=n(),d(Et.$$.fragment),Vo=n(),Ht=r("div"),d(Dt.$$.fragment),zo=n(),d(Ut.$$.fragment),Zo=n(),Wt=r("p"),Wt.textContent=nl,Go=n(),Bt=r("p"),Bt.innerHTML=ol,Yo=n(),St=r("p"),St.textContent=al,Fo=n(),Rt=r("ul"),Rt.innerHTML=rl,Qo=n(),d(Ot.$$.fragment),Xo=n(),X=r("div"),d(Vt.$$.fragment),Gr=n(),Qn=r("p"),Qn.textContent=sl,Ko=n(),d(zt.$$.fragment),ea=n(),P=r("div"),d(Zt.$$.fragment),Yr=n(),Xn=r("p"),Xn.textContent=ll,Fr=n(),ke=r("div"),d(Gt.$$.fragment),Qr=n(),Kn=r("p"),Kn.textContent=il,Xr=n(),Ce=r("div"),d(Yt.$$.fragment),Kr=n(),eo=r("p"),eo.textContent=dl,es=n(),Ie=r("div"),d(Ft.$$.fragment),ts=n(),to=r("p"),to.textContent=ml,ta=n(),d(Qt.$$.fragment),na=n(),U=r("div"),d(Xt.$$.fragment),ns=n(),no=r("p"),no.textContent=cl,os=n(),Ae=r("div"),d(Kt.$$.fragment),as=n(),oo=r("p"),oo.innerHTML=hl,rs=n(),Me=r("div"),d(en.$$.fragment),ss=n(),ao=r("p"),ao.textContent=gl,oa=n(),d(tn.$$.fragment),aa=n(),ho=r("p"),this.h()},l(e){const l=_l("svelte-u9bgzb",document.head);f=s(l,"META",{name:!0,content:!0}),l.forEach(a),x=o(e),y=s(e,"P",{}),v(y).forEach(a),w=o(e),m(T.$$.fragment,e),b=o(e),m(C.$$.fragment,e),po=o(e),Je=s(e,"P",{"data-svelte-h":!0}),u(Je)!=="svelte-7mj07q"&&(Je.innerHTML=is),uo=o(e),m(Ee.$$.fragment,e),fo=o(e),He=s(e,"P",{"data-svelte-h":!0}),u(He)!=="svelte-n8fmrj"&&(He.innerHTML=ds),bo=o(e),De=s(e,"UL",{"data-svelte-h":!0}),u(De)!=="svelte-kxuq94"&&(De.innerHTML=ms),vo=o(e),m(Ue.$$.fragment,e),_o=o(e),q=s(e,"DIV",{class:!0});var W=v(q);m(We.$$.fragment,W),Ma=o(W),K=s(W,"DIV",{class:!0});var nn=v(K);m(Be.$$.fragment,nn),La=o(nn),dn=s(nn,"P",{"data-svelte-h":!0}),u(dn)!=="svelte-a91m64"&&(dn.textContent=cs),nn.forEach(a),ja=o(W),ee=s(W,"DIV",{class:!0});var on=v(ee);m(Se.$$.fragment,on),qa=o(on),mn=s(on,"P",{"data-svelte-h":!0}),u(mn)!=="svelte-104knry"&&(mn.textContent=hs),on.forEach(a),Pa=o(W),te=s(W,"DIV",{class:!0});var an=v(te);m(Re.$$.fragment,an),Na=o(an),cn=s(an,"P",{"data-svelte-h":!0}),u(cn)!=="svelte-wvvftk"&&(cn.textContent=gs),an.forEach(a),Ja=o(W),ne=s(W,"DIV",{class:!0});var rn=v(ne);m(Oe.$$.fragment,rn),Ea=o(rn),hn=s(rn,"P",{"data-svelte-h":!0}),u(hn)!=="svelte-1cw6633"&&(hn.textContent=ps),rn.forEach(a),W.forEach(a),$o=o(e),m(Ve.$$.fragment,e),yo=o(e),E=s(e,"DIV",{class:!0});var z=v(E);m(ze.$$.fragment,z),Ha=o(z),gn=s(z,"P",{"data-svelte-h":!0}),u(gn)!=="svelte-rq8zg0"&&(gn.textContent=us),Da=o(z),oe=s(z,"DIV",{class:!0});var sn=v(oe);m(Ze.$$.fragment,sn),Ua=o(sn),pn=s(sn,"P",{"data-svelte-h":!0}),u(pn)!=="svelte-tvi94l"&&(pn.innerHTML=fs),sn.forEach(a),Wa=o(z),Z=s(z,"DIV",{class:!0});var ro=v(Z);m(Ge.$$.fragment,ro),Ba=o(ro),un=s(ro,"P",{"data-svelte-h":!0}),u(un)!=="svelte-tbr5ck"&&(un.textContent=bs),Sa=o(ro),m(ae.$$.fragment,ro),ro.forEach(a),z.forEach(a),wo=o(e),m(Ye.$$.fragment,e),To=o(e),H=s(e,"DIV",{class:!0});var Le=v(H);m(Fe.$$.fragment,Le),Ra=o(Le),fn=s(Le,"P",{"data-svelte-h":!0}),u(fn)!=="svelte-c95fji"&&(fn.textContent=vs),Oa=o(Le),re=s(Le,"DIV",{class:!0});var sa=v(re);m(Qe.$$.fragment,sa),Va=o(sa),bn=s(sa,"P",{"data-svelte-h":!0}),u(bn)!=="svelte-1ii4mb"&&(bn.textContent=_s),sa.forEach(a),za=o(Le),G=s(Le,"DIV",{class:!0});var so=v(G);m(Xe.$$.fragment,so),Za=o(so),vn=s(so,"P",{"data-svelte-h":!0}),u(vn)!=="svelte-tbr5ck"&&(vn.textContent=$s),Ga=o(so),m(se.$$.fragment,so),so.forEach(a),Le.forEach(a),xo=o(e),R=s(e,"DIV",{class:!0});var lo=v(R);m(Ke.$$.fragment,lo),Ya=o(lo),_n=s(lo,"P",{"data-svelte-h":!0}),u(_n)!=="svelte-1ip7q5f"&&(_n.textContent=ys),Fa=o(lo),le=s(lo,"DIV",{class:!0});var la=v(le);m(et.$$.fragment,la),Qa=o(la),$n=s(la,"P",{"data-svelte-h":!0}),u($n)!=="svelte-1bbx2c8"&&($n.textContent=ws),la.forEach(a),lo.forEach(a),ko=o(e),O=s(e,"DIV",{class:!0});var io=v(O);m(tt.$$.fragment,io),Xa=o(io),yn=s(io,"P",{"data-svelte-h":!0}),u(yn)!=="svelte-1egm30q"&&(yn.textContent=Ts),Ka=o(io),ie=s(io,"DIV",{class:!0});var ia=v(ie);m(nt.$$.fragment,ia),er=o(ia),wn=s(ia,"P",{"data-svelte-h":!0}),u(wn)!=="svelte-1bbx2c8"&&(wn.textContent=xs),ia.forEach(a),io.forEach(a),Co=o(e),m(ot.$$.fragment,e),Io=o(e),m(at.$$.fragment,e),Ao=o(e),V=s(e,"DIV",{class:!0});var mo=v(V);m(rt.$$.fragment,mo),tr=o(mo),Tn=s(mo,"P",{"data-svelte-h":!0}),u(Tn)!=="svelte-16uh3p8"&&(Tn.textContent=ks),nr=o(mo),m(de.$$.fragment,mo),mo.forEach(a),Mo=o(e),m(st.$$.fragment,e),Lo=o(e),k=s(e,"DIV",{class:!0});var I=v(k);m(lt.$$.fragment,I),or=o(I),xn=s(I,"P",{"data-svelte-h":!0}),u(xn)!=="svelte-cca4c5"&&(xn.innerHTML=Cs),ar=o(I),kn=s(I,"UL",{"data-svelte-h":!0}),u(kn)!=="svelte-1cvtzkm"&&(kn.innerHTML=Is),rr=o(I),Cn=s(I,"P",{"data-svelte-h":!0}),u(Cn)!=="svelte-10s049q"&&(Cn.innerHTML=As),sr=o(I),me=s(I,"DIV",{class:!0});var da=v(me);m(it.$$.fragment,da),lr=o(da),In=s(da,"P",{"data-svelte-h":!0}),u(In)!=="svelte-548oc7"&&(In.innerHTML=Ms),da.forEach(a),ir=o(I),Y=s(I,"DIV",{class:!0});var co=v(Y);m(dt.$$.fragment,co),dr=o(co),An=s(co,"P",{"data-svelte-h":!0}),u(An)!=="svelte-yy7b2c"&&(An.textContent=Ls),mr=o(co),m(ce.$$.fragment,co),co.forEach(a),cr=o(I),he=s(I,"DIV",{class:!0});var ma=v(he);m(mt.$$.fragment,ma),hr=o(ma),Mn=s(ma,"P",{"data-svelte-h":!0}),u(Mn)!=="svelte-umcuss"&&(Mn.innerHTML=js),ma.forEach(a),gr=o(I),B=s(I,"DIV",{class:!0});var je=v(B);m(ct.$$.fragment,je),pr=o(je),Ln=s(je,"P",{"data-svelte-h":!0}),u(Ln)!=="svelte-1u3gku9"&&(Ln.textContent=qs),ur=o(je),jn=s(je,"P",{"data-svelte-h":!0}),u(jn)!=="svelte-1yeagwn"&&(jn.innerHTML=Ps),fr=o(je),m(ge.$$.fragment,je),je.forEach(a),br=o(I),S=s(I,"DIV",{class:!0});var qe=v(S);m(ht.$$.fragment,qe),vr=o(qe),qn=s(qe,"P",{"data-svelte-h":!0}),u(qn)!=="svelte-19evuwa"&&(qn.innerHTML=Ns),_r=o(qe),Pn=s(qe,"UL",{"data-svelte-h":!0}),u(Pn)!=="svelte-15of9ze"&&(Pn.innerHTML=Js),$r=o(qe),Nn=s(qe,"P",{"data-svelte-h":!0}),u(Nn)!=="svelte-msa4ge"&&(Nn.innerHTML=Es),qe.forEach(a),yr=o(I),pe=s(I,"DIV",{class:!0});var ca=v(pe);m(gt.$$.fragment,ca),wr=o(ca),Jn=s(ca,"P",{"data-svelte-h":!0}),u(Jn)!=="svelte-63kthh"&&(Jn.textContent=Hs),ca.forEach(a),I.forEach(a),jo=o(e),m(pt.$$.fragment,e),qo=o(e),A=s(e,"DIV",{class:!0});var N=v(A);m(ut.$$.fragment,N),Tr=o(N),En=s(N,"P",{"data-svelte-h":!0}),u(En)!=="svelte-1jgzyq0"&&(En.textContent=Ds),xr=o(N),ue=s(N,"DIV",{class:!0});var ha=v(ue);m(ft.$$.fragment,ha),kr=o(ha),Hn=s(ha,"P",{"data-svelte-h":!0}),u(Hn)!=="svelte-g8q0nk"&&(Hn.textContent=Us),ha.forEach(a),Cr=o(N),fe=s(N,"DIV",{class:!0});var ga=v(fe);m(bt.$$.fragment,ga),Ir=o(ga),Dn=s(ga,"P",{"data-svelte-h":!0}),u(Dn)!=="svelte-1l2znf2"&&(Dn.textContent=Ws),ga.forEach(a),Ar=o(N),be=s(N,"DIV",{class:!0});var pa=v(be);m(vt.$$.fragment,pa),Mr=o(pa),Un=s(pa,"P",{"data-svelte-h":!0}),u(Un)!=="svelte-165lhg0"&&(Un.textContent=Bs),pa.forEach(a),Lr=o(N),ve=s(N,"DIV",{class:!0});var ua=v(ve);m(_t.$$.fragment,ua),jr=o(ua),Wn=s(ua,"P",{"data-svelte-h":!0}),u(Wn)!=="svelte-15vkk0u"&&(Wn.textContent=Ss),ua.forEach(a),qr=o(N),_e=s(N,"DIV",{class:!0});var fa=v(_e);m($t.$$.fragment,fa),Pr=o(fa),Bn=s(fa,"P",{"data-svelte-h":!0}),u(Bn)!=="svelte-1p64qrs"&&(Bn.textContent=Rs),fa.forEach(a),N.forEach(a),Po=o(e),m(yt.$$.fragment,e),No=o(e),M=s(e,"DIV",{class:!0});var J=v(M);m(wt.$$.fragment,J),Nr=o(J),Sn=s(J,"P",{"data-svelte-h":!0}),u(Sn)!=="svelte-1tqfigx"&&(Sn.innerHTML=Os),Jr=o(J),Rn=s(J,"UL",{"data-svelte-h":!0}),u(Rn)!=="svelte-n6zm2g"&&(Rn.innerHTML=Vs),Er=o(J),$e=s(J,"DIV",{class:!0});var ba=v($e);m(Tt.$$.fragment,ba),Hr=o(ba),On=s(ba,"P",{"data-svelte-h":!0}),u(On)!=="svelte-zkjq4t"&&(On.innerHTML=zs),ba.forEach(a),Dr=o(J),ye=s(J,"DIV",{class:!0});var va=v(ye);m(xt.$$.fragment,va),Ur=o(va),Vn=s(va,"P",{"data-svelte-h":!0}),u(Vn)!=="svelte-1vxzk80"&&(Vn.innerHTML=Zs),va.forEach(a),Wr=o(J),we=s(J,"DIV",{class:!0});var _a=v(we);m(kt.$$.fragment,_a),Br=o(_a),zn=s(_a,"P",{"data-svelte-h":!0}),u(zn)!=="svelte-1qgsi13"&&(zn.innerHTML=Gs),_a.forEach(a),Sr=o(J),Te=s(J,"DIV",{class:!0});var $a=v(Te);m(Ct.$$.fragment,$a),Rr=o($a),Zn=s($a,"P",{"data-svelte-h":!0}),u(Zn)!=="svelte-1ojxz66"&&(Zn.innerHTML=Ys),$a.forEach(a),J.forEach(a),Jo=o(e),m(It.$$.fragment,e),Eo=o(e),Q=s(e,"DIV",{class:!0});var ya=v(Q);m(At.$$.fragment,ya),Or=o(ya),Gn=s(ya,"P",{"data-svelte-h":!0}),u(Gn)!=="svelte-j4u4it"&&(Gn.innerHTML=Fs),ya.forEach(a),Ho=o(e),m(Mt.$$.fragment,e),Do=o(e),D=s(e,"DIV",{class:!0});var Pe=v(D);m(Lt.$$.fragment,Pe),Vr=o(Pe),Yn=s(Pe,"P",{"data-svelte-h":!0}),u(Yn)!=="svelte-n5kqzu"&&(Yn.textContent=Qs),zr=o(Pe),Fn=s(Pe,"BLOCKQUOTE",{"data-svelte-h":!0}),u(Fn)!=="svelte-1ezz2hf"&&(Fn.innerHTML=Xs),Zr=o(Pe),m(xe.$$.fragment,Pe),Pe.forEach(a),Uo=o(e),m(jt.$$.fragment,e),Wo=o(e),qt=s(e,"P",{"data-svelte-h":!0}),u(qt)!=="svelte-oor881"&&(qt.textContent=Ks),Bo=o(e),Pt=s(e,"OL",{"data-svelte-h":!0}),u(Pt)!=="svelte-1fvckr8"&&(Pt.innerHTML=el),So=o(e),m(Nt.$$.fragment,e),Ro=o(e),Jt=s(e,"P",{"data-svelte-h":!0}),u(Jt)!=="svelte-1helv3l"&&(Jt.innerHTML=tl),Oo=o(e),m(Et.$$.fragment,e),Vo=o(e),Ht=s(e,"DIV",{class:!0});var pl=v(Ht);m(Dt.$$.fragment,pl),pl.forEach(a),zo=o(e),m(Ut.$$.fragment,e),Zo=o(e),Wt=s(e,"P",{"data-svelte-h":!0}),u(Wt)!=="svelte-jsq4jz"&&(Wt.textContent=nl),Go=o(e),Bt=s(e,"P",{"data-svelte-h":!0}),u(Bt)!=="svelte-1ixcu88"&&(Bt.innerHTML=ol),Yo=o(e),St=s(e,"P",{"data-svelte-h":!0}),u(St)!=="svelte-1nfvcwf"&&(St.textContent=al),Fo=o(e),Rt=s(e,"UL",{"data-svelte-h":!0}),u(Rt)!=="svelte-ysem30"&&(Rt.innerHTML=rl),Qo=o(e),m(Ot.$$.fragment,e),Xo=o(e),X=s(e,"DIV",{class:!0});var wa=v(X);m(Vt.$$.fragment,wa),Gr=o(wa),Qn=s(wa,"P",{"data-svelte-h":!0}),u(Qn)!=="svelte-57fhj7"&&(Qn.textContent=sl),wa.forEach(a),Ko=o(e),m(zt.$$.fragment,e),ea=o(e),P=s(e,"DIV",{class:!0});var F=v(P);m(Zt.$$.fragment,F),Yr=o(F),Xn=s(F,"P",{"data-svelte-h":!0}),u(Xn)!=="svelte-1hsb0qs"&&(Xn.textContent=ll),Fr=o(F),ke=s(F,"DIV",{class:!0});var Ta=v(ke);m(Gt.$$.fragment,Ta),Qr=o(Ta),Kn=s(Ta,"P",{"data-svelte-h":!0}),u(Kn)!=="svelte-qix5eq"&&(Kn.textContent=il),Ta.forEach(a),Xr=o(F),Ce=s(F,"DIV",{class:!0});var xa=v(Ce);m(Yt.$$.fragment,xa),Kr=o(xa),eo=s(xa,"P",{"data-svelte-h":!0}),u(eo)!=="svelte-ybie7i"&&(eo.textContent=dl),xa.forEach(a),es=o(F),Ie=s(F,"DIV",{class:!0});var ka=v(Ie);m(Ft.$$.fragment,ka),ts=o(ka),to=s(ka,"P",{"data-svelte-h":!0}),u(to)!=="svelte-chc6sp"&&(to.textContent=ml),ka.forEach(a),F.forEach(a),ta=o(e),m(Qt.$$.fragment,e),na=o(e),U=s(e,"DIV",{class:!0});var Ne=v(U);m(Xt.$$.fragment,Ne),ns=o(Ne),no=s(Ne,"P",{"data-svelte-h":!0}),u(no)!=="svelte-ckiqb6"&&(no.textContent=cl),os=o(Ne),Ae=s(Ne,"DIV",{class:!0});var Ca=v(Ae);m(Kt.$$.fragment,Ca),as=o(Ca),oo=s(Ca,"P",{"data-svelte-h":!0}),u(oo)!=="svelte-10rnn1x"&&(oo.innerHTML=hl),Ca.forEach(a),rs=o(Ne),Me=s(Ne,"DIV",{class:!0});var Ia=v(Me);m(en.$$.fragment,Ia),ss=o(Ia),ao=s(Ia,"P",{"data-svelte-h":!0}),u(ao)!=="svelte-1xu9o93"&&(ao.textContent=gl),Ia.forEach(a),Ne.forEach(a),oa=o(e),m(tn.$$.fragment,e),aa=o(e),ho=s(e,"P",{}),v(ho).forEach(a),this.h()},h(){_(f,"name","hf:doc:metadata"),_(f,"content",Ml),_(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){t(document.head,f),i(e,x,l),i(e,y,l),i(e,w,l),c(T,e,l),i(e,b,l),c(C,e,l),i(e,po,l),i(e,Je,l),i(e,uo,l),c(Ee,e,l),i(e,fo,l),i(e,He,l),i(e,bo,l),i(e,De,l),i(e,vo,l),c(Ue,e,l),i(e,_o,l),i(e,q,l),c(We,q,null),t(q,Ma),t(q,K),c(Be,K,null),t(K,La),t(K,dn),t(q,ja),t(q,ee),c(Se,ee,null),t(ee,qa),t(ee,mn),t(q,Pa),t(q,te),c(Re,te,null),t(te,Na),t(te,cn),t(q,Ja),t(q,ne),c(Oe,ne,null),t(ne,Ea),t(ne,hn),i(e,$o,l),c(Ve,e,l),i(e,yo,l),i(e,E,l),c(ze,E,null),t(E,Ha),t(E,gn),t(E,Da),t(E,oe),c(Ze,oe,null),t(oe,Ua),t(oe,pn),t(E,Wa),t(E,Z),c(Ge,Z,null),t(Z,Ba),t(Z,un),t(Z,Sa),c(ae,Z,null),i(e,wo,l),c(Ye,e,l),i(e,To,l),i(e,H,l),c(Fe,H,null),t(H,Ra),t(H,fn),t(H,Oa),t(H,re),c(Qe,re,null),t(re,Va),t(re,bn),t(H,za),t(H,G),c(Xe,G,null),t(G,Za),t(G,vn),t(G,Ga),c(se,G,null),i(e,xo,l),i(e,R,l),c(Ke,R,null),t(R,Ya),t(R,_n),t(R,Fa),t(R,le),c(et,le,null),t(le,Qa),t(le,$n),i(e,ko,l),i(e,O,l),c(tt,O,null),t(O,Xa),t(O,yn),t(O,Ka),t(O,ie),c(nt,ie,null),t(ie,er),t(ie,wn),i(e,Co,l),c(ot,e,l),i(e,Io,l),c(at,e,l),i(e,Ao,l),i(e,V,l),c(rt,V,null),t(V,tr),t(V,Tn),t(V,nr),c(de,V,null),i(e,Mo,l),c(st,e,l),i(e,Lo,l),i(e,k,l),c(lt,k,null),t(k,or),t(k,xn),t(k,ar),t(k,kn),t(k,rr),t(k,Cn),t(k,sr),t(k,me),c(it,me,null),t(me,lr),t(me,In),t(k,ir),t(k,Y),c(dt,Y,null),t(Y,dr),t(Y,An),t(Y,mr),c(ce,Y,null),t(k,cr),t(k,he),c(mt,he,null),t(he,hr),t(he,Mn),t(k,gr),t(k,B),c(ct,B,null),t(B,pr),t(B,Ln),t(B,ur),t(B,jn),t(B,fr),c(ge,B,null),t(k,br),t(k,S),c(ht,S,null),t(S,vr),t(S,qn),t(S,_r),t(S,Pn),t(S,$r),t(S,Nn),t(k,yr),t(k,pe),c(gt,pe,null),t(pe,wr),t(pe,Jn),i(e,jo,l),c(pt,e,l),i(e,qo,l),i(e,A,l),c(ut,A,null),t(A,Tr),t(A,En),t(A,xr),t(A,ue),c(ft,ue,null),t(ue,kr),t(ue,Hn),t(A,Cr),t(A,fe),c(bt,fe,null),t(fe,Ir),t(fe,Dn),t(A,Ar),t(A,be),c(vt,be,null),t(be,Mr),t(be,Un),t(A,Lr),t(A,ve),c(_t,ve,null),t(ve,jr),t(ve,Wn),t(A,qr),t(A,_e),c($t,_e,null),t(_e,Pr),t(_e,Bn),i(e,Po,l),c(yt,e,l),i(e,No,l),i(e,M,l),c(wt,M,null),t(M,Nr),t(M,Sn),t(M,Jr),t(M,Rn),t(M,Er),t(M,$e),c(Tt,$e,null),t($e,Hr),t($e,On),t(M,Dr),t(M,ye),c(xt,ye,null),t(ye,Ur),t(ye,Vn),t(M,Wr),t(M,we),c(kt,we,null),t(we,Br),t(we,zn),t(M,Sr),t(M,Te),c(Ct,Te,null),t(Te,Rr),t(Te,Zn),i(e,Jo,l),c(It,e,l),i(e,Eo,l),i(e,Q,l),c(At,Q,null),t(Q,Or),t(Q,Gn),i(e,Ho,l),c(Mt,e,l),i(e,Do,l),i(e,D,l),c(Lt,D,null),t(D,Vr),t(D,Yn),t(D,zr),t(D,Fn),t(D,Zr),c(xe,D,null),i(e,Uo,l),c(jt,e,l),i(e,Wo,l),i(e,qt,l),i(e,Bo,l),i(e,Pt,l),i(e,So,l),c(Nt,e,l),i(e,Ro,l),i(e,Jt,l),i(e,Oo,l),c(Et,e,l),i(e,Vo,l),i(e,Ht,l),c(Dt,Ht,null),i(e,zo,l),c(Ut,e,l),i(e,Zo,l),i(e,Wt,l),i(e,Go,l),i(e,Bt,l),i(e,Yo,l),i(e,St,l),i(e,Fo,l),i(e,Rt,l),i(e,Qo,l),c(Ot,e,l),i(e,Xo,l),i(e,X,l),c(Vt,X,null),t(X,Gr),t(X,Qn),i(e,Ko,l),c(zt,e,l),i(e,ea,l),i(e,P,l),c(Zt,P,null),t(P,Yr),t(P,Xn),t(P,Fr),t(P,ke),c(Gt,ke,null),t(ke,Qr),t(ke,Kn),t(P,Xr),t(P,Ce),c(Yt,Ce,null),t(Ce,Kr),t(Ce,eo),t(P,es),t(P,Ie),c(Ft,Ie,null),t(Ie,ts),t(Ie,to),i(e,ta,l),c(Qt,e,l),i(e,na,l),i(e,U,l),c(Xt,U,null),t(U,ns),t(U,no),t(U,os),t(U,Ae),c(Kt,Ae,null),t(Ae,as),t(Ae,oo),t(U,rs),t(U,Me),c(en,Me,null),t(Me,ss),t(Me,ao),i(e,oa,l),c(tn,e,l),i(e,aa,l),i(e,ho,l),ra=!0},p(e,[l]){const W={};l&2&&(W.$$scope={dirty:l,ctx:e}),C.$set(W);const nn={};l&2&&(nn.$$scope={dirty:l,ctx:e}),ae.$set(nn);const on={};l&2&&(on.$$scope={dirty:l,ctx:e}),se.$set(on);const an={};l&2&&(an.$$scope={dirty:l,ctx:e}),de.$set(an);const rn={};l&2&&(rn.$$scope={dirty:l,ctx:e}),ce.$set(rn);const z={};l&2&&(z.$$scope={dirty:l,ctx:e}),ge.$set(z);const sn={};l&2&&(sn.$$scope={dirty:l,ctx:e}),xe.$set(sn)},i(e){ra||(h(T.$$.fragment,e),h(C.$$.fragment,e),h(Ee.$$.fragment,e),h(Ue.$$.fragment,e),h(We.$$.fragment,e),h(Be.$$.fragment,e),h(Se.$$.fragment,e),h(Re.$$.fragment,e),h(Oe.$$.fragment,e),h(Ve.$$.fragment,e),h(ze.$$.fragment,e),h(Ze.$$.fragment,e),h(Ge.$$.fragment,e),h(ae.$$.fragment,e),h(Ye.$$.fragment,e),h(Fe.$$.fragment,e),h(Qe.$$.fragment,e),h(Xe.$$.fragment,e),h(se.$$.fragment,e),h(Ke.$$.fragment,e),h(et.$$.fragment,e),h(tt.$$.fragment,e),h(nt.$$.fragment,e),h(ot.$$.fragment,e),h(at.$$.fragment,e),h(rt.$$.fragment,e),h(de.$$.fragment,e),h(st.$$.fragment,e),h(lt.$$.fragment,e),h(it.$$.fragment,e),h(dt.$$.fragment,e),h(ce.$$.fragment,e),h(mt.$$.fragment,e),h(ct.$$.fragment,e),h(ge.$$.fragment,e),h(ht.$$.fragment,e),h(gt.$$.fragment,e),h(pt.$$.fragment,e),h(ut.$$.fragment,e),h(ft.$$.fragment,e),h(bt.$$.fragment,e),h(vt.$$.fragment,e),h(_t.$$.fragment,e),h($t.$$.fragment,e),h(yt.$$.fragment,e),h(wt.$$.fragment,e),h(Tt.$$.fragment,e),h(xt.$$.fragment,e),h(kt.$$.fragment,e),h(Ct.$$.fragment,e),h(It.$$.fragment,e),h(At.$$.fragment,e),h(Mt.$$.fragment,e),h(Lt.$$.fragment,e),h(xe.$$.fragment,e),h(jt.$$.fragment,e),h(Nt.$$.fragment,e),h(Et.$$.fragment,e),h(Dt.$$.fragment,e),h(Ut.$$.fragment,e),h(Ot.$$.fragment,e),h(Vt.$$.fragment,e),h(zt.$$.fragment,e),h(Zt.$$.fragment,e),h(Gt.$$.fragment,e),h(Yt.$$.fragment,e),h(Ft.$$.fragment,e),h(Qt.$$.fragment,e),h(Xt.$$.fragment,e),h(Kt.$$.fragment,e),h(en.$$.fragment,e),h(tn.$$.fragment,e),ra=!0)},o(e){g(T.$$.fragment,e),g(C.$$.fragment,e),g(Ee.$$.fragment,e),g(Ue.$$.fragment,e),g(We.$$.fragment,e),g(Be.$$.fragment,e),g(Se.$$.fragment,e),g(Re.$$.fragment,e),g(Oe.$$.fragment,e),g(Ve.$$.fragment,e),g(ze.$$.fragment,e),g(Ze.$$.fragment,e),g(Ge.$$.fragment,e),g(ae.$$.fragment,e),g(Ye.$$.fragment,e),g(Fe.$$.fragment,e),g(Qe.$$.fragment,e),g(Xe.$$.fragment,e),g(se.$$.fragment,e),g(Ke.$$.fragment,e),g(et.$$.fragment,e),g(tt.$$.fragment,e),g(nt.$$.fragment,e),g(ot.$$.fragment,e),g(at.$$.fragment,e),g(rt.$$.fragment,e),g(de.$$.fragment,e),g(st.$$.fragment,e),g(lt.$$.fragment,e),g(it.$$.fragment,e),g(dt.$$.fragment,e),g(ce.$$.fragment,e),g(mt.$$.fragment,e),g(ct.$$.fragment,e),g(ge.$$.fragment,e),g(ht.$$.fragment,e),g(gt.$$.fragment,e),g(pt.$$.fragment,e),g(ut.$$.fragment,e),g(ft.$$.fragment,e),g(bt.$$.fragment,e),g(vt.$$.fragment,e),g(_t.$$.fragment,e),g($t.$$.fragment,e),g(yt.$$.fragment,e),g(wt.$$.fragment,e),g(Tt.$$.fragment,e),g(xt.$$.fragment,e),g(kt.$$.fragment,e),g(Ct.$$.fragment,e),g(It.$$.fragment,e),g(At.$$.fragment,e),g(Mt.$$.fragment,e),g(Lt.$$.fragment,e),g(xe.$$.fragment,e),g(jt.$$.fragment,e),g(Nt.$$.fragment,e),g(Et.$$.fragment,e),g(Dt.$$.fragment,e),g(Ut.$$.fragment,e),g(Ot.$$.fragment,e),g(Vt.$$.fragment,e),g(zt.$$.fragment,e),g(Zt.$$.fragment,e),g(Gt.$$.fragment,e),g(Yt.$$.fragment,e),g(Ft.$$.fragment,e),g(Qt.$$.fragment,e),g(Xt.$$.fragment,e),g(Kt.$$.fragment,e),g(en.$$.fragment,e),g(tn.$$.fragment,e),ra=!1},d(e){e&&(a(x),a(y),a(w),a(b),a(po),a(Je),a(uo),a(fo),a(He),a(bo),a(De),a(vo),a(_o),a(q),a($o),a(yo),a(E),a(wo),a(To),a(H),a(xo),a(R),a(ko),a(O),a(Co),a(Io),a(Ao),a(V),a(Mo),a(Lo),a(k),a(jo),a(qo),a(A),a(Po),a(No),a(M),a(Jo),a(Eo),a(Q),a(Ho),a(Do),a(D),a(Uo),a(Wo),a(qt),a(Bo),a(Pt),a(So),a(Ro),a(Jt),a(Oo),a(Vo),a(Ht),a(zo),a(Zo),a(Wt),a(Go),a(Bt),a(Yo),a(St),a(Fo),a(Rt),a(Qo),a(Xo),a(X),a(Ko),a(ea),a(P),a(ta),a(na),a(U),a(oa),a(aa),a(ho)),a(f),p(T,e),p(C,e),p(Ee,e),p(Ue,e),p(We),p(Be),p(Se),p(Re),p(Oe),p(Ve,e),p(ze),p(Ze),p(Ge),p(ae),p(Ye,e),p(Fe),p(Qe),p(Xe),p(se),p(Ke),p(et),p(tt),p(nt),p(ot,e),p(at,e),p(rt),p(de),p(st,e),p(lt),p(it),p(dt),p(ce),p(mt),p(ct),p(ge),p(ht),p(gt),p(pt,e),p(ut),p(ft),p(bt),p(vt),p(_t),p($t),p(yt,e),p(wt),p(Tt),p(xt),p(kt),p(Ct),p(It,e),p(At),p(Mt,e),p(Lt),p(xe),p(jt,e),p(Nt,e),p(Et,e),p(Dt),p(Ut,e),p(Ot,e),p(Vt),p(zt,e),p(Zt),p(Gt),p(Yt),p(Ft),p(Qt,e),p(Xt),p(Kt),p(en),p(tn,e)}}}const Ml='{"title":"Agents & Tools","local":"agents--tools","sections":[{"title":"Agents","local":"agents","sections":[{"title":"Agent","local":"transformers.Agent","sections":[],"depth":3},{"title":"CodeAgent","local":"transformers.CodeAgent","sections":[],"depth":3},{"title":"React agents","local":"transformers.ReactAgent","sections":[],"depth":3}],"depth":2},{"title":"Tools","local":"tools","sections":[{"title":"load_tool","local":"transformers.load_tool","sections":[],"depth":3},{"title":"Tool","local":"transformers.Tool","sections":[],"depth":3},{"title":"Toolbox","local":"transformers.Toolbox","sections":[],"depth":3},{"title":"PipelineTool","local":"transformers.PipelineTool","sections":[],"depth":3},{"title":"launch_gradio_demo","local":"transformers.launch_gradio_demo","sections":[],"depth":3},{"title":"ToolCollection","local":"transformers.ToolCollection","sections":[],"depth":3}],"depth":2},{"title":"Engines","local":"engines","sections":[{"title":"HfEngine","local":"transformers.HfEngine","sections":[],"depth":3}],"depth":2},{"title":"Agent Types","local":"agent-types","sections":[{"title":"AgentText","local":"transformers.agents.agent_types.AgentText","sections":[],"depth":3},{"title":"AgentImage","local":"transformers.agents.agent_types.AgentImage","sections":[],"depth":3},{"title":"AgentAudio","local":"transformers.agents.agent_types.AgentAudio","sections":[],"depth":3}],"depth":2}],"depth":1}';function Ll(j){return fl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dl extends bl{constructor(f){super(),vl(this,f,Ll,Al,ul,{})}}export{Dl as component};
