import{s as da,o as ua,n as R}from"../chunks/scheduler.f6319a2a.js";import{S as fa,i as ha,g as i,s,r as p,A as $a,h as m,f as t,c as a,j as y,u as g,x as v,k as w,y as o,a as c,v as d,d as u,t as f,w as h}from"../chunks/index.85aa684c.js";import{T as Ts}from"../chunks/Tip.3d397a88.js";import{D as C,E as Ut}from"../chunks/ExampleCodeBlock.3d8cc3b7.js";import{C as Zt}from"../chunks/CodeBlock.3400fc53.js";import{H as k,E as ba}from"../chunks/getInferenceSnippets.55a93fbe.js";function va(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 Ta(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 _a(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 ya(I){let r,_="Examples:",$,b,T;return b=new Zt({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 wa(I){let r,_;return r=new Zt({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 xa(I){let r,_="Examples:",$,b,T;return b=new Zt({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 Ma(I){let r,_="Example:",$,b,T;return b=new Zt({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 Ca(I){let r,_="Example with a Stdio MCP server:",$,b,T;return b=new Zt({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 ja(I){let r,_="Example with structured output enabled:",$,b,T;return b=new Zt({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 Ia(I){let r,_="Example with a Streamable HTTP MCP server:",$,b,T;return b=new Zt({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 Ja(I){let r,_,$,b,T,l,x,$o,ve,_s='要了解更多关于智能体和工具的信息，请务必阅读<a href="../index">入门指南</a>。本页面包含底层类的 API 文档。',bo,Te,vo,_e,To,G,ye,un,Wt,ys="Main function to quickly load a tool from the Hub.",fn,K,_o,we,yo,F,xe,hn,Vt,ws="Convert a function into an instance of a dynamically created Tool subclass.",wo,Me,xo,M,Ce,$n,Dt,xs=`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:`,bn,Lt,Ms=`<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>`,vn,St,Cs=`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.`,Tn,O,je,_n,Gt,js="Create tool from a dictionary representation.",yn,ee,Ie,wn,At,Is='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a gradio tool.',xn,N,Je,Mn,Pt,Js="Loads a tool defined on the Hub.",Cn,te,jn,oe,ke,In,Nt,ks='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a langchain tool.',Jn,S,Ue,kn,Ht,Us='Creates a <a href="/docs/smolagents/main/zh/reference/tools#smolagents.Tool">Tool</a> from a Space given its id on the Hub.',Un,ne,Zn,se,Wn,ae,Ze,Vn,Bt,Zs="Upload the tool to the Hub.",Dn,H,We,Ln,Et,Ws=`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:`,Sn,Rt,Vs=`<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>`,Gn,le,Ve,An,Ft,Ds=`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.`,Pn,re,De,Nn,qt,Ls="Returns a dictionary representing the tool",Mo,Le,Co,q,Se,Hn,zt,Ss=`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,Ge,Io,Ae,Jo,Pe,Ne,ko,He,Uo,Be,Ee,Zo,Re,Wo,Fe,qe,Vo,ze,Do,A,Qe,Bn,Qt,Gs="Web search tool that performs searches using the DuckDuckGo search engine.",En,ie,Lo,Ye,So,Xe,Ke,Go,Oe,Ao,et,tt,Po,ot,No,nt,st,Ho,at,Bo,J,lt,Rn,Yt,As="Tool collections enable loading a collection of tools in the agent’s toolbox.",Fn,Xt,Ps="Collections can be loaded from a collection in the Hub or from an MCP server, see:",qn,Kt,Ns='<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>',zn,Ot,Hs='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>',Qn,W,rt,Yn,eo,Bs="Loads a tool collection from the Hub.",Xn,to,Es="it adds a collection of tools from all Spaces in the collection to the agent’s toolbox",Kn,oo,Rs=`<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>`,On,me,es,U,it,ts,no,Fs="Automatically load a tool collection from an MCP server.",os,so,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.`,ns,ao,zs=`Note: a separate thread will be spawned to run an asyncio event loop handling
the MCP server.`,ss,ce,as,pe,ls,ge,Eo,mt,Ro,ct,Qs="智能体可以处理工具之间的任何类型的对象；工具是完全多模态的，可以接受和返回文本、图像、音频、视频以及其他类型的对象。为了增加工具之间的兼容性，以及正确呈现在 ipython（jupyter、colab、ipython notebooks 等）中的返回结果，我们为这些类型实现了包装类。",Fo,pt,Ys="被包装的对象应该继续保持其初始行为；例如，一个文本对象应继续表现为字符串，一个图像对象应继续表现为 <code>PIL.Image</code>。",qo,gt,Xs="这些类型有三个特定的用途：",zo,dt,Ks="<li>调用 <code>to_raw</code> 方法时，应返回底层对象</li> <li>调用 <code>to_string</code> 方法时，应将对象转换为字符串：对于 <code>AgentText</code> 类型，可以直接返回字符串；对于其他实例，则返回对象序列化版本的路径</li> <li>在 ipython 内核中显示时，应正确显示对象</li>",Qo,ut,Yo,z,ft,rs,lo,Os="Text type returned by the agent. Behaves as a string.",Xo,ht,Ko,Z,$t,is,ro,ea="Image type returned by the agent. Behaves as a PIL.Image.Image.",ms,de,bt,cs,io,ta="Saves the image to a file.",ps,ue,vt,gs,mo,oa="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.Image.",ds,fe,Tt,us,co,na=`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`,Oo,_t,en,L,yt,fs,po,sa="Audio type returned by the agent.",hs,he,wt,$s,go,aa="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",bs,$e,xt,vs,uo,la=`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`,tn,Mt,on,ho,nn;return T=new k({props:{title:"工具",local:"工具",headingTag:"h1"}}),x=new Ts({props:{warning:!0,$$slots:{default:[va]},$$scope:{ctx:I}}}),Te=new k({props:{title:"工具",local:"工具",headingTag:"h2"}}),_e=new k({props:{title:"load_tool",local:"smolagents.load_tool",headingTag:"h3"}}),ye=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"}}),K=new Ts({props:{warning:!0,$$slots:{default:[Ta]},$$scope:{ctx:I}}}),we=new k({props:{title:"tool",local:"smolagents.tool",headingTag:"h3"}}),xe=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"}}),Me=new k({props:{title:"Tool",local:"smolagents.Tool",headingTag:"h3"}}),Ce=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"}}),je=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>
`}}),Ie=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"}}),Je=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"}}),te=new Ts({props:{warning:!0,$$slots:{default:[_a]},$$scope:{ctx:I}}}),ke=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"}}),Ue=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>
`}}),ne=new Ut({props:{anchor:"smolagents.Tool.from_space.example",$$slots:{default:[ya]},$$scope:{ctx:I}}}),se=new Ut({props:{anchor:"smolagents.Tool.from_space.example-2",$$slots:{default:[wa]},$$scope:{ctx:I}}}),Ze=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"}}),We=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"}}),Ve=new C({props:{name:"setup",anchor:"smolagents.Tool.setup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L251"}}),De=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"}}),Le=new k({props:{title:"launch_gradio_demo",local:"smolagents.launch_gradio_demo",headingTag:"h3"}}),Se=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"}}),Ge=new k({props:{title:"默认工具",local:"默认工具",headingTag:"h2"}}),Ae=new k({props:{title:"PythonInterpreterTool",local:"smolagents.PythonInterpreterTool",headingTag:"h3"}}),Ne=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"}}),He=new k({props:{title:"FinalAnswerTool",local:"smolagents.FinalAnswerTool",headingTag:"h3"}}),Ee=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"}}),Re=new k({props:{title:"UserInputTool",local:"smolagents.UserInputTool",headingTag:"h3"}}),qe=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"}}),ze=new k({props:{title:"DuckDuckGoSearchTool",local:"smolagents.DuckDuckGoSearchTool",headingTag:"h3"}}),Qe=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"}}),ie=new Ut({props:{anchor:"smolagents.DuckDuckGoSearchTool.example",$$slots:{default:[xa]},$$scope:{ctx:I}}}),Ye=new k({props:{title:"GoogleSearchTool",local:"smolagents.GoogleSearchTool",headingTag:"h3"}}),Ke=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"}}),Oe=new k({props:{title:"VisitWebpageTool",local:"smolagents.VisitWebpageTool",headingTag:"h3"}}),tt=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"}}),ot=new k({props:{title:"SpeechToTextTool",local:"smolagents.SpeechToTextTool",headingTag:"h3"}}),st=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"}}),at=new k({props:{title:"工具集合",local:"smolagents.ToolCollection",headingTag:"h2"}}),lt=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"}}),rt=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>
`}}),me=new Ut({props:{anchor:"smolagents.ToolCollection.from_hub.example",$$slots:{default:[Ma]},$$scope:{ctx:I}}}),it=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>
`}}),ce=new Ut({props:{anchor:"smolagents.ToolCollection.from_mcp.example",$$slots:{default:[Ca]},$$scope:{ctx:I}}}),pe=new Ut({props:{anchor:"smolagents.ToolCollection.from_mcp.example-2",$$slots:{default:[ja]},$$scope:{ctx:I}}}),ge=new Ut({props:{anchor:"smolagents.ToolCollection.from_mcp.example-3",$$slots:{default:[Ia]},$$scope:{ctx:I}}}),mt=new k({props:{title:"智能体类型",local:"智能体类型",headingTag:"h2"}}),ut=new k({props:{title:"AgentText",local:"smolagents.AgentText",headingTag:"h3"}}),ft=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"}}),ht=new k({props:{title:"AgentImage",local:"smolagents.AgentImage",headingTag:"h3"}}),$t=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"}}),bt=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"}}),vt=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"}}),Tt=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"}}),_t=new k({props:{title:"AgentAudio",local:"smolagents.AgentAudio",headingTag:"h3"}}),yt=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"}}),wt=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"}}),xt=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"}}),Mt=new ba({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),$o=s(),ve=i("p"),ve.innerHTML=_s,bo=s(),p(Te.$$.fragment),vo=s(),p(_e.$$.fragment),To=s(),G=i("div"),p(ye.$$.fragment),un=s(),Wt=i("p"),Wt.textContent=ys,fn=s(),p(K.$$.fragment),_o=s(),p(we.$$.fragment),yo=s(),F=i("div"),p(xe.$$.fragment),hn=s(),Vt=i("p"),Vt.textContent=ws,wo=s(),p(Me.$$.fragment),xo=s(),M=i("div"),p(Ce.$$.fragment),$n=s(),Dt=i("p"),Dt.innerHTML=xs,bn=s(),Lt=i("ul"),Lt.innerHTML=Ms,vn=s(),St=i("p"),St.innerHTML=Cs,Tn=s(),O=i("div"),p(je.$$.fragment),_n=s(),Gt=i("p"),Gt.textContent=js,yn=s(),ee=i("div"),p(Ie.$$.fragment),wn=s(),At=i("p"),At.innerHTML=Is,xn=s(),N=i("div"),p(Je.$$.fragment),Mn=s(),Pt=i("p"),Pt.textContent=Js,Cn=s(),p(te.$$.fragment),jn=s(),oe=i("div"),p(ke.$$.fragment),In=s(),Nt=i("p"),Nt.innerHTML=ks,Jn=s(),S=i("div"),p(Ue.$$.fragment),kn=s(),Ht=i("p"),Ht.innerHTML=Us,Un=s(),p(ne.$$.fragment),Zn=s(),p(se.$$.fragment),Wn=s(),ae=i("div"),p(Ze.$$.fragment),Vn=s(),Bt=i("p"),Bt.textContent=Zs,Dn=s(),H=i("div"),p(We.$$.fragment),Ln=s(),Et=i("p"),Et.innerHTML=Ws,Sn=s(),Rt=i("ul"),Rt.innerHTML=Vs,Gn=s(),le=i("div"),p(Ve.$$.fragment),An=s(),Ft=i("p"),Ft.textContent=Ds,Pn=s(),re=i("div"),p(De.$$.fragment),Nn=s(),qt=i("p"),qt.textContent=Ls,Mo=s(),p(Le.$$.fragment),Co=s(),q=i("div"),p(Se.$$.fragment),Hn=s(),zt=i("p"),zt.innerHTML=Ss,jo=s(),p(Ge.$$.fragment),Io=s(),p(Ae.$$.fragment),Jo=s(),Pe=i("div"),p(Ne.$$.fragment),ko=s(),p(He.$$.fragment),Uo=s(),Be=i("div"),p(Ee.$$.fragment),Zo=s(),p(Re.$$.fragment),Wo=s(),Fe=i("div"),p(qe.$$.fragment),Vo=s(),p(ze.$$.fragment),Do=s(),A=i("div"),p(Qe.$$.fragment),Bn=s(),Qt=i("p"),Qt.textContent=Gs,En=s(),p(ie.$$.fragment),Lo=s(),p(Ye.$$.fragment),So=s(),Xe=i("div"),p(Ke.$$.fragment),Go=s(),p(Oe.$$.fragment),Ao=s(),et=i("div"),p(tt.$$.fragment),Po=s(),p(ot.$$.fragment),No=s(),nt=i("div"),p(st.$$.fragment),Ho=s(),p(at.$$.fragment),Bo=s(),J=i("div"),p(lt.$$.fragment),Rn=s(),Yt=i("p"),Yt.textContent=As,Fn=s(),Xt=i("p"),Xt.textContent=Ps,qn=s(),Kt=i("ul"),Kt.innerHTML=Ns,zn=s(),Ot=i("p"),Ot.innerHTML=Hs,Qn=s(),W=i("div"),p(rt.$$.fragment),Yn=s(),eo=i("p"),eo.textContent=Bs,Xn=s(),to=i("p"),to.textContent=Es,Kn=s(),oo=i("blockquote"),oo.innerHTML=Rs,On=s(),p(me.$$.fragment),es=s(),U=i("div"),p(it.$$.fragment),ts=s(),no=i("p"),no.textContent=Fs,os=s(),so=i("p"),so.innerHTML=qs,ns=s(),ao=i("p"),ao.textContent=zs,ss=s(),p(ce.$$.fragment),as=s(),p(pe.$$.fragment),ls=s(),p(ge.$$.fragment),Eo=s(),p(mt.$$.fragment),Ro=s(),ct=i("p"),ct.textContent=Qs,Fo=s(),pt=i("p"),pt.innerHTML=Ys,qo=s(),gt=i("p"),gt.textContent=Xs,zo=s(),dt=i("ul"),dt.innerHTML=Ks,Qo=s(),p(ut.$$.fragment),Yo=s(),z=i("div"),p(ft.$$.fragment),rs=s(),lo=i("p"),lo.textContent=Os,Xo=s(),p(ht.$$.fragment),Ko=s(),Z=i("div"),p($t.$$.fragment),is=s(),ro=i("p"),ro.textContent=ea,ms=s(),de=i("div"),p(bt.$$.fragment),cs=s(),io=i("p"),io.textContent=ta,ps=s(),ue=i("div"),p(vt.$$.fragment),gs=s(),mo=i("p"),mo.textContent=oa,ds=s(),fe=i("div"),p(Tt.$$.fragment),us=s(),co=i("p"),co.textContent=na,Oo=s(),p(_t.$$.fragment),en=s(),L=i("div"),p(yt.$$.fragment),fs=s(),po=i("p"),po.textContent=sa,hs=s(),he=i("div"),p(wt.$$.fragment),$s=s(),go=i("p"),go.innerHTML=aa,bs=s(),$e=i("div"),p(xt.$$.fragment),vs=s(),uo=i("p"),uo.textContent=la,tn=s(),p(Mt.$$.fragment),on=s(),ho=i("p"),this.h()},l(e){const n=$a("svelte-u9bgzb",document.head);r=m(n,"META",{name:!0,content:!0}),n.forEach(t),_=a(e),$=m(e,"P",{}),y($).forEach(t),b=a(e),g(T.$$.fragment,e),l=a(e),g(x.$$.fragment,e),$o=a(e),ve=m(e,"P",{"data-svelte-h":!0}),v(ve)!=="svelte-1i7e3m8"&&(ve.innerHTML=_s),bo=a(e),g(Te.$$.fragment,e),vo=a(e),g(_e.$$.fragment,e),To=a(e),G=m(e,"DIV",{class:!0});var Q=y(G);g(ye.$$.fragment,Q),un=a(Q),Wt=m(Q,"P",{"data-svelte-h":!0}),v(Wt)!=="svelte-fgf0mn"&&(Wt.textContent=ys),fn=a(Q),g(K.$$.fragment,Q),Q.forEach(t),_o=a(e),g(we.$$.fragment,e),yo=a(e),F=m(e,"DIV",{class:!0});var Ct=y(F);g(xe.$$.fragment,Ct),hn=a(Ct),Vt=m(Ct,"P",{"data-svelte-h":!0}),v(Vt)!=="svelte-1yvj8b1"&&(Vt.textContent=ws),Ct.forEach(t),wo=a(e),g(Me.$$.fragment,e),xo=a(e),M=m(e,"DIV",{class:!0});var j=y(M);g(Ce.$$.fragment,j),$n=a(j),Dt=m(j,"P",{"data-svelte-h":!0}),v(Dt)!=="svelte-1poxk5s"&&(Dt.innerHTML=xs),bn=a(j),Lt=m(j,"UL",{"data-svelte-h":!0}),v(Lt)!=="svelte-wwkyr"&&(Lt.innerHTML=Ms),vn=a(j),St=m(j,"P",{"data-svelte-h":!0}),v(St)!=="svelte-1uvxeq8"&&(St.innerHTML=Cs),Tn=a(j),O=m(j,"DIV",{class:!0});var jt=y(O);g(je.$$.fragment,jt),_n=a(jt),Gt=m(jt,"P",{"data-svelte-h":!0}),v(Gt)!=="svelte-2agex6"&&(Gt.textContent=js),jt.forEach(t),yn=a(j),ee=m(j,"DIV",{class:!0});var It=y(ee);g(Ie.$$.fragment,It),wn=a(It),At=m(It,"P",{"data-svelte-h":!0}),v(At)!=="svelte-1jj105h"&&(At.innerHTML=Is),It.forEach(t),xn=a(j),N=m(j,"DIV",{class:!0});var Y=y(N);g(Je.$$.fragment,Y),Mn=a(Y),Pt=m(Y,"P",{"data-svelte-h":!0}),v(Pt)!=="svelte-yy7b2c"&&(Pt.textContent=Js),Cn=a(Y),g(te.$$.fragment,Y),Y.forEach(t),jn=a(j),oe=m(j,"DIV",{class:!0});var Jt=y(oe);g(ke.$$.fragment,Jt),In=a(Jt),Nt=m(Jt,"P",{"data-svelte-h":!0}),v(Nt)!=="svelte-12cdc7s"&&(Nt.innerHTML=ks),Jt.forEach(t),Jn=a(j),S=m(j,"DIV",{class:!0});var P=y(S);g(Ue.$$.fragment,P),kn=a(P),Ht=m(P,"P",{"data-svelte-h":!0}),v(Ht)!=="svelte-1j4x04c"&&(Ht.innerHTML=Us),Un=a(P),g(ne.$$.fragment,P),Zn=a(P),g(se.$$.fragment,P),P.forEach(t),Wn=a(j),ae=m(j,"DIV",{class:!0});var kt=y(ae);g(Ze.$$.fragment,kt),Vn=a(kt),Bt=m(kt,"P",{"data-svelte-h":!0}),v(Bt)!=="svelte-1u3gku9"&&(Bt.textContent=Zs),kt.forEach(t),Dn=a(j),H=m(j,"DIV",{class:!0});var X=y(H);g(We.$$.fragment,X),Ln=a(X),Et=m(X,"P",{"data-svelte-h":!0}),v(Et)!=="svelte-19evuwa"&&(Et.innerHTML=Ws),Sn=a(X),Rt=m(X,"UL",{"data-svelte-h":!0}),v(Rt)!=="svelte-1s62xm4"&&(Rt.innerHTML=Vs),X.forEach(t),Gn=a(j),le=m(j,"DIV",{class:!0});var sn=y(le);g(Ve.$$.fragment,sn),An=a(sn),Ft=m(sn,"P",{"data-svelte-h":!0}),v(Ft)!=="svelte-63kthh"&&(Ft.textContent=Ds),sn.forEach(t),Pn=a(j),re=m(j,"DIV",{class:!0});var an=y(re);g(De.$$.fragment,an),Nn=a(an),qt=m(an,"P",{"data-svelte-h":!0}),v(qt)!=="svelte-1l397l"&&(qt.textContent=Ls),an.forEach(t),j.forEach(t),Mo=a(e),g(Le.$$.fragment,e),Co=a(e),q=m(e,"DIV",{class:!0});var ln=y(q);g(Se.$$.fragment,ln),Hn=a(ln),zt=m(ln,"P",{"data-svelte-h":!0}),v(zt)!=="svelte-j4u4it"&&(zt.innerHTML=Ss),ln.forEach(t),jo=a(e),g(Ge.$$.fragment,e),Io=a(e),g(Ae.$$.fragment,e),Jo=a(e),Pe=m(e,"DIV",{class:!0});var ra=y(Pe);g(Ne.$$.fragment,ra),ra.forEach(t),ko=a(e),g(He.$$.fragment,e),Uo=a(e),Be=m(e,"DIV",{class:!0});var ia=y(Be);g(Ee.$$.fragment,ia),ia.forEach(t),Zo=a(e),g(Re.$$.fragment,e),Wo=a(e),Fe=m(e,"DIV",{class:!0});var ma=y(Fe);g(qe.$$.fragment,ma),ma.forEach(t),Vo=a(e),g(ze.$$.fragment,e),Do=a(e),A=m(e,"DIV",{class:!0});var fo=y(A);g(Qe.$$.fragment,fo),Bn=a(fo),Qt=m(fo,"P",{"data-svelte-h":!0}),v(Qt)!=="svelte-2spxi2"&&(Qt.textContent=Gs),En=a(fo),g(ie.$$.fragment,fo),fo.forEach(t),Lo=a(e),g(Ye.$$.fragment,e),So=a(e),Xe=m(e,"DIV",{class:!0});var ca=y(Xe);g(Ke.$$.fragment,ca),ca.forEach(t),Go=a(e),g(Oe.$$.fragment,e),Ao=a(e),et=m(e,"DIV",{class:!0});var pa=y(et);g(tt.$$.fragment,pa),pa.forEach(t),Po=a(e),g(ot.$$.fragment,e),No=a(e),nt=m(e,"DIV",{class:!0});var ga=y(nt);g(st.$$.fragment,ga),ga.forEach(t),Ho=a(e),g(at.$$.fragment,e),Bo=a(e),J=m(e,"DIV",{class:!0});var V=y(J);g(lt.$$.fragment,V),Rn=a(V),Yt=m(V,"P",{"data-svelte-h":!0}),v(Yt)!=="svelte-g073wf"&&(Yt.textContent=As),Fn=a(V),Xt=m(V,"P",{"data-svelte-h":!0}),v(Xt)!=="svelte-wb0eyv"&&(Xt.textContent=Ps),qn=a(V),Kt=m(V,"UL",{"data-svelte-h":!0}),v(Kt)!=="svelte-47v0qg"&&(Kt.innerHTML=Ns),zn=a(V),Ot=m(V,"P",{"data-svelte-h":!0}),v(Ot)!=="svelte-16s0nh5"&&(Ot.innerHTML=Hs),Qn=a(V),W=m(V,"DIV",{class:!0});var B=y(W);g(rt.$$.fragment,B),Yn=a(B),eo=m(B,"P",{"data-svelte-h":!0}),v(eo)!=="svelte-pdgtcq"&&(eo.textContent=Bs),Xn=a(B),to=m(B,"P",{"data-svelte-h":!0}),v(to)!=="svelte-b4jhp8"&&(to.textContent=Es),Kn=a(B),oo=m(B,"BLOCKQUOTE",{"data-svelte-h":!0}),v(oo)!=="svelte-1ezz2hf"&&(oo.innerHTML=Rs),On=a(B),g(me.$$.fragment,B),B.forEach(t),es=a(V),U=m(V,"DIV",{class:!0});var D=y(U);g(it.$$.fragment,D),ts=a(D),no=m(D,"P",{"data-svelte-h":!0}),v(no)!=="svelte-tdu9dm"&&(no.textContent=Fs),os=a(D),so=m(D,"P",{"data-svelte-h":!0}),v(so)!=="svelte-ovzouy"&&(so.innerHTML=qs),ns=a(D),ao=m(D,"P",{"data-svelte-h":!0}),v(ao)!=="svelte-17y4fsr"&&(ao.textContent=zs),ss=a(D),g(ce.$$.fragment,D),as=a(D),g(pe.$$.fragment,D),ls=a(D),g(ge.$$.fragment,D),D.forEach(t),V.forEach(t),Eo=a(e),g(mt.$$.fragment,e),Ro=a(e),ct=m(e,"P",{"data-svelte-h":!0}),v(ct)!=="svelte-7d7xkt"&&(ct.textContent=Qs),Fo=a(e),pt=m(e,"P",{"data-svelte-h":!0}),v(pt)!=="svelte-1mxg2jk"&&(pt.innerHTML=Ys),qo=a(e),gt=m(e,"P",{"data-svelte-h":!0}),v(gt)!=="svelte-1s5xigb"&&(gt.textContent=Xs),zo=a(e),dt=m(e,"UL",{"data-svelte-h":!0}),v(dt)!=="svelte-1faiwmr"&&(dt.innerHTML=Ks),Qo=a(e),g(ut.$$.fragment,e),Yo=a(e),z=m(e,"DIV",{class:!0});var rn=y(z);g(ft.$$.fragment,rn),rs=a(rn),lo=m(rn,"P",{"data-svelte-h":!0}),v(lo)!=="svelte-57fhj7"&&(lo.textContent=Os),rn.forEach(t),Xo=a(e),g(ht.$$.fragment,e),Ko=a(e),Z=m(e,"DIV",{class:!0});var E=y(Z);g($t.$$.fragment,E),is=a(E),ro=m(E,"P",{"data-svelte-h":!0}),v(ro)!=="svelte-1qa18j9"&&(ro.textContent=ea),ms=a(E),de=m(E,"DIV",{class:!0});var mn=y(de);g(bt.$$.fragment,mn),cs=a(mn),io=m(mn,"P",{"data-svelte-h":!0}),v(io)!=="svelte-qix5eq"&&(io.textContent=ta),mn.forEach(t),ps=a(E),ue=m(E,"DIV",{class:!0});var cn=y(ue);g(vt.$$.fragment,cn),gs=a(cn),mo=m(cn,"P",{"data-svelte-h":!0}),v(mo)!=="svelte-xppdw9"&&(mo.textContent=oa),cn.forEach(t),ds=a(E),fe=m(E,"DIV",{class:!0});var pn=y(fe);g(Tt.$$.fragment,pn),us=a(pn),co=m(pn,"P",{"data-svelte-h":!0}),v(co)!=="svelte-chc6sp"&&(co.textContent=na),pn.forEach(t),E.forEach(t),Oo=a(e),g(_t.$$.fragment,e),en=a(e),L=m(e,"DIV",{class:!0});var be=y(L);g(yt.$$.fragment,be),fs=a(be),po=m(be,"P",{"data-svelte-h":!0}),v(po)!=="svelte-ckiqb6"&&(po.textContent=sa),hs=a(be),he=m(be,"DIV",{class:!0});var gn=y(he);g(wt.$$.fragment,gn),$s=a(gn),go=m(gn,"P",{"data-svelte-h":!0}),v(go)!=="svelte-10rnn1x"&&(go.innerHTML=aa),gn.forEach(t),bs=a(be),$e=m(be,"DIV",{class:!0});var dn=y($e);g(xt.$$.fragment,dn),vs=a(dn),uo=m(dn,"P",{"data-svelte-h":!0}),v(uo)!=="svelte-1xu9o93"&&(uo.textContent=la),dn.forEach(t),be.forEach(t),tn=a(e),g(Mt.$$.fragment,e),on=a(e),ho=m(e,"P",{}),y(ho).forEach(t),this.h()},h(){w(r,"name","hf:doc:metadata"),w(r,"content",ka),w(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),w(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,n){o(document.head,r),c(e,_,n),c(e,$,n),c(e,b,n),d(T,e,n),c(e,l,n),d(x,e,n),c(e,$o,n),c(e,ve,n),c(e,bo,n),d(Te,e,n),c(e,vo,n),d(_e,e,n),c(e,To,n),c(e,G,n),d(ye,G,null),o(G,un),o(G,Wt),o(G,fn),d(K,G,null),c(e,_o,n),d(we,e,n),c(e,yo,n),c(e,F,n),d(xe,F,null),o(F,hn),o(F,Vt),c(e,wo,n),d(Me,e,n),c(e,xo,n),c(e,M,n),d(Ce,M,null),o(M,$n),o(M,Dt),o(M,bn),o(M,Lt),o(M,vn),o(M,St),o(M,Tn),o(M,O),d(je,O,null),o(O,_n),o(O,Gt),o(M,yn),o(M,ee),d(Ie,ee,null),o(ee,wn),o(ee,At),o(M,xn),o(M,N),d(Je,N,null),o(N,Mn),o(N,Pt),o(N,Cn),d(te,N,null),o(M,jn),o(M,oe),d(ke,oe,null),o(oe,In),o(oe,Nt),o(M,Jn),o(M,S),d(Ue,S,null),o(S,kn),o(S,Ht),o(S,Un),d(ne,S,null),o(S,Zn),d(se,S,null),o(M,Wn),o(M,ae),d(Ze,ae,null),o(ae,Vn),o(ae,Bt),o(M,Dn),o(M,H),d(We,H,null),o(H,Ln),o(H,Et),o(H,Sn),o(H,Rt),o(M,Gn),o(M,le),d(Ve,le,null),o(le,An),o(le,Ft),o(M,Pn),o(M,re),d(De,re,null),o(re,Nn),o(re,qt),c(e,Mo,n),d(Le,e,n),c(e,Co,n),c(e,q,n),d(Se,q,null),o(q,Hn),o(q,zt),c(e,jo,n),d(Ge,e,n),c(e,Io,n),d(Ae,e,n),c(e,Jo,n),c(e,Pe,n),d(Ne,Pe,null),c(e,ko,n),d(He,e,n),c(e,Uo,n),c(e,Be,n),d(Ee,Be,null),c(e,Zo,n),d(Re,e,n),c(e,Wo,n),c(e,Fe,n),d(qe,Fe,null),c(e,Vo,n),d(ze,e,n),c(e,Do,n),c(e,A,n),d(Qe,A,null),o(A,Bn),o(A,Qt),o(A,En),d(ie,A,null),c(e,Lo,n),d(Ye,e,n),c(e,So,n),c(e,Xe,n),d(Ke,Xe,null),c(e,Go,n),d(Oe,e,n),c(e,Ao,n),c(e,et,n),d(tt,et,null),c(e,Po,n),d(ot,e,n),c(e,No,n),c(e,nt,n),d(st,nt,null),c(e,Ho,n),d(at,e,n),c(e,Bo,n),c(e,J,n),d(lt,J,null),o(J,Rn),o(J,Yt),o(J,Fn),o(J,Xt),o(J,qn),o(J,Kt),o(J,zn),o(J,Ot),o(J,Qn),o(J,W),d(rt,W,null),o(W,Yn),o(W,eo),o(W,Xn),o(W,to),o(W,Kn),o(W,oo),o(W,On),d(me,W,null),o(J,es),o(J,U),d(it,U,null),o(U,ts),o(U,no),o(U,os),o(U,so),o(U,ns),o(U,ao),o(U,ss),d(ce,U,null),o(U,as),d(pe,U,null),o(U,ls),d(ge,U,null),c(e,Eo,n),d(mt,e,n),c(e,Ro,n),c(e,ct,n),c(e,Fo,n),c(e,pt,n),c(e,qo,n),c(e,gt,n),c(e,zo,n),c(e,dt,n),c(e,Qo,n),d(ut,e,n),c(e,Yo,n),c(e,z,n),d(ft,z,null),o(z,rs),o(z,lo),c(e,Xo,n),d(ht,e,n),c(e,Ko,n),c(e,Z,n),d($t,Z,null),o(Z,is),o(Z,ro),o(Z,ms),o(Z,de),d(bt,de,null),o(de,cs),o(de,io),o(Z,ps),o(Z,ue),d(vt,ue,null),o(ue,gs),o(ue,mo),o(Z,ds),o(Z,fe),d(Tt,fe,null),o(fe,us),o(fe,co),c(e,Oo,n),d(_t,e,n),c(e,en,n),c(e,L,n),d(yt,L,null),o(L,fs),o(L,po),o(L,hs),o(L,he),d(wt,he,null),o(he,$s),o(he,go),o(L,bs),o(L,$e),d(xt,$e,null),o($e,vs),o($e,uo),c(e,tn,n),d(Mt,e,n),c(e,on,n),c(e,ho,n),nn=!0},p(e,[n]){const Q={};n&2&&(Q.$$scope={dirty:n,ctx:e}),x.$set(Q);const Ct={};n&2&&(Ct.$$scope={dirty:n,ctx:e}),K.$set(Ct);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),te.$set(j);const jt={};n&2&&(jt.$$scope={dirty:n,ctx:e}),ne.$set(jt);const It={};n&2&&(It.$$scope={dirty:n,ctx:e}),se.$set(It);const Y={};n&2&&(Y.$$scope={dirty:n,ctx:e}),ie.$set(Y);const Jt={};n&2&&(Jt.$$scope={dirty:n,ctx:e}),me.$set(Jt);const P={};n&2&&(P.$$scope={dirty:n,ctx:e}),ce.$set(P);const kt={};n&2&&(kt.$$scope={dirty:n,ctx:e}),pe.$set(kt);const X={};n&2&&(X.$$scope={dirty:n,ctx:e}),ge.$set(X)},i(e){nn||(u(T.$$.fragment,e),u(x.$$.fragment,e),u(Te.$$.fragment,e),u(_e.$$.fragment,e),u(ye.$$.fragment,e),u(K.$$.fragment,e),u(we.$$.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(te.$$.fragment,e),u(ke.$$.fragment,e),u(Ue.$$.fragment,e),u(ne.$$.fragment,e),u(se.$$.fragment,e),u(Ze.$$.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(Ne.$$.fragment,e),u(He.$$.fragment,e),u(Ee.$$.fragment,e),u(Re.$$.fragment,e),u(qe.$$.fragment,e),u(ze.$$.fragment,e),u(Qe.$$.fragment,e),u(ie.$$.fragment,e),u(Ye.$$.fragment,e),u(Ke.$$.fragment,e),u(Oe.$$.fragment,e),u(tt.$$.fragment,e),u(ot.$$.fragment,e),u(st.$$.fragment,e),u(at.$$.fragment,e),u(lt.$$.fragment,e),u(rt.$$.fragment,e),u(me.$$.fragment,e),u(it.$$.fragment,e),u(ce.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(mt.$$.fragment,e),u(ut.$$.fragment,e),u(ft.$$.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),nn=!0)},o(e){f(T.$$.fragment,e),f(x.$$.fragment,e),f(Te.$$.fragment,e),f(_e.$$.fragment,e),f(ye.$$.fragment,e),f(K.$$.fragment,e),f(we.$$.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(te.$$.fragment,e),f(ke.$$.fragment,e),f(Ue.$$.fragment,e),f(ne.$$.fragment,e),f(se.$$.fragment,e),f(Ze.$$.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(Ne.$$.fragment,e),f(He.$$.fragment,e),f(Ee.$$.fragment,e),f(Re.$$.fragment,e),f(qe.$$.fragment,e),f(ze.$$.fragment,e),f(Qe.$$.fragment,e),f(ie.$$.fragment,e),f(Ye.$$.fragment,e),f(Ke.$$.fragment,e),f(Oe.$$.fragment,e),f(tt.$$.fragment,e),f(ot.$$.fragment,e),f(st.$$.fragment,e),f(at.$$.fragment,e),f(lt.$$.fragment,e),f(rt.$$.fragment,e),f(me.$$.fragment,e),f(it.$$.fragment,e),f(ce.$$.fragment,e),f(pe.$$.fragment,e),f(ge.$$.fragment,e),f(mt.$$.fragment,e),f(ut.$$.fragment,e),f(ft.$$.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),nn=!1},d(e){e&&(t(_),t($),t(b),t(l),t($o),t(ve),t(bo),t(vo),t(To),t(G),t(_o),t(yo),t(F),t(wo),t(xo),t(M),t(Mo),t(Co),t(q),t(jo),t(Io),t(Jo),t(Pe),t(ko),t(Uo),t(Be),t(Zo),t(Wo),t(Fe),t(Vo),t(Do),t(A),t(Lo),t(So),t(Xe),t(Go),t(Ao),t(et),t(Po),t(No),t(nt),t(Ho),t(Bo),t(J),t(Eo),t(Ro),t(ct),t(Fo),t(pt),t(qo),t(gt),t(zo),t(dt),t(Qo),t(Yo),t(z),t(Xo),t(Ko),t(Z),t(Oo),t(en),t(L),t(tn),t(on),t(ho)),t(r),h(T,e),h(x,e),h(Te,e),h(_e,e),h(ye),h(K),h(we,e),h(xe),h(Me,e),h(Ce),h(je),h(Ie),h(Je),h(te),h(ke),h(Ue),h(ne),h(se),h(Ze),h(We),h(Ve),h(De),h(Le,e),h(Se),h(Ge,e),h(Ae,e),h(Ne),h(He,e),h(Ee),h(Re,e),h(qe),h(ze,e),h(Qe),h(ie),h(Ye,e),h(Ke),h(Oe,e),h(tt),h(ot,e),h(st),h(at,e),h(lt),h(rt),h(me),h(it),h(ce),h(pe),h(ge),h(mt,e),h(ut,e),h(ft),h(ht,e),h($t),h(bt),h(vt),h(Tt),h(_t,e),h(yt),h(wt),h(xt),h(Mt,e)}}}const ka='{"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 Ua(I){return ua(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ga extends fa{constructor(r){super(),ha(this,r,Ua,Ja,da,{})}}export{Ga as component};
