import{s as fa,o as ha,n as R}from"../chunks/scheduler.00b97157.js";import{S as $a,i as ba,e as i,s,c as p,h as va,a as m,d as t,b as a,f as w,g,j as v,k as y,l as n,m as c,n as d,t as u,o as f,p as h}from"../chunks/index.a7c1a7a1.js";import{T as ys,D as C,E as Wt}from"../chunks/ExampleCodeBlock.bc6422ee.js";import{C as Ta,H as k,E as _a}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.4b5f77d2.js";import{C as Vt}from"../chunks/CodeBlock.7a3aa7b0.js";function ya(I){let r,_="Smolagents 是一个实验性 API，可能会随时更改。由于 API 或底层模型可能发生变化，代理返回的结果可能会有所不同。";return{c(){r=i("p"),r.textContent=_},l($){r=m($,"P",{"data-svelte-h":!0}),v(r)!=="svelte-1vupjwt"&&(r.textContent=_)},m($,b){c($,r,b)},p:R,d($){$&&t(r)}}}function wa(I){let r,_=`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(){r=i("p"),r.textContent=_},l($){r=m($,"P",{"data-svelte-h":!0}),v(r)!=="svelte-1kcherd"&&(r.textContent=_)},m($,b){c($,r,b)},p:R,d($){$&&t(r)}}}function xa(I){let r,_=`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(){r=i("p"),r.textContent=_},l($){r=m($,"P",{"data-svelte-h":!0}),v(r)!=="svelte-fpk7e5"&&(r.textContent=_)},m($,b){c($,r,b)},p:R,d($){$&&t(r)}}}function Ma(I){let r,_="Examples:",$,b,T;return b=new Vt({props:{code:"aW1hZ2VfZ2VuZXJhdG9yJTIwJTNEJTIwVG9vbC5mcm9tX3NwYWNlKCUwQSUyMCUyMCUyMCUyMHNwYWNlX2lkJTNEJTIyYmxhY2stZm9yZXN0LWxhYnMlMkZGTFVYLjEtc2NobmVsbCUyMiUyQyUwQSUyMCUyMCUyMCUyMG5hbWUlM0QlMjJpbWFnZS1nZW5lcmF0b3IlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXNjcmlwdGlvbiUzRCUyMkdlbmVyYXRlJTIwYW4lMjBpbWFnZSUyMGZyb20lMjBhJTIwcHJvbXB0JTIyJTBBKSUwQWltYWdlJTIwJTNEJTIwaW1hZ2VfZ2VuZXJhdG9yKCUyMkdlbmVyYXRlJTIwYW4lMjBpbWFnZSUyMG9mJTIwYSUyMGNvb2wlMjBzdXJmZXIlMjBpbiUyMFRhaGl0aSUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>image_generator = Tool.from_space(
<span class="hljs-meta">... </span>    space_id=<span class="hljs-string">&quot;black-forest-labs/FLUX.1-schnell&quot;</span>,
<span class="hljs-meta">... </span>    name=<span class="hljs-string">&quot;image-generator&quot;</span>,
<span class="hljs-meta">... </span>    description=<span class="hljs-string">&quot;Generate an image from a prompt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = image_generator(<span class="hljs-string">&quot;Generate an image of a cool surfer in Tahiti&quot;</span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-kvfsh7"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function Ca(I){let r,_;return r=new Vt({props:{code:"ZmFjZV9zd2FwcGVyJTIwJTNEJTIwVG9vbC5mcm9tX3NwYWNlKCUwQSUyMCUyMCUyMCUyMCUyMnR1YW4yMzA4JTJGZmFjZS1zd2FwJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyZmFjZV9zd2FwcGVyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyVG9vbCUyMHRoYXQlMjBwdXRzJTIwdGhlJTIwZmFjZSUyMHNob3duJTIwb24lMjB0aGUlMjBmaXJzdCUyMGltYWdlJTIwb24lMjB0aGUlMjBzZWNvbmQlMjBpbWFnZS4lMjBZb3UlMjBjYW4lMjBnaXZlJTIwaXQlMjBwYXRocyUyMHRvJTIwaW1hZ2VzLiUyMiUyQyUwQSklMEFpbWFnZSUyMCUzRCUyMGZhY2Vfc3dhcHBlcignLiUyRmF5bWVyaWMuanBlZyclMkMlMjAnLiUyRnJ1dGguanBnJyk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>face_swapper = Tool.from_space(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;tuan2308/face-swap&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;face_swapper&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Tool that puts the face shown on the first image on the second image. You can give it paths to images.&quot;</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = face_swapper(<span class="hljs-string">&#x27;./aymeric.jpeg&#x27;</span>, <span class="hljs-string">&#x27;./ruth.jpg&#x27;</span>)`,wrap:!1}}),{c(){p(r.$$.fragment)},l($){g(r.$$.fragment,$)},m($,b){d(r,$,b),_=!0},p:R,i($){_||(u(r.$$.fragment,$),_=!0)},o($){f(r.$$.fragment,$),_=!1},d($){h(r,$)}}}function ja(I){let r,_="Examples:",$,b,T;return b=new Vt({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBEdWNrRHVja0dvU2VhcmNoVG9vbCUwQXdlYl9zZWFyY2hfdG9vbCUyMCUzRCUyMER1Y2tEdWNrR29TZWFyY2hUb29sKG1heF9yZXN1bHRzJTNENSUyQyUyMHJhdGVfbGltaXQlM0QyLjApJTBBcmVzdWx0cyUyMCUzRCUyMHdlYl9zZWFyY2hfdG9vbCglMjJIdWdnaW5nJTIwRmFjZSUyMiklMEFwcmludChyZXN1bHRzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> DuckDuckGoSearchTool
<span class="hljs-meta">&gt;&gt;&gt; </span>web_search_tool = DuckDuckGoSearchTool(max_results=<span class="hljs-number">5</span>, rate_limit=<span class="hljs-number">2.0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>results = web_search_tool(<span class="hljs-string">&quot;Hugging Face&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(results)`,wrap:!1}}),{c(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-kvfsh7"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function Ia(I){let r,_="Example:",$,b,T;return b=new Vt({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sQ29sbGVjdGlvbiUyQyUyMENvZGVBZ2VudCUwQSUwQWltYWdlX3Rvb2xfY29sbGVjdGlvbiUyMCUzRCUyMFRvb2xDb2xsZWN0aW9uLmZyb21faHViKCUyMmh1Z2dpbmdmYWNlLXRvb2xzJTJGZGlmZnVzaW9uLXRvb2xzLTY2MzBiYjE5YTk0MmMyMzA2YTJjZGI2ZiUyMiklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QippbWFnZV90b29sX2NvbGxlY3Rpb24udG9vbHMlNUQlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUyMlBsZWFzZSUyMGRyYXclMjBtZSUyMGElMjBwaWN0dXJlJTIwb2YlMjByaXZlcnMlMjBhbmQlMjBsYWtlcy4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> ToolCollection, CodeAgent

<span class="hljs-meta">&gt;&gt;&gt; </span>image_tool_collection = ToolCollection.from_hub(<span class="hljs-string">&quot;huggingface-tools/diffusion-tools-6630bb19a942c2306a2cdb6f&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent = CodeAgent(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(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-11lpom8"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function Ja(I){let r,_="Example with a Stdio MCP server:",$,b,T;return b=new Vt({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMFRvb2xDb2xsZWN0aW9uJTJDJTIwQ29kZUFnZW50JTJDJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwlMEFmcm9tJTIwbWNwJTIwaW1wb3J0JTIwU3RkaW9TZXJ2ZXJQYXJhbWV0ZXJzJTBBJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBJTBBc2VydmVyX3BhcmFtZXRlcnMlMjAlM0QlMjBTdGRpb1NlcnZlclBhcmFtZXRlcnMoJTBBJTIwJTIwJTIwJTIwY29tbWFuZCUzRCUyMnV2eCUyMiUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0QlNUIlMjItLXF1aWV0JTIyJTJDJTIwJTIycHVibWVkbWNwJTQwMC4xLjMlMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBlbnYlM0QlN0IlMjJVVl9QWVRIT04lMjIlM0ElMjAlMjIzLjEyJTIyJTJDJTIwKipvcy5lbnZpcm9uJTdEJTJDJTBBKSUwQSUwQXdpdGglMjBUb29sQ29sbGVjdGlvbi5mcm9tX21jcChzZXJ2ZXJfcGFyYW1ldGVycyUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMjBhcyUyMHRvb2xfY29sbGVjdGlvbiUzQSUwQSUyMCUyMCUyMCUyMGFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCKnRvb2xfY29sbGVjdGlvbi50b29scyU1RCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBJTIwJTIwJTIwJTIwYWdlbnQucnVuKCUyMlBsZWFzZSUyMGZpbmQlMjBhJTIwcmVtZWR5JTIwZm9yJTIwaGFuZ292ZXIuJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> os
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> ToolCollection, CodeAgent, InferenceClientModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> mcp <span class="hljs-keyword">import</span> StdioServerParameters

<span class="hljs-meta">&gt;&gt;&gt; </span>model = InferenceClientModel()

<span class="hljs-meta">&gt;&gt;&gt; </span>server_parameters = StdioServerParameters(
<span class="hljs-meta">&gt;&gt;&gt; </span>    command=<span class="hljs-string">&quot;uvx&quot;</span>,
<span class="hljs-meta">&gt;&gt;&gt; </span>    args=[<span class="hljs-string">&quot;--quiet&quot;</span>, <span class="hljs-string">&quot;pubmedmcp@0.1.3&quot;</span>],
<span class="hljs-meta">&gt;&gt;&gt; </span>    env={<span class="hljs-string">&quot;UV_PYTHON&quot;</span>: <span class="hljs-string">&quot;3.12&quot;</span>, **os.environ},
<span class="hljs-meta">&gt;&gt;&gt; </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> ToolCollection.from_mcp(server_parameters, trust_remote_code=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> tool_collection:
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=<span class="hljs-literal">True</span>, model=model)
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent.run(<span class="hljs-string">&quot;Please find a remedy for hangover.&quot;</span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-49dhgx"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function ka(I){let r,_="Example with structured output enabled:",$,b,T;return b=new Vt({props:{code:"d2l0aCUyMFRvb2xDb2xsZWN0aW9uLmZyb21fbWNwKHNlcnZlcl9wYXJhbWV0ZXJzJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlJTJDJTIwc3RydWN0dXJlZF9vdXRwdXQlM0RUcnVlKSUyMGFzJTIwdG9vbF9jb2xsZWN0aW9uJTNBJTBBJTIwJTIwJTIwJTIwYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIqdG9vbF9jb2xsZWN0aW9uLnRvb2xzJTVEJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlJTJDJTIwbW9kZWwlM0Rtb2RlbCklMEElMjAlMjAlMjAlMjBhZ2VudC5ydW4oJTIyUGxlYXNlJTIwZmluZCUyMGElMjByZW1lZHklMjBmb3IlMjBoYW5nb3Zlci4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> ToolCollection.from_mcp(server_parameters, trust_remote_code=<span class="hljs-literal">True</span>, structured_output=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> tool_collection:
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=<span class="hljs-literal">True</span>, model=model)
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent.run(<span class="hljs-string">&quot;Please find a remedy for hangover.&quot;</span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-ghl0yb"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function Ua(I){let r,_="Example with a Streamable HTTP MCP server:",$,b,T;return b=new Vt({props:{code:"d2l0aCUyMFRvb2xDb2xsZWN0aW9uLmZyb21fbWNwKCU3QiUyMnVybCUyMiUzQSUyMCUyMmh0dHAlM0ElMkYlMkYxMjcuMC4wLjElM0E4MDAwJTJGbWNwJTIyJTJDJTIwJTIydHJhbnNwb3J0JTIyJTNBJTIwJTIyc3RyZWFtYWJsZS1odHRwJTIyJTdEJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUyMGFzJTIwdG9vbF9jb2xsZWN0aW9uJTNBJTBBJTIwJTIwJTIwJTIwYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIqdG9vbF9jb2xsZWN0aW9uLnRvb2xzJTVEJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlJTJDJTIwbW9kZWwlM0Rtb2RlbCklMEElMjAlMjAlMjAlMjBhZ2VudC5ydW4oJTIyUGxlYXNlJTIwZmluZCUyMGElMjByZW1lZHklMjBmb3IlMjBoYW5nb3Zlci4lMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> ToolCollection.from_mcp({<span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;http://127.0.0.1:8000/mcp&quot;</span>, <span class="hljs-string">&quot;transport&quot;</span>: <span class="hljs-string">&quot;streamable-http&quot;</span>}, trust_remote_code=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> tool_collection:
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent = CodeAgent(tools=[*tool_collection.tools], add_base_tools=<span class="hljs-literal">True</span>, model=model)
<span class="hljs-meta">&gt;&gt;&gt; </span>    agent.run(<span class="hljs-string">&quot;Please find a remedy for hangover.&quot;</span>)`,wrap:!1}}),{c(){r=i("p"),r.textContent=_,$=s(),p(b.$$.fragment)},l(l){r=m(l,"P",{"data-svelte-h":!0}),v(r)!=="svelte-178fndi"&&(r.textContent=_),$=a(l),g(b.$$.fragment,l)},m(l,x){c(l,r,x),c(l,$,x),d(b,l,x),T=!0},p:R,i(l){T||(u(b.$$.fragment,l),T=!0)},o(l){f(b.$$.fragment,l),T=!1},d(l){l&&(t(r),t($)),h(b,l)}}}function Za(I){let r,_,$,b,T,l,x,bo,K,vo,Te,ws='要了解更多关于智能体和工具的信息，请务必阅读<a href="../index">入门指南</a>。本页面包含底层类的 API 文档。',To,_e,_o,ye,yo,G,we,hn,Dt,xs="Main function to quickly load a tool from the Hub.",$n,O,wo,xe,xo,F,Me,bn,Lt,Ms="Convert a function into an instance of a dynamically created Tool subclass.",Mo,Ce,Co,M,je,vn,St,Cs=`A base class for the functions used by the agent. Subclass this and implement the <code>forward</code> method as well as the
following class attributes:`,Tn,Gt,js=`<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, bool]]]</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> <li><strong>output_schema</strong> (<code>Dict[str, Any]</code>, <em>optional</em>) — The JSON schema defining the expected structure of the tool output.
This can be included in system prompts to help agents understand the expected output format. Note: This is currently
used for informational purposes only and does not perform actual output validation.</li>`,_n,At,Is=`You can also override the method <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool.setup">setup()</a> if your tool has an expensive operation to perform before being
usable (such as loading a model). <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool.setup">setup()</a> will be called the first time you use your tool, but not at
instantiation.`,yn,ee,Ie,wn,Pt,Js="Create tool from a dictionary representation.",xn,te,Je,Mn,Nt,ks='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a gradio tool.',Cn,N,ke,jn,Ht,Us="Loads a tool defined on the Hub.",In,oe,Jn,ne,Ue,kn,Bt,Zs='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a langchain tool.',Un,S,Ze,Zn,Et,Ws='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a Space given its id on the Hub.',Wn,se,Vn,ae,Dn,le,We,Ln,Rt,Vs="Upload the tool to the Hub.",Sn,H,Ve,Gn,Ft,Ds=`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:`,An,qt,Ls=`<li>a <code>{tool_file_name}.py</code> file containing the logic for your tool.
If you pass <code>make_gradio_app=True</code>, this will also write:</li> <li>an <code>app.py</code> file providing a UI for your tool when it is exported to a Space with <code>tool.push_to_hub()</code></li> <li>a <code>requirements.txt</code> containing the names of the modules used by your tool (as detected when inspecting its
code)</li>`,Pn,re,De,Nn,zt,Ss=`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.`,Hn,ie,Le,Bn,Qt,Gs="Returns a dictionary representing the tool",jo,Se,Io,q,Ge,En,Yt,As=`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>.`,Jo,Ae,ko,Pe,Uo,Ne,He,Zo,Be,Wo,Ee,Re,Vo,Fe,Do,qe,ze,Lo,Qe,So,A,Ye,Rn,Xt,Ps="Web search tool that performs searches using the DuckDuckGo search engine.",Fn,me,Go,Xe,Ao,Ke,Oe,Po,et,No,tt,ot,Ho,nt,Bo,st,at,Eo,lt,Ro,J,rt,qn,Kt,Ns="Tool collections enable loading a collection of tools in the agent’s toolbox.",zn,Ot,Hs="Collections can be loaded from a collection in the Hub or from an MCP server, see:",Qn,eo,Bs='<li><a href="/docs/smolagents/main/zh/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a></li> <li><a href="/docs/smolagents/main/zh/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a></li>',Yn,to,Es='For example and usage, see: <a href="/docs/smolagents/main/zh/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a> and <a href="/docs/smolagents/main/zh/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a>',Xn,W,it,Kn,oo,Rs="Loads a tool collection from the Hub.",On,no,Fs="it adds a collection of tools from all Spaces in the collection to the agent’s toolbox",es,mt,qs=`<p>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>`,ts,ce,os,U,ct,ns,so,zs="Automatically load a tool collection from an MCP server.",ss,ao,Qs=`This method supports Stdio, Streamable HTTP, and legacy HTTP+SSE MCP servers. Look at the <code>server_parameters</code>
argument for more details on how to connect to each MCP server.`,as,lo,Ys=`Note: a separate thread will be spawned to run an asyncio event loop handling
the MCP server.`,ls,pe,rs,ge,is,de,Fo,pt,qo,gt,Xs="智能体可以处理工具之间的任何类型的对象；工具是完全多模态的，可以接受和返回文本、图像、音频、视频以及其他类型的对象。为了增加工具之间的兼容性，以及正确呈现在 ipython（jupyter、colab、ipython notebooks 等）中的返回结果，我们为这些类型实现了包装类。",zo,dt,Ks="被包装的对象应该继续保持其初始行为；例如，一个文本对象应继续表现为字符串，一个图像对象应继续表现为 <code>PIL.Image</code>。",Qo,ut,Os="这些类型有三个特定的用途：",Yo,ft,ea="<li>调用 <code>to_raw</code> 方法时，应返回底层对象</li> <li>调用 <code>to_string</code> 方法时，应将对象转换为字符串：对于 <code>AgentText</code> 类型，可以直接返回字符串；对于其他实例，则返回对象序列化版本的路径</li> <li>在 ipython 内核中显示时，应正确显示对象</li>",Xo,ht,Ko,z,$t,ms,ro,ta="Text type returned by the agent. Behaves as a string.",Oo,bt,en,Z,vt,cs,io,oa="Image type returned by the agent. Behaves as a PIL.Image.Image.",ps,ue,Tt,gs,mo,na="Saves the image to a file.",ds,fe,_t,us,co,sa="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.Image.",fs,he,yt,hs,po,aa=`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`,tn,wt,on,L,xt,$s,go,la="Audio type returned by the agent.",bs,$e,Mt,vs,uo,ra="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",Ts,be,Ct,_s,fo,ia=`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`,nn,jt,sn,$o,an;return T=new Ta({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),x=new k({props:{title:"工具",local:"工具",headingTag:"h1"}}),K=new ys({props:{warning:!0,$$slots:{default:[ya]},$$scope:{ctx:I}}}),_e=new k({props:{title:"工具",local:"工具",headingTag:"h2"}}),ye=new k({props:{title:"load_tool",local:"smolagents.load_tool",headingTag:"h3"}}),we=new C({props:{name:"smolagents.load_tool",anchor:"smolagents.load_tool",parameters:[{name:"repo_id",val:""},{name:"model_repo_id",val:": str | None = None"},{name:"token",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.load_tool.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
Space repo ID of a tool on the Hub.`,name:"repo_id"},{anchor:"smolagents.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:"smolagents.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:"smolagents.load_tool.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool</code>, <em>optional</em>, defaults to False) &#x2014;
This needs to be accepted in order to load a tool from Hub.`,name:"trust_remote_code"},{anchor:"smolagents.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/smolagents/blob/main/src/smolagents/tools.py#L840"}}),O=new ys({props:{warning:!0,$$slots:{default:[wa]},$$scope:{ctx:I}}}),xe=new k({props:{title:"tool",local:"smolagents.tool",headingTag:"h3"}}),Me=new C({props:{name:"smolagents.tool",anchor:"smolagents.tool",parameters:[{name:"tool_function",val:": Callable"}],parametersDescription:[{anchor:"smolagents.tool.tool_function",description:`<strong>tool_function</strong> (<code>Callable</code>) &#x2014; Function to convert into a Tool subclass.
Should have type hints for each input and a type hint for the output.
Should also have a docstring including the description of the function
and an &#x2018;Args:&#x2019; part where each argument is described.`,name:"tool_function"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L1061"}}),Ce=new k({props:{title:"Tool",local:"smolagents.Tool",headingTag:"h3"}}),je=new C({props:{name:"class smolagents.Tool",anchor:"smolagents.Tool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L106"}}),Ie=new C({props:{name:"from_dict",anchor:"smolagents.Tool.from_dict",parameters:[{name:"tool_dict",val:": dict[str, Any]"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Tool.from_dict.tool_dict",description:"<strong>tool_dict</strong> (<code>dict[str, Any]</code>) &#x2014; Dictionary representation of the tool.",name:"tool_dict"},{anchor:"smolagents.Tool.from_dict.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments to pass to the tool&#x2019;s constructor.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L367",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Tool object.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>Tool</code></p>
`}}),Je=new C({props:{name:"from_gradio",anchor:"smolagents.Tool.from_gradio",parameters:[{name:"gradio_tool",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L741"}}),ke=new C({props:{name:"from_hub",anchor:"smolagents.Tool.from_hub",parameters:[{name:"repo_id",val:": str"},{name:"token",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Tool.from_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the Space repo on the Hub where your tool is defined.`,name:"repo_id"},{anchor:"smolagents.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:"smolagents.Tool.from_hub.trust_remote_code(str,",description:`<strong>trust_remote_code(<code>str</code>,</strong> <em>optional</em>, defaults to False) &#x2014;
This flags marks that you understand the risk of running remote code and that you trust this tool.
If not setting this to True, loading the tool from Hub will fail.`,name:"trust_remote_code(str,"},{anchor:"smolagents.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/smolagents/blob/main/src/smolagents/tools.py#L516"}}),oe=new ys({props:{warning:!0,$$slots:{default:[xa]},$$scope:{ctx:I}}}),Ue=new C({props:{name:"from_langchain",anchor:"smolagents.Tool.from_langchain",parameters:[{name:"langchain_tool",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L762"}}),Ze=new C({props:{name:"from_space",anchor:"smolagents.Tool.from_space",parameters:[{name:"space_id",val:": str"},{name:"name",val:": str"},{name:"description",val:": str"},{name:"api_name",val:": str | None = None"},{name:"token",val:": str | None = None"}],parametersDescription:[{anchor:"smolagents.Tool.from_space.space_id",description:`<strong>space_id</strong> (<code>str</code>) &#x2014;
The id of the Space on the Hub.`,name:"space_id"},{anchor:"smolagents.Tool.from_space.name",description:`<strong>name</strong> (<code>str</code>) &#x2014;
The name of the tool.`,name:"name"},{anchor:"smolagents.Tool.from_space.description",description:`<strong>description</strong> (<code>str</code>) &#x2014;
The description of the tool.`,name:"description"},{anchor:"smolagents.Tool.from_space.api_name",description:`<strong>api_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The specific api_name to use, if the space has several tabs. If not precised, will default to the first available api.`,name:"api_name"},{anchor:"smolagents.Tool.from_space.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Add your token to access private spaces or increase your GPU quotas.`,name:"token"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L599",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The Space, as a tool.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a></p>
`}}),se=new Wt({props:{anchor:"smolagents.Tool.from_space.example",$$slots:{default:[Ma]},$$scope:{ctx:I}}}),ae=new Wt({props:{anchor:"smolagents.Tool.from_space.example-2",$$slots:{default:[Ca]},$$scope:{ctx:I}}}),We=new C({props:{name:"push_to_hub",anchor:"smolagents.Tool.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": str = 'Upload tool'"},{name:"private",val:": bool | None = None"},{name:"token",val:": bool | str | None = None"},{name:"create_pr",val:": bool = False"}],parametersDescription:[{anchor:"smolagents.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:"smolagents.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:"smolagents.Tool.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to make the repo private. If <code>None</code> (default), the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"smolagents.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:"smolagents.Tool.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L421"}}),Ve=new C({props:{name:"save",anchor:"smolagents.Tool.save",parameters:[{name:"output_dir",val:": str | Path"},{name:"tool_file_name",val:": str = 'tool'"},{name:"make_gradio_app",val:": bool = True"}],parametersDescription:[{anchor:"smolagents.Tool.save.output_dir",description:"<strong>output_dir</strong> (<code>str</code> or <code>Path</code>) &#x2014; The folder in which you want to save your tool.",name:"output_dir"},{anchor:"smolagents.Tool.save.tool_file_name",description:"<strong>tool_file_name</strong> (<code>str</code>, <em>optional</em>) &#x2014; The file name in which you want to save your tool.",name:"tool_file_name"},{anchor:"smolagents.Tool.save.make_gradio_app",description:"<strong>make_gradio_app</strong> (<code>bool</code>, <em>optional</em>, defaults to True) &#x2014; Whether to also export a <code>requirements.txt</code> file and Gradio UI.",name:"make_gradio_app"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L390"}}),De=new C({props:{name:"setup",anchor:"smolagents.Tool.setup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L251"}}),Le=new C({props:{name:"to_dict",anchor:"smolagents.Tool.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L292"}}),Se=new k({props:{title:"launch_gradio_demo",local:"smolagents.launch_gradio_demo",headingTag:"h3"}}),Ge=new C({props:{name:"smolagents.launch_gradio_demo",anchor:"smolagents.launch_gradio_demo",parameters:[{name:"tool",val:": Tool"}],parametersDescription:[{anchor:"smolagents.launch_gradio_demo.tool",description:"<strong>tool</strong> (<code>Tool</code>) &#x2014; The tool for which to launch the demo.",name:"tool"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L794"}}),Ae=new k({props:{title:"默认工具",local:"默认工具",headingTag:"h2"}}),Pe=new k({props:{title:"PythonInterpreterTool",local:"smolagents.PythonInterpreterTool",headingTag:"h3"}}),He=new C({props:{name:"class smolagents.PythonInterpreterTool",anchor:"smolagents.PythonInterpreterTool",parameters:[{name:"*args",val:""},{name:"authorized_imports",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L38"}}),Be=new k({props:{title:"FinalAnswerTool",local:"smolagents.FinalAnswerTool",headingTag:"h3"}}),Re=new C({props:{name:"class smolagents.FinalAnswerTool",anchor:"smolagents.FinalAnswerTool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L80"}}),Fe=new k({props:{title:"UserInputTool",local:"smolagents.UserInputTool",headingTag:"h3"}}),ze=new C({props:{name:"class smolagents.UserInputTool",anchor:"smolagents.UserInputTool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L90"}}),Qe=new k({props:{title:"DuckDuckGoSearchTool",local:"smolagents.DuckDuckGoSearchTool",headingTag:"h3"}}),Ye=new C({props:{name:"class smolagents.DuckDuckGoSearchTool",anchor:"smolagents.DuckDuckGoSearchTool",parameters:[{name:"max_results",val:": int = 10"},{name:"rate_limit",val:": float | None = 1.0"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.DuckDuckGoSearchTool.max_results",description:"<strong>max_results</strong> (<code>int</code>, default <code>10</code>) &#x2014; Maximum number of search results to return.",name:"max_results"},{anchor:"smolagents.DuckDuckGoSearchTool.rate_limit",description:"<strong>rate_limit</strong> (<code>float</code>, default <code>1.0</code>) &#x2014; Maximum queries per second. Set to <code>None</code> to disable rate limiting.",name:"rate_limit"},{anchor:"smolagents.DuckDuckGoSearchTool.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments for the <code>DDGS</code> client.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L101"}}),me=new Wt({props:{anchor:"smolagents.DuckDuckGoSearchTool.example",$$slots:{default:[ja]},$$scope:{ctx:I}}}),Xe=new k({props:{title:"GoogleSearchTool",local:"smolagents.GoogleSearchTool",headingTag:"h3"}}),Oe=new C({props:{name:"class smolagents.GoogleSearchTool",anchor:"smolagents.GoogleSearchTool",parameters:[{name:"provider",val:": str = 'serpapi'"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L159"}}),et=new k({props:{title:"VisitWebpageTool",local:"smolagents.VisitWebpageTool",headingTag:"h3"}}),ot=new C({props:{name:"class smolagents.VisitWebpageTool",anchor:"smolagents.VisitWebpageTool",parameters:[{name:"max_output_length",val:": int = 40000"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L451"}}),nt=new k({props:{title:"SpeechToTextTool",local:"smolagents.SpeechToTextTool",headingTag:"h3"}}),at=new C({props:{name:"class smolagents.SpeechToTextTool",anchor:"smolagents.SpeechToTextTool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/default_tools.py#L606"}}),lt=new k({props:{title:"工具集合",local:"smolagents.ToolCollection",headingTag:"h2"}}),rt=new C({props:{name:"class smolagents.ToolCollection",anchor:"smolagents.ToolCollection",parameters:[{name:"tools",val:": list[Tool]"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L895"}}),it=new C({props:{name:"from_hub",anchor:"smolagents.ToolCollection.from_hub",parameters:[{name:"collection_slug",val:": str"},{name:"token",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"}],parametersDescription:[{anchor:"smolagents.ToolCollection.from_hub.collection_slug",description:"<strong>collection_slug</strong> (str) &#x2014; The collection slug referencing the collection.",name:"collection_slug"},{anchor:"smolagents.ToolCollection.from_hub.token",description:"<strong>token</strong> (str, <em>optional</em>) &#x2014; The authentication token if the collection is private.",name:"token"},{anchor:"smolagents.ToolCollection.from_hub.trust_remote_code",description:"<strong>trust_remote_code</strong> (bool, <em>optional</em>, defaults to False) &#x2014; Whether to trust the remote code.",name:"trust_remote_code"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L909",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A tool collection instance loaded with the tools.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>ToolCollection</p>
`}}),ce=new Wt({props:{anchor:"smolagents.ToolCollection.from_hub.example",$$slots:{default:[Ia]},$$scope:{ctx:I}}}),ct=new C({props:{name:"from_mcp",anchor:"smolagents.ToolCollection.from_mcp",parameters:[{name:"server_parameters",val:": 'mcp.StdioServerParameters' | dict"},{name:"trust_remote_code",val:": bool = False"},{name:"structured_output",val:": bool | None = None"}],parametersDescription:[{anchor:"smolagents.ToolCollection.from_mcp.server_parameters",description:`<strong>server_parameters</strong> (<code>mcp.StdioServerParameters</code> or <code>dict</code>) &#x2014;
Configuration parameters to connect to the MCP server. This can be:</p>
<ul>
<li>
<p>An instance of <code>mcp.StdioServerParameters</code> for connecting a Stdio MCP server via standard input/output using a subprocess.</p>
</li>
<li>
<p>A <code>dict</code> with at least:</p>
<ul>
<li>&#x201C;url&#x201D;: URL of the server.</li>
<li>&#x201C;transport&#x201D;: Transport protocol to use, one of:
<ul>
<li>&#x201C;streamable-http&#x201D;: Streamable HTTP transport (default).</li>
<li>&#x201C;sse&#x201D;: Legacy HTTP+SSE transport (deprecated).</li>
</ul>
</li>
</ul>
</li>
</ul>`,name:"server_parameters"},{anchor:"smolagents.ToolCollection.from_mcp.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to trust the execution of code from tools defined on the MCP server.
This option should only be set to <code>True</code> if you trust the MCP server,
and undertand the risks associated with running remote code on your local machine.
If set to <code>False</code>, loading tools from MCP will fail.`,name:"trust_remote_code"},{anchor:"smolagents.ToolCollection.from_mcp.structured_output",description:`<strong>structured_output</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to enable structured output features for MCP tools. If True, enables:</p>
<ul>
<li>Support for outputSchema in MCP tools</li>
<li>Structured content handling (structuredContent from MCP responses)</li>
<li>JSON parsing fallback for structured data
If False, uses the original simple text-only behavior for backwards compatibility.</li>
</ul>`,name:"structured_output"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L949",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A tool collection instance.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>ToolCollection</p>
`}}),pe=new Wt({props:{anchor:"smolagents.ToolCollection.from_mcp.example",$$slots:{default:[Ja]},$$scope:{ctx:I}}}),ge=new Wt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-2",$$slots:{default:[ka]},$$scope:{ctx:I}}}),de=new Wt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-3",$$slots:{default:[Ua]},$$scope:{ctx:I}}}),pt=new k({props:{title:"智能体类型",local:"智能体类型",headingTag:"h2"}}),ht=new k({props:{title:"AgentText",local:"smolagents.AgentText",headingTag:"h3"}}),$t=new C({props:{name:"class smolagents.AgentText",anchor:"smolagents.AgentText",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L62"}}),bt=new k({props:{title:"AgentImage",local:"smolagents.AgentImage",headingTag:"h3"}}),vt=new C({props:{name:"class smolagents.AgentImage",anchor:"smolagents.AgentImage",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L74"}}),Tt=new C({props:{name:"save",anchor:"smolagents.AgentImage.save",parameters:[{name:"output_bytes",val:""},{name:"format",val:": str = None"},{name:"**params",val:""}],parametersDescription:[{anchor:"smolagents.AgentImage.save.output_bytes",description:"<strong>output_bytes</strong> (bytes) &#x2014; The output bytes to save the image to.",name:"output_bytes"},{anchor:"smolagents.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.",name:"format"},{anchor:"smolagents.AgentImage.save.*params",description:"*<strong>*params</strong> &#x2014; Additional parameters to pass to PIL.Image.save.",name:"*params"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L164"}}),_t=new C({props:{name:"to_raw",anchor:"smolagents.AgentImage.to_raw",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L119"}}),yt=new C({props:{name:"to_string",anchor:"smolagents.AgentImage.to_string",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L136"}}),wt=new k({props:{title:"AgentAudio",local:"smolagents.AgentAudio",headingTag:"h3"}}),xt=new C({props:{name:"class smolagents.AgentAudio",anchor:"smolagents.AgentAudio",parameters:[{name:"value",val:""},{name:"samplerate",val:" = 16000"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L176"}}),Mt=new C({props:{name:"to_raw",anchor:"smolagents.AgentAudio.to_raw",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L216"}}),Ct=new C({props:{name:"to_string",anchor:"smolagents.AgentAudio.to_string",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agent_types.py#L237"}}),jt=new _a({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/zh/reference/tools.md"}}),{c(){r=i("meta"),_=s(),$=i("p"),b=s(),p(T.$$.fragment),l=s(),p(x.$$.fragment),bo=s(),p(K.$$.fragment),vo=s(),Te=i("p"),Te.innerHTML=ws,To=s(),p(_e.$$.fragment),_o=s(),p(ye.$$.fragment),yo=s(),G=i("div"),p(we.$$.fragment),hn=s(),Dt=i("p"),Dt.textContent=xs,$n=s(),p(O.$$.fragment),wo=s(),p(xe.$$.fragment),xo=s(),F=i("div"),p(Me.$$.fragment),bn=s(),Lt=i("p"),Lt.textContent=Ms,Mo=s(),p(Ce.$$.fragment),Co=s(),M=i("div"),p(je.$$.fragment),vn=s(),St=i("p"),St.innerHTML=Cs,Tn=s(),Gt=i("ul"),Gt.innerHTML=js,_n=s(),At=i("p"),At.innerHTML=Is,yn=s(),ee=i("div"),p(Ie.$$.fragment),wn=s(),Pt=i("p"),Pt.textContent=Js,xn=s(),te=i("div"),p(Je.$$.fragment),Mn=s(),Nt=i("p"),Nt.innerHTML=ks,Cn=s(),N=i("div"),p(ke.$$.fragment),jn=s(),Ht=i("p"),Ht.textContent=Us,In=s(),p(oe.$$.fragment),Jn=s(),ne=i("div"),p(Ue.$$.fragment),kn=s(),Bt=i("p"),Bt.innerHTML=Zs,Un=s(),S=i("div"),p(Ze.$$.fragment),Zn=s(),Et=i("p"),Et.innerHTML=Ws,Wn=s(),p(se.$$.fragment),Vn=s(),p(ae.$$.fragment),Dn=s(),le=i("div"),p(We.$$.fragment),Ln=s(),Rt=i("p"),Rt.textContent=Vs,Sn=s(),H=i("div"),p(Ve.$$.fragment),Gn=s(),Ft=i("p"),Ft.innerHTML=Ds,An=s(),qt=i("ul"),qt.innerHTML=Ls,Pn=s(),re=i("div"),p(De.$$.fragment),Nn=s(),zt=i("p"),zt.textContent=Ss,Hn=s(),ie=i("div"),p(Le.$$.fragment),Bn=s(),Qt=i("p"),Qt.textContent=Gs,jo=s(),p(Se.$$.fragment),Io=s(),q=i("div"),p(Ge.$$.fragment),En=s(),Yt=i("p"),Yt.innerHTML=As,Jo=s(),p(Ae.$$.fragment),ko=s(),p(Pe.$$.fragment),Uo=s(),Ne=i("div"),p(He.$$.fragment),Zo=s(),p(Be.$$.fragment),Wo=s(),Ee=i("div"),p(Re.$$.fragment),Vo=s(),p(Fe.$$.fragment),Do=s(),qe=i("div"),p(ze.$$.fragment),Lo=s(),p(Qe.$$.fragment),So=s(),A=i("div"),p(Ye.$$.fragment),Rn=s(),Xt=i("p"),Xt.textContent=Ps,Fn=s(),p(me.$$.fragment),Go=s(),p(Xe.$$.fragment),Ao=s(),Ke=i("div"),p(Oe.$$.fragment),Po=s(),p(et.$$.fragment),No=s(),tt=i("div"),p(ot.$$.fragment),Ho=s(),p(nt.$$.fragment),Bo=s(),st=i("div"),p(at.$$.fragment),Eo=s(),p(lt.$$.fragment),Ro=s(),J=i("div"),p(rt.$$.fragment),qn=s(),Kt=i("p"),Kt.textContent=Ns,zn=s(),Ot=i("p"),Ot.textContent=Hs,Qn=s(),eo=i("ul"),eo.innerHTML=Bs,Yn=s(),to=i("p"),to.innerHTML=Es,Xn=s(),W=i("div"),p(it.$$.fragment),Kn=s(),oo=i("p"),oo.textContent=Rs,On=s(),no=i("p"),no.textContent=Fs,es=s(),mt=i("blockquote"),mt.innerHTML=qs,ts=s(),p(ce.$$.fragment),os=s(),U=i("div"),p(ct.$$.fragment),ns=s(),so=i("p"),so.textContent=zs,ss=s(),ao=i("p"),ao.innerHTML=Qs,as=s(),lo=i("p"),lo.textContent=Ys,ls=s(),p(pe.$$.fragment),rs=s(),p(ge.$$.fragment),is=s(),p(de.$$.fragment),Fo=s(),p(pt.$$.fragment),qo=s(),gt=i("p"),gt.textContent=Xs,zo=s(),dt=i("p"),dt.innerHTML=Ks,Qo=s(),ut=i("p"),ut.textContent=Os,Yo=s(),ft=i("ul"),ft.innerHTML=ea,Xo=s(),p(ht.$$.fragment),Ko=s(),z=i("div"),p($t.$$.fragment),ms=s(),ro=i("p"),ro.textContent=ta,Oo=s(),p(bt.$$.fragment),en=s(),Z=i("div"),p(vt.$$.fragment),cs=s(),io=i("p"),io.textContent=oa,ps=s(),ue=i("div"),p(Tt.$$.fragment),gs=s(),mo=i("p"),mo.textContent=na,ds=s(),fe=i("div"),p(_t.$$.fragment),us=s(),co=i("p"),co.textContent=sa,fs=s(),he=i("div"),p(yt.$$.fragment),hs=s(),po=i("p"),po.textContent=aa,tn=s(),p(wt.$$.fragment),on=s(),L=i("div"),p(xt.$$.fragment),$s=s(),go=i("p"),go.textContent=la,bs=s(),$e=i("div"),p(Mt.$$.fragment),vs=s(),uo=i("p"),uo.innerHTML=ra,Ts=s(),be=i("div"),p(Ct.$$.fragment),_s=s(),fo=i("p"),fo.textContent=ia,nn=s(),p(jt.$$.fragment),sn=s(),$o=i("p"),this.h()},l(e){const o=va("svelte-u9bgzb",document.head);r=m(o,"META",{name:!0,content:!0}),o.forEach(t),_=a(e),$=m(e,"P",{}),w($).forEach(t),b=a(e),g(T.$$.fragment,e),l=a(e),g(x.$$.fragment,e),bo=a(e),g(K.$$.fragment,e),vo=a(e),Te=m(e,"P",{"data-svelte-h":!0}),v(Te)!=="svelte-1i7e3m8"&&(Te.innerHTML=ws),To=a(e),g(_e.$$.fragment,e),_o=a(e),g(ye.$$.fragment,e),yo=a(e),G=m(e,"DIV",{class:!0});var Q=w(G);g(we.$$.fragment,Q),hn=a(Q),Dt=m(Q,"P",{"data-svelte-h":!0}),v(Dt)!=="svelte-fgf0mn"&&(Dt.textContent=xs),$n=a(Q),g(O.$$.fragment,Q),Q.forEach(t),wo=a(e),g(xe.$$.fragment,e),xo=a(e),F=m(e,"DIV",{class:!0});var It=w(F);g(Me.$$.fragment,It),bn=a(It),Lt=m(It,"P",{"data-svelte-h":!0}),v(Lt)!=="svelte-1yvj8b1"&&(Lt.textContent=Ms),It.forEach(t),Mo=a(e),g(Ce.$$.fragment,e),Co=a(e),M=m(e,"DIV",{class:!0});var j=w(M);g(je.$$.fragment,j),vn=a(j),St=m(j,"P",{"data-svelte-h":!0}),v(St)!=="svelte-1poxk5s"&&(St.innerHTML=Cs),Tn=a(j),Gt=m(j,"UL",{"data-svelte-h":!0}),v(Gt)!=="svelte-wwkyr"&&(Gt.innerHTML=js),_n=a(j),At=m(j,"P",{"data-svelte-h":!0}),v(At)!=="svelte-1uvxeq8"&&(At.innerHTML=Is),yn=a(j),ee=m(j,"DIV",{class:!0});var Jt=w(ee);g(Ie.$$.fragment,Jt),wn=a(Jt),Pt=m(Jt,"P",{"data-svelte-h":!0}),v(Pt)!=="svelte-2agex6"&&(Pt.textContent=Js),Jt.forEach(t),xn=a(j),te=m(j,"DIV",{class:!0});var kt=w(te);g(Je.$$.fragment,kt),Mn=a(kt),Nt=m(kt,"P",{"data-svelte-h":!0}),v(Nt)!=="svelte-1jj105h"&&(Nt.innerHTML=ks),kt.forEach(t),Cn=a(j),N=m(j,"DIV",{class:!0});var Y=w(N);g(ke.$$.fragment,Y),jn=a(Y),Ht=m(Y,"P",{"data-svelte-h":!0}),v(Ht)!=="svelte-yy7b2c"&&(Ht.textContent=Us),In=a(Y),g(oe.$$.fragment,Y),Y.forEach(t),Jn=a(j),ne=m(j,"DIV",{class:!0});var Ut=w(ne);g(Ue.$$.fragment,Ut),kn=a(Ut),Bt=m(Ut,"P",{"data-svelte-h":!0}),v(Bt)!=="svelte-12cdc7s"&&(Bt.innerHTML=Zs),Ut.forEach(t),Un=a(j),S=m(j,"DIV",{class:!0});var P=w(S);g(Ze.$$.fragment,P),Zn=a(P),Et=m(P,"P",{"data-svelte-h":!0}),v(Et)!=="svelte-1j4x04c"&&(Et.innerHTML=Ws),Wn=a(P),g(se.$$.fragment,P),Vn=a(P),g(ae.$$.fragment,P),P.forEach(t),Dn=a(j),le=m(j,"DIV",{class:!0});var Zt=w(le);g(We.$$.fragment,Zt),Ln=a(Zt),Rt=m(Zt,"P",{"data-svelte-h":!0}),v(Rt)!=="svelte-1u3gku9"&&(Rt.textContent=Vs),Zt.forEach(t),Sn=a(j),H=m(j,"DIV",{class:!0});var X=w(H);g(Ve.$$.fragment,X),Gn=a(X),Ft=m(X,"P",{"data-svelte-h":!0}),v(Ft)!=="svelte-19evuwa"&&(Ft.innerHTML=Ds),An=a(X),qt=m(X,"UL",{"data-svelte-h":!0}),v(qt)!=="svelte-1s62xm4"&&(qt.innerHTML=Ls),X.forEach(t),Pn=a(j),re=m(j,"DIV",{class:!0});var ln=w(re);g(De.$$.fragment,ln),Nn=a(ln),zt=m(ln,"P",{"data-svelte-h":!0}),v(zt)!=="svelte-63kthh"&&(zt.textContent=Ss),ln.forEach(t),Hn=a(j),ie=m(j,"DIV",{class:!0});var rn=w(ie);g(Le.$$.fragment,rn),Bn=a(rn),Qt=m(rn,"P",{"data-svelte-h":!0}),v(Qt)!=="svelte-1l397l"&&(Qt.textContent=Gs),rn.forEach(t),j.forEach(t),jo=a(e),g(Se.$$.fragment,e),Io=a(e),q=m(e,"DIV",{class:!0});var mn=w(q);g(Ge.$$.fragment,mn),En=a(mn),Yt=m(mn,"P",{"data-svelte-h":!0}),v(Yt)!=="svelte-j4u4it"&&(Yt.innerHTML=As),mn.forEach(t),Jo=a(e),g(Ae.$$.fragment,e),ko=a(e),g(Pe.$$.fragment,e),Uo=a(e),Ne=m(e,"DIV",{class:!0});var ma=w(Ne);g(He.$$.fragment,ma),ma.forEach(t),Zo=a(e),g(Be.$$.fragment,e),Wo=a(e),Ee=m(e,"DIV",{class:!0});var ca=w(Ee);g(Re.$$.fragment,ca),ca.forEach(t),Vo=a(e),g(Fe.$$.fragment,e),Do=a(e),qe=m(e,"DIV",{class:!0});var pa=w(qe);g(ze.$$.fragment,pa),pa.forEach(t),Lo=a(e),g(Qe.$$.fragment,e),So=a(e),A=m(e,"DIV",{class:!0});var ho=w(A);g(Ye.$$.fragment,ho),Rn=a(ho),Xt=m(ho,"P",{"data-svelte-h":!0}),v(Xt)!=="svelte-2spxi2"&&(Xt.textContent=Ps),Fn=a(ho),g(me.$$.fragment,ho),ho.forEach(t),Go=a(e),g(Xe.$$.fragment,e),Ao=a(e),Ke=m(e,"DIV",{class:!0});var ga=w(Ke);g(Oe.$$.fragment,ga),ga.forEach(t),Po=a(e),g(et.$$.fragment,e),No=a(e),tt=m(e,"DIV",{class:!0});var da=w(tt);g(ot.$$.fragment,da),da.forEach(t),Ho=a(e),g(nt.$$.fragment,e),Bo=a(e),st=m(e,"DIV",{class:!0});var ua=w(st);g(at.$$.fragment,ua),ua.forEach(t),Eo=a(e),g(lt.$$.fragment,e),Ro=a(e),J=m(e,"DIV",{class:!0});var V=w(J);g(rt.$$.fragment,V),qn=a(V),Kt=m(V,"P",{"data-svelte-h":!0}),v(Kt)!=="svelte-g073wf"&&(Kt.textContent=Ns),zn=a(V),Ot=m(V,"P",{"data-svelte-h":!0}),v(Ot)!=="svelte-wb0eyv"&&(Ot.textContent=Hs),Qn=a(V),eo=m(V,"UL",{"data-svelte-h":!0}),v(eo)!=="svelte-47v0qg"&&(eo.innerHTML=Bs),Yn=a(V),to=m(V,"P",{"data-svelte-h":!0}),v(to)!=="svelte-16s0nh5"&&(to.innerHTML=Es),Xn=a(V),W=m(V,"DIV",{class:!0});var B=w(W);g(it.$$.fragment,B),Kn=a(B),oo=m(B,"P",{"data-svelte-h":!0}),v(oo)!=="svelte-pdgtcq"&&(oo.textContent=Rs),On=a(B),no=m(B,"P",{"data-svelte-h":!0}),v(no)!=="svelte-b4jhp8"&&(no.textContent=Fs),es=a(B),mt=m(B,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),v(mt)!=="svelte-1i2n8tt"&&(mt.innerHTML=qs),ts=a(B),g(ce.$$.fragment,B),B.forEach(t),os=a(V),U=m(V,"DIV",{class:!0});var D=w(U);g(ct.$$.fragment,D),ns=a(D),so=m(D,"P",{"data-svelte-h":!0}),v(so)!=="svelte-tdu9dm"&&(so.textContent=zs),ss=a(D),ao=m(D,"P",{"data-svelte-h":!0}),v(ao)!=="svelte-ovzouy"&&(ao.innerHTML=Qs),as=a(D),lo=m(D,"P",{"data-svelte-h":!0}),v(lo)!=="svelte-17y4fsr"&&(lo.textContent=Ys),ls=a(D),g(pe.$$.fragment,D),rs=a(D),g(ge.$$.fragment,D),is=a(D),g(de.$$.fragment,D),D.forEach(t),V.forEach(t),Fo=a(e),g(pt.$$.fragment,e),qo=a(e),gt=m(e,"P",{"data-svelte-h":!0}),v(gt)!=="svelte-7d7xkt"&&(gt.textContent=Xs),zo=a(e),dt=m(e,"P",{"data-svelte-h":!0}),v(dt)!=="svelte-1mxg2jk"&&(dt.innerHTML=Ks),Qo=a(e),ut=m(e,"P",{"data-svelte-h":!0}),v(ut)!=="svelte-1s5xigb"&&(ut.textContent=Os),Yo=a(e),ft=m(e,"UL",{"data-svelte-h":!0}),v(ft)!=="svelte-1faiwmr"&&(ft.innerHTML=ea),Xo=a(e),g(ht.$$.fragment,e),Ko=a(e),z=m(e,"DIV",{class:!0});var cn=w(z);g($t.$$.fragment,cn),ms=a(cn),ro=m(cn,"P",{"data-svelte-h":!0}),v(ro)!=="svelte-57fhj7"&&(ro.textContent=ta),cn.forEach(t),Oo=a(e),g(bt.$$.fragment,e),en=a(e),Z=m(e,"DIV",{class:!0});var E=w(Z);g(vt.$$.fragment,E),cs=a(E),io=m(E,"P",{"data-svelte-h":!0}),v(io)!=="svelte-1qa18j9"&&(io.textContent=oa),ps=a(E),ue=m(E,"DIV",{class:!0});var pn=w(ue);g(Tt.$$.fragment,pn),gs=a(pn),mo=m(pn,"P",{"data-svelte-h":!0}),v(mo)!=="svelte-qix5eq"&&(mo.textContent=na),pn.forEach(t),ds=a(E),fe=m(E,"DIV",{class:!0});var gn=w(fe);g(_t.$$.fragment,gn),us=a(gn),co=m(gn,"P",{"data-svelte-h":!0}),v(co)!=="svelte-xppdw9"&&(co.textContent=sa),gn.forEach(t),fs=a(E),he=m(E,"DIV",{class:!0});var dn=w(he);g(yt.$$.fragment,dn),hs=a(dn),po=m(dn,"P",{"data-svelte-h":!0}),v(po)!=="svelte-chc6sp"&&(po.textContent=aa),dn.forEach(t),E.forEach(t),tn=a(e),g(wt.$$.fragment,e),on=a(e),L=m(e,"DIV",{class:!0});var ve=w(L);g(xt.$$.fragment,ve),$s=a(ve),go=m(ve,"P",{"data-svelte-h":!0}),v(go)!=="svelte-ckiqb6"&&(go.textContent=la),bs=a(ve),$e=m(ve,"DIV",{class:!0});var un=w($e);g(Mt.$$.fragment,un),vs=a(un),uo=m(un,"P",{"data-svelte-h":!0}),v(uo)!=="svelte-10rnn1x"&&(uo.innerHTML=ra),un.forEach(t),Ts=a(ve),be=m(ve,"DIV",{class:!0});var fn=w(be);g(Ct.$$.fragment,fn),_s=a(fn),fo=m(fn,"P",{"data-svelte-h":!0}),v(fo)!=="svelte-1xu9o93"&&(fo.textContent=ia),fn.forEach(t),ve.forEach(t),nn=a(e),g(jt.$$.fragment,e),sn=a(e),$o=m(e,"P",{}),w($o).forEach(t),this.h()},h(){y(r,"name","hf:doc:metadata"),y(r,"content",Wa),y(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(qe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(mt,"class","note"),y(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){n(document.head,r),c(e,_,o),c(e,$,o),c(e,b,o),d(T,e,o),c(e,l,o),d(x,e,o),c(e,bo,o),d(K,e,o),c(e,vo,o),c(e,Te,o),c(e,To,o),d(_e,e,o),c(e,_o,o),d(ye,e,o),c(e,yo,o),c(e,G,o),d(we,G,null),n(G,hn),n(G,Dt),n(G,$n),d(O,G,null),c(e,wo,o),d(xe,e,o),c(e,xo,o),c(e,F,o),d(Me,F,null),n(F,bn),n(F,Lt),c(e,Mo,o),d(Ce,e,o),c(e,Co,o),c(e,M,o),d(je,M,null),n(M,vn),n(M,St),n(M,Tn),n(M,Gt),n(M,_n),n(M,At),n(M,yn),n(M,ee),d(Ie,ee,null),n(ee,wn),n(ee,Pt),n(M,xn),n(M,te),d(Je,te,null),n(te,Mn),n(te,Nt),n(M,Cn),n(M,N),d(ke,N,null),n(N,jn),n(N,Ht),n(N,In),d(oe,N,null),n(M,Jn),n(M,ne),d(Ue,ne,null),n(ne,kn),n(ne,Bt),n(M,Un),n(M,S),d(Ze,S,null),n(S,Zn),n(S,Et),n(S,Wn),d(se,S,null),n(S,Vn),d(ae,S,null),n(M,Dn),n(M,le),d(We,le,null),n(le,Ln),n(le,Rt),n(M,Sn),n(M,H),d(Ve,H,null),n(H,Gn),n(H,Ft),n(H,An),n(H,qt),n(M,Pn),n(M,re),d(De,re,null),n(re,Nn),n(re,zt),n(M,Hn),n(M,ie),d(Le,ie,null),n(ie,Bn),n(ie,Qt),c(e,jo,o),d(Se,e,o),c(e,Io,o),c(e,q,o),d(Ge,q,null),n(q,En),n(q,Yt),c(e,Jo,o),d(Ae,e,o),c(e,ko,o),d(Pe,e,o),c(e,Uo,o),c(e,Ne,o),d(He,Ne,null),c(e,Zo,o),d(Be,e,o),c(e,Wo,o),c(e,Ee,o),d(Re,Ee,null),c(e,Vo,o),d(Fe,e,o),c(e,Do,o),c(e,qe,o),d(ze,qe,null),c(e,Lo,o),d(Qe,e,o),c(e,So,o),c(e,A,o),d(Ye,A,null),n(A,Rn),n(A,Xt),n(A,Fn),d(me,A,null),c(e,Go,o),d(Xe,e,o),c(e,Ao,o),c(e,Ke,o),d(Oe,Ke,null),c(e,Po,o),d(et,e,o),c(e,No,o),c(e,tt,o),d(ot,tt,null),c(e,Ho,o),d(nt,e,o),c(e,Bo,o),c(e,st,o),d(at,st,null),c(e,Eo,o),d(lt,e,o),c(e,Ro,o),c(e,J,o),d(rt,J,null),n(J,qn),n(J,Kt),n(J,zn),n(J,Ot),n(J,Qn),n(J,eo),n(J,Yn),n(J,to),n(J,Xn),n(J,W),d(it,W,null),n(W,Kn),n(W,oo),n(W,On),n(W,no),n(W,es),n(W,mt),n(W,ts),d(ce,W,null),n(J,os),n(J,U),d(ct,U,null),n(U,ns),n(U,so),n(U,ss),n(U,ao),n(U,as),n(U,lo),n(U,ls),d(pe,U,null),n(U,rs),d(ge,U,null),n(U,is),d(de,U,null),c(e,Fo,o),d(pt,e,o),c(e,qo,o),c(e,gt,o),c(e,zo,o),c(e,dt,o),c(e,Qo,o),c(e,ut,o),c(e,Yo,o),c(e,ft,o),c(e,Xo,o),d(ht,e,o),c(e,Ko,o),c(e,z,o),d($t,z,null),n(z,ms),n(z,ro),c(e,Oo,o),d(bt,e,o),c(e,en,o),c(e,Z,o),d(vt,Z,null),n(Z,cs),n(Z,io),n(Z,ps),n(Z,ue),d(Tt,ue,null),n(ue,gs),n(ue,mo),n(Z,ds),n(Z,fe),d(_t,fe,null),n(fe,us),n(fe,co),n(Z,fs),n(Z,he),d(yt,he,null),n(he,hs),n(he,po),c(e,tn,o),d(wt,e,o),c(e,on,o),c(e,L,o),d(xt,L,null),n(L,$s),n(L,go),n(L,bs),n(L,$e),d(Mt,$e,null),n($e,vs),n($e,uo),n(L,Ts),n(L,be),d(Ct,be,null),n(be,_s),n(be,fo),c(e,nn,o),d(jt,e,o),c(e,sn,o),c(e,$o,o),an=!0},p(e,[o]){const Q={};o&2&&(Q.$$scope={dirty:o,ctx:e}),K.$set(Q);const It={};o&2&&(It.$$scope={dirty:o,ctx:e}),O.$set(It);const j={};o&2&&(j.$$scope={dirty:o,ctx:e}),oe.$set(j);const Jt={};o&2&&(Jt.$$scope={dirty:o,ctx:e}),se.$set(Jt);const kt={};o&2&&(kt.$$scope={dirty:o,ctx:e}),ae.$set(kt);const Y={};o&2&&(Y.$$scope={dirty:o,ctx:e}),me.$set(Y);const Ut={};o&2&&(Ut.$$scope={dirty:o,ctx:e}),ce.$set(Ut);const P={};o&2&&(P.$$scope={dirty:o,ctx:e}),pe.$set(P);const Zt={};o&2&&(Zt.$$scope={dirty:o,ctx:e}),ge.$set(Zt);const X={};o&2&&(X.$$scope={dirty:o,ctx:e}),de.$set(X)},i(e){an||(u(T.$$.fragment,e),u(x.$$.fragment,e),u(K.$$.fragment,e),u(_e.$$.fragment,e),u(ye.$$.fragment,e),u(we.$$.fragment,e),u(O.$$.fragment,e),u(xe.$$.fragment,e),u(Me.$$.fragment,e),u(Ce.$$.fragment,e),u(je.$$.fragment,e),u(Ie.$$.fragment,e),u(Je.$$.fragment,e),u(ke.$$.fragment,e),u(oe.$$.fragment,e),u(Ue.$$.fragment,e),u(Ze.$$.fragment,e),u(se.$$.fragment,e),u(ae.$$.fragment,e),u(We.$$.fragment,e),u(Ve.$$.fragment,e),u(De.$$.fragment,e),u(Le.$$.fragment,e),u(Se.$$.fragment,e),u(Ge.$$.fragment,e),u(Ae.$$.fragment,e),u(Pe.$$.fragment,e),u(He.$$.fragment,e),u(Be.$$.fragment,e),u(Re.$$.fragment,e),u(Fe.$$.fragment,e),u(ze.$$.fragment,e),u(Qe.$$.fragment,e),u(Ye.$$.fragment,e),u(me.$$.fragment,e),u(Xe.$$.fragment,e),u(Oe.$$.fragment,e),u(et.$$.fragment,e),u(ot.$$.fragment,e),u(nt.$$.fragment,e),u(at.$$.fragment,e),u(lt.$$.fragment,e),u(rt.$$.fragment,e),u(it.$$.fragment,e),u(ce.$$.fragment,e),u(ct.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(de.$$.fragment,e),u(pt.$$.fragment,e),u(ht.$$.fragment,e),u($t.$$.fragment,e),u(bt.$$.fragment,e),u(vt.$$.fragment,e),u(Tt.$$.fragment,e),u(_t.$$.fragment,e),u(yt.$$.fragment,e),u(wt.$$.fragment,e),u(xt.$$.fragment,e),u(Mt.$$.fragment,e),u(Ct.$$.fragment,e),u(jt.$$.fragment,e),an=!0)},o(e){f(T.$$.fragment,e),f(x.$$.fragment,e),f(K.$$.fragment,e),f(_e.$$.fragment,e),f(ye.$$.fragment,e),f(we.$$.fragment,e),f(O.$$.fragment,e),f(xe.$$.fragment,e),f(Me.$$.fragment,e),f(Ce.$$.fragment,e),f(je.$$.fragment,e),f(Ie.$$.fragment,e),f(Je.$$.fragment,e),f(ke.$$.fragment,e),f(oe.$$.fragment,e),f(Ue.$$.fragment,e),f(Ze.$$.fragment,e),f(se.$$.fragment,e),f(ae.$$.fragment,e),f(We.$$.fragment,e),f(Ve.$$.fragment,e),f(De.$$.fragment,e),f(Le.$$.fragment,e),f(Se.$$.fragment,e),f(Ge.$$.fragment,e),f(Ae.$$.fragment,e),f(Pe.$$.fragment,e),f(He.$$.fragment,e),f(Be.$$.fragment,e),f(Re.$$.fragment,e),f(Fe.$$.fragment,e),f(ze.$$.fragment,e),f(Qe.$$.fragment,e),f(Ye.$$.fragment,e),f(me.$$.fragment,e),f(Xe.$$.fragment,e),f(Oe.$$.fragment,e),f(et.$$.fragment,e),f(ot.$$.fragment,e),f(nt.$$.fragment,e),f(at.$$.fragment,e),f(lt.$$.fragment,e),f(rt.$$.fragment,e),f(it.$$.fragment,e),f(ce.$$.fragment,e),f(ct.$$.fragment,e),f(pe.$$.fragment,e),f(ge.$$.fragment,e),f(de.$$.fragment,e),f(pt.$$.fragment,e),f(ht.$$.fragment,e),f($t.$$.fragment,e),f(bt.$$.fragment,e),f(vt.$$.fragment,e),f(Tt.$$.fragment,e),f(_t.$$.fragment,e),f(yt.$$.fragment,e),f(wt.$$.fragment,e),f(xt.$$.fragment,e),f(Mt.$$.fragment,e),f(Ct.$$.fragment,e),f(jt.$$.fragment,e),an=!1},d(e){e&&(t(_),t($),t(b),t(l),t(bo),t(vo),t(Te),t(To),t(_o),t(yo),t(G),t(wo),t(xo),t(F),t(Mo),t(Co),t(M),t(jo),t(Io),t(q),t(Jo),t(ko),t(Uo),t(Ne),t(Zo),t(Wo),t(Ee),t(Vo),t(Do),t(qe),t(Lo),t(So),t(A),t(Go),t(Ao),t(Ke),t(Po),t(No),t(tt),t(Ho),t(Bo),t(st),t(Eo),t(Ro),t(J),t(Fo),t(qo),t(gt),t(zo),t(dt),t(Qo),t(ut),t(Yo),t(ft),t(Xo),t(Ko),t(z),t(Oo),t(en),t(Z),t(tn),t(on),t(L),t(nn),t(sn),t($o)),t(r),h(T,e),h(x,e),h(K,e),h(_e,e),h(ye,e),h(we),h(O),h(xe,e),h(Me),h(Ce,e),h(je),h(Ie),h(Je),h(ke),h(oe),h(Ue),h(Ze),h(se),h(ae),h(We),h(Ve),h(De),h(Le),h(Se,e),h(Ge),h(Ae,e),h(Pe,e),h(He),h(Be,e),h(Re),h(Fe,e),h(ze),h(Qe,e),h(Ye),h(me),h(Xe,e),h(Oe),h(et,e),h(ot),h(nt,e),h(at),h(lt,e),h(rt),h(it),h(ce),h(ct),h(pe),h(ge),h(de),h(pt,e),h(ht,e),h($t),h(bt,e),h(vt),h(Tt),h(_t),h(yt),h(wt,e),h(xt),h(Mt),h(Ct),h(jt,e)}}}const Wa='{"title":"工具","local":"工具","sections":[{"title":"工具","local":"工具","sections":[{"title":"load_tool","local":"smolagents.load_tool","sections":[],"depth":3},{"title":"tool","local":"smolagents.tool","sections":[],"depth":3},{"title":"Tool","local":"smolagents.Tool","sections":[],"depth":3},{"title":"launch_gradio_demo","local":"smolagents.launch_gradio_demo","sections":[],"depth":3}],"depth":2},{"title":"默认工具","local":"默认工具","sections":[{"title":"PythonInterpreterTool","local":"smolagents.PythonInterpreterTool","sections":[],"depth":3},{"title":"FinalAnswerTool","local":"smolagents.FinalAnswerTool","sections":[],"depth":3},{"title":"UserInputTool","local":"smolagents.UserInputTool","sections":[],"depth":3},{"title":"DuckDuckGoSearchTool","local":"smolagents.DuckDuckGoSearchTool","sections":[],"depth":3},{"title":"GoogleSearchTool","local":"smolagents.GoogleSearchTool","sections":[],"depth":3},{"title":"VisitWebpageTool","local":"smolagents.VisitWebpageTool","sections":[],"depth":3},{"title":"SpeechToTextTool","local":"smolagents.SpeechToTextTool","sections":[],"depth":3}],"depth":2},{"title":"工具集合","local":"smolagents.ToolCollection","sections":[],"depth":2},{"title":"智能体类型","local":"智能体类型","sections":[{"title":"AgentText","local":"smolagents.AgentText","sections":[],"depth":3},{"title":"AgentImage","local":"smolagents.AgentImage","sections":[],"depth":3},{"title":"AgentAudio","local":"smolagents.AgentAudio","sections":[],"depth":3}],"depth":2}],"depth":1}';function Va(I){return ha(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Pa extends $a{constructor(r){super(),ba(this,r,Va,Za,fa,{})}}export{Pa as component};
