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 w,u as g,x as v,k as y,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,D as C,E as Zt}from"../chunks/ExampleCodeBlock.7120e9d6.js";import{C as Wt}from"../chunks/CodeBlock.3400fc53.js";import{H as k,E as ba}from"../chunks/getInferenceSnippets.0233181f.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 Wt({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 Wt({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 Wt({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 Wt({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 Wt({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 Wt({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 Wt({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,Vt,ys="Main function to quickly load a tool from the Hub.",fn,K,_o,we,yo,F,xe,hn,Dt,ws="Convert a function into an instance of a dynamically created Tool subclass.",wo,Me,xo,M,Ce,$n,Lt,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,St,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,Gt,Cs=`You can also override the method <a href="/docs/smolagents/v1.22.0/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/v1.22.0/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,At,js="Create tool from a dictionary representation.",yn,ee,Ie,wn,Pt,Is='Creates a <a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.Tool">Tool</a> from a gradio tool.',xn,N,Je,Mn,Nt,Js="Loads a tool defined on the Hub.",Cn,te,jn,oe,ke,In,Ht,ks='Creates a <a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.Tool">Tool</a> from a langchain tool.',Jn,S,Ue,kn,Bt,Us='Creates a <a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.Tool">Tool</a> from a Space given its id on the Hub.',Un,ne,Zn,se,Wn,ae,Ze,Vn,Et,Zs="Upload the tool to the Hub.",Dn,H,We,Ln,Rt,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,Ft,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,qt,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,Yt,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,Qe,Do,A,Ye,Bn,zt,Gs="Web search tool that performs searches using the DuckDuckGo search engine.",En,ie,Lo,ze,So,Xe,Ke,Go,Oe,Ao,et,tt,Po,ot,No,nt,st,Ho,at,Bo,J,lt,Rn,Xt,As="Tool collections enable loading a collection of tools in the agent’s toolbox.",Fn,Kt,Ps="Collections can be loaded from a collection in the Hub or from an MCP server, see:",qn,Ot,Ns='<li><a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a></li> <li><a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a></li>',Qn,eo,Hs='For example and usage, see: <a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a> and <a href="/docs/smolagents/v1.22.0/zh/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a>',Yn,W,rt,zn,to,Bs="Loads a tool collection from the Hub.",Xn,oo,Es="it adds a collection of tools from all Spaces in the collection to the agent’s toolbox",Kn,it,Rs=`<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>`,On,me,es,U,mt,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,Qs=`Note: a separate thread will be spawned to run an asyncio event loop handling
the MCP server.`,ss,ce,as,pe,ls,ge,Eo,ct,Ro,pt,Ys="智能体可以处理工具之间的任何类型的对象；工具是完全多模态的，可以接受和返回文本、图像、音频、视频以及其他类型的对象。为了增加工具之间的兼容性，以及正确呈现在 ipython（jupyter、colab、ipython notebooks 等）中的返回结果，我们为这些类型实现了包装类。",Fo,gt,zs="被包装的对象应该继续保持其初始行为；例如，一个文本对象应继续表现为字符串，一个图像对象应继续表现为 <code>PIL.Image</code>。",qo,dt,Xs="这些类型有三个特定的用途：",Qo,ut,Ks="<li>调用 <code>to_raw</code> 方法时，应返回底层对象</li> <li>调用 <code>to_string</code> 方法时，应将对象转换为字符串：对于 <code>AgentText</code> 类型，可以直接返回字符串；对于其他实例，则返回对象序列化版本的路径</li> <li>在 ipython 内核中显示时，应正确显示对象</li>",Yo,ft,zo,Q,ht,rs,lo,Os="Text type returned by the agent. Behaves as a string.",Xo,$t,Ko,Z,bt,is,ro,ea="Image type returned by the agent. Behaves as a PIL.Image.Image.",ms,de,vt,cs,io,ta="Saves the image to a file.",ps,ue,Tt,gs,mo,oa="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.Image.",ds,fe,_t,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,yt,en,L,wt,fs,po,sa="Audio type returned by the agent.",hs,he,xt,$s,go,aa="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",bs,$e,Mt,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,Ct,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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/zh/reference/tools#smolagents.Tool">Tool</a></p>
`}}),ne=new Zt({props:{anchor:"smolagents.Tool.from_space.example",$$slots:{default:[ya]},$$scope:{ctx:I}}}),se=new Zt({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/v1.22.0/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/v1.22.0/src/smolagents/tools.py#L390"}}),Ve=new C({props:{name:"setup",anchor:"smolagents.Tool.setup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/src/smolagents/default_tools.py#L101"}}),ie=new Zt({props:{anchor:"smolagents.DuckDuckGoSearchTool.example",$$slots:{default:[xa]},$$scope:{ctx:I}}}),ze=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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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/v1.22.0/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 Zt({props:{anchor:"smolagents.ToolCollection.from_hub.example",$$slots:{default:[Ma]},$$scope:{ctx:I}}}),mt=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/v1.22.0/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 Zt({props:{anchor:"smolagents.ToolCollection.from_mcp.example",$$slots:{default:[Ca]},$$scope:{ctx:I}}}),pe=new Zt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-2",$$slots:{default:[ja]},$$scope:{ctx:I}}}),ge=new Zt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-3",$$slots:{default:[Ia]},$$scope:{ctx:I}}}),ct=new k({props:{title:"智能体类型",local:"智能体类型",headingTag:"h2"}}),ft=new k({props:{title:"AgentText",local:"smolagents.AgentText",headingTag:"h3"}}),ht=new C({props:{name:"class smolagents.AgentText",anchor:"smolagents.AgentText",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L62"}}),$t=new k({props:{title:"AgentImage",local:"smolagents.AgentImage",headingTag:"h3"}}),bt=new C({props:{name:"class smolagents.AgentImage",anchor:"smolagents.AgentImage",parameters:[{name:"value",val:""}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L74"}}),vt=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/v1.22.0/src/smolagents/agent_types.py#L164"}}),Tt=new C({props:{name:"to_raw",anchor:"smolagents.AgentImage.to_raw",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L119"}}),_t=new C({props:{name:"to_string",anchor:"smolagents.AgentImage.to_string",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L136"}}),yt=new k({props:{title:"AgentAudio",local:"smolagents.AgentAudio",headingTag:"h3"}}),wt=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/v1.22.0/src/smolagents/agent_types.py#L176"}}),xt=new C({props:{name:"to_raw",anchor:"smolagents.AgentAudio.to_raw",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L216"}}),Mt=new C({props:{name:"to_string",anchor:"smolagents.AgentAudio.to_string",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/agent_types.py#L237"}}),Ct=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(),Vt=i("p"),Vt.textContent=ys,fn=s(),p(K.$$.fragment),_o=s(),p(we.$$.fragment),yo=s(),F=i("div"),p(xe.$$.fragment),hn=s(),Dt=i("p"),Dt.textContent=ws,wo=s(),p(Me.$$.fragment),xo=s(),M=i("div"),p(Ce.$$.fragment),$n=s(),Lt=i("p"),Lt.innerHTML=xs,bn=s(),St=i("ul"),St.innerHTML=Ms,vn=s(),Gt=i("p"),Gt.innerHTML=Cs,Tn=s(),O=i("div"),p(je.$$.fragment),_n=s(),At=i("p"),At.textContent=js,yn=s(),ee=i("div"),p(Ie.$$.fragment),wn=s(),Pt=i("p"),Pt.innerHTML=Is,xn=s(),N=i("div"),p(Je.$$.fragment),Mn=s(),Nt=i("p"),Nt.textContent=Js,Cn=s(),p(te.$$.fragment),jn=s(),oe=i("div"),p(ke.$$.fragment),In=s(),Ht=i("p"),Ht.innerHTML=ks,Jn=s(),S=i("div"),p(Ue.$$.fragment),kn=s(),Bt=i("p"),Bt.innerHTML=Us,Un=s(),p(ne.$$.fragment),Zn=s(),p(se.$$.fragment),Wn=s(),ae=i("div"),p(Ze.$$.fragment),Vn=s(),Et=i("p"),Et.textContent=Zs,Dn=s(),H=i("div"),p(We.$$.fragment),Ln=s(),Rt=i("p"),Rt.innerHTML=Ws,Sn=s(),Ft=i("ul"),Ft.innerHTML=Vs,Gn=s(),le=i("div"),p(Ve.$$.fragment),An=s(),qt=i("p"),qt.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(),Yt=i("p"),Yt.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(Qe.$$.fragment),Do=s(),A=i("div"),p(Ye.$$.fragment),Bn=s(),zt=i("p"),zt.textContent=Gs,En=s(),p(ie.$$.fragment),Lo=s(),p(ze.$$.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(),Xt=i("p"),Xt.textContent=As,Fn=s(),Kt=i("p"),Kt.textContent=Ps,qn=s(),Ot=i("ul"),Ot.innerHTML=Ns,Qn=s(),eo=i("p"),eo.innerHTML=Hs,Yn=s(),W=i("div"),p(rt.$$.fragment),zn=s(),to=i("p"),to.textContent=Bs,Xn=s(),oo=i("p"),oo.textContent=Es,Kn=s(),it=i("blockquote"),it.innerHTML=Rs,On=s(),p(me.$$.fragment),es=s(),U=i("div"),p(mt.$$.fragment),ts=s(),no=i("p"),no.textContent=Fs,os=s(),so=i("p"),so.innerHTML=qs,ns=s(),ao=i("p"),ao.textContent=Qs,ss=s(),p(ce.$$.fragment),as=s(),p(pe.$$.fragment),ls=s(),p(ge.$$.fragment),Eo=s(),p(ct.$$.fragment),Ro=s(),pt=i("p"),pt.textContent=Ys,Fo=s(),gt=i("p"),gt.innerHTML=zs,qo=s(),dt=i("p"),dt.textContent=Xs,Qo=s(),ut=i("ul"),ut.innerHTML=Ks,Yo=s(),p(ft.$$.fragment),zo=s(),Q=i("div"),p(ht.$$.fragment),rs=s(),lo=i("p"),lo.textContent=Os,Xo=s(),p($t.$$.fragment),Ko=s(),Z=i("div"),p(bt.$$.fragment),is=s(),ro=i("p"),ro.textContent=ea,ms=s(),de=i("div"),p(vt.$$.fragment),cs=s(),io=i("p"),io.textContent=ta,ps=s(),ue=i("div"),p(Tt.$$.fragment),gs=s(),mo=i("p"),mo.textContent=oa,ds=s(),fe=i("div"),p(_t.$$.fragment),us=s(),co=i("p"),co.textContent=na,Oo=s(),p(yt.$$.fragment),en=s(),L=i("div"),p(wt.$$.fragment),fs=s(),po=i("p"),po.textContent=sa,hs=s(),he=i("div"),p(xt.$$.fragment),$s=s(),go=i("p"),go.innerHTML=aa,bs=s(),$e=i("div"),p(Mt.$$.fragment),vs=s(),uo=i("p"),uo.textContent=la,tn=s(),p(Ct.$$.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",{}),w($).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 Y=w(G);g(ye.$$.fragment,Y),un=a(Y),Vt=m(Y,"P",{"data-svelte-h":!0}),v(Vt)!=="svelte-fgf0mn"&&(Vt.textContent=ys),fn=a(Y),g(K.$$.fragment,Y),Y.forEach(t),_o=a(e),g(we.$$.fragment,e),yo=a(e),F=m(e,"DIV",{class:!0});var jt=w(F);g(xe.$$.fragment,jt),hn=a(jt),Dt=m(jt,"P",{"data-svelte-h":!0}),v(Dt)!=="svelte-1yvj8b1"&&(Dt.textContent=ws),jt.forEach(t),wo=a(e),g(Me.$$.fragment,e),xo=a(e),M=m(e,"DIV",{class:!0});var j=w(M);g(Ce.$$.fragment,j),$n=a(j),Lt=m(j,"P",{"data-svelte-h":!0}),v(Lt)!=="svelte-1poxk5s"&&(Lt.innerHTML=xs),bn=a(j),St=m(j,"UL",{"data-svelte-h":!0}),v(St)!=="svelte-wwkyr"&&(St.innerHTML=Ms),vn=a(j),Gt=m(j,"P",{"data-svelte-h":!0}),v(Gt)!=="svelte-1uwei4"&&(Gt.innerHTML=Cs),Tn=a(j),O=m(j,"DIV",{class:!0});var It=w(O);g(je.$$.fragment,It),_n=a(It),At=m(It,"P",{"data-svelte-h":!0}),v(At)!=="svelte-2agex6"&&(At.textContent=js),It.forEach(t),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-1m7yey9"&&(Pt.innerHTML=Is),Jt.forEach(t),xn=a(j),N=m(j,"DIV",{class:!0});var z=w(N);g(Je.$$.fragment,z),Mn=a(z),Nt=m(z,"P",{"data-svelte-h":!0}),v(Nt)!=="svelte-yy7b2c"&&(Nt.textContent=Js),Cn=a(z),g(te.$$.fragment,z),z.forEach(t),jn=a(j),oe=m(j,"DIV",{class:!0});var kt=w(oe);g(ke.$$.fragment,kt),In=a(kt),Ht=m(kt,"P",{"data-svelte-h":!0}),v(Ht)!=="svelte-17eus5q"&&(Ht.innerHTML=ks),kt.forEach(t),Jn=a(j),S=m(j,"DIV",{class:!0});var P=w(S);g(Ue.$$.fragment,P),kn=a(P),Bt=m(P,"P",{"data-svelte-h":!0}),v(Bt)!=="svelte-15y82de"&&(Bt.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 Ut=w(ae);g(Ze.$$.fragment,Ut),Vn=a(Ut),Et=m(Ut,"P",{"data-svelte-h":!0}),v(Et)!=="svelte-1u3gku9"&&(Et.textContent=Zs),Ut.forEach(t),Dn=a(j),H=m(j,"DIV",{class:!0});var X=w(H);g(We.$$.fragment,X),Ln=a(X),Rt=m(X,"P",{"data-svelte-h":!0}),v(Rt)!=="svelte-19evuwa"&&(Rt.innerHTML=Ws),Sn=a(X),Ft=m(X,"UL",{"data-svelte-h":!0}),v(Ft)!=="svelte-1s62xm4"&&(Ft.innerHTML=Vs),X.forEach(t),Gn=a(j),le=m(j,"DIV",{class:!0});var sn=w(le);g(Ve.$$.fragment,sn),An=a(sn),qt=m(sn,"P",{"data-svelte-h":!0}),v(qt)!=="svelte-63kthh"&&(qt.textContent=Ds),sn.forEach(t),Pn=a(j),re=m(j,"DIV",{class:!0});var an=w(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=w(q);g(Se.$$.fragment,ln),Hn=a(ln),Yt=m(ln,"P",{"data-svelte-h":!0}),v(Yt)!=="svelte-j4u4it"&&(Yt.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=w(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=w(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=w(Fe);g(qe.$$.fragment,ma),ma.forEach(t),Vo=a(e),g(Qe.$$.fragment,e),Do=a(e),A=m(e,"DIV",{class:!0});var fo=w(A);g(Ye.$$.fragment,fo),Bn=a(fo),zt=m(fo,"P",{"data-svelte-h":!0}),v(zt)!=="svelte-2spxi2"&&(zt.textContent=Gs),En=a(fo),g(ie.$$.fragment,fo),fo.forEach(t),Lo=a(e),g(ze.$$.fragment,e),So=a(e),Xe=m(e,"DIV",{class:!0});var ca=w(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=w(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=w(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=w(J);g(lt.$$.fragment,V),Rn=a(V),Xt=m(V,"P",{"data-svelte-h":!0}),v(Xt)!=="svelte-g073wf"&&(Xt.textContent=As),Fn=a(V),Kt=m(V,"P",{"data-svelte-h":!0}),v(Kt)!=="svelte-wb0eyv"&&(Kt.textContent=Ps),qn=a(V),Ot=m(V,"UL",{"data-svelte-h":!0}),v(Ot)!=="svelte-9lwa3o"&&(Ot.innerHTML=Ns),Qn=a(V),eo=m(V,"P",{"data-svelte-h":!0}),v(eo)!=="svelte-10vbfw9"&&(eo.innerHTML=Hs),Yn=a(V),W=m(V,"DIV",{class:!0});var B=w(W);g(rt.$$.fragment,B),zn=a(B),to=m(B,"P",{"data-svelte-h":!0}),v(to)!=="svelte-pdgtcq"&&(to.textContent=Bs),Xn=a(B),oo=m(B,"P",{"data-svelte-h":!0}),v(oo)!=="svelte-b4jhp8"&&(oo.textContent=Es),Kn=a(B),it=m(B,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),v(it)!=="svelte-1i2n8tt"&&(it.innerHTML=Rs),On=a(B),g(me.$$.fragment,B),B.forEach(t),es=a(V),U=m(V,"DIV",{class:!0});var D=w(U);g(mt.$$.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=Qs),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(ct.$$.fragment,e),Ro=a(e),pt=m(e,"P",{"data-svelte-h":!0}),v(pt)!=="svelte-7d7xkt"&&(pt.textContent=Ys),Fo=a(e),gt=m(e,"P",{"data-svelte-h":!0}),v(gt)!=="svelte-1mxg2jk"&&(gt.innerHTML=zs),qo=a(e),dt=m(e,"P",{"data-svelte-h":!0}),v(dt)!=="svelte-1s5xigb"&&(dt.textContent=Xs),Qo=a(e),ut=m(e,"UL",{"data-svelte-h":!0}),v(ut)!=="svelte-1faiwmr"&&(ut.innerHTML=Ks),Yo=a(e),g(ft.$$.fragment,e),zo=a(e),Q=m(e,"DIV",{class:!0});var rn=w(Q);g(ht.$$.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($t.$$.fragment,e),Ko=a(e),Z=m(e,"DIV",{class:!0});var E=w(Z);g(bt.$$.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=w(de);g(vt.$$.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=w(ue);g(Tt.$$.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=w(fe);g(_t.$$.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(yt.$$.fragment,e),en=a(e),L=m(e,"DIV",{class:!0});var be=w(L);g(wt.$$.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=w(he);g(xt.$$.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=w($e);g(Mt.$$.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(Ct.$$.fragment,e),on=a(e),ho=m(e,"P",{}),w(ho).forEach(t),this.h()},h(){y(r,"name","hf:doc:metadata"),y(r,"content",ka),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(O,"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(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(oe,"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(ae,"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(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(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(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(Pe,"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(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(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(Xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),y(it,"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(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(de,"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(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(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($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(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,Vt),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,Dt),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,Lt),o(M,bn),o(M,St),o(M,vn),o(M,Gt),o(M,Tn),o(M,O),d(je,O,null),o(O,_n),o(O,At),o(M,yn),o(M,ee),d(Ie,ee,null),o(ee,wn),o(ee,Pt),o(M,xn),o(M,N),d(Je,N,null),o(N,Mn),o(N,Nt),o(N,Cn),d(te,N,null),o(M,jn),o(M,oe),d(ke,oe,null),o(oe,In),o(oe,Ht),o(M,Jn),o(M,S),d(Ue,S,null),o(S,kn),o(S,Bt),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,Et),o(M,Dn),o(M,H),d(We,H,null),o(H,Ln),o(H,Rt),o(H,Sn),o(H,Ft),o(M,Gn),o(M,le),d(Ve,le,null),o(le,An),o(le,qt),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,Yt),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(Qe,e,n),c(e,Do,n),c(e,A,n),d(Ye,A,null),o(A,Bn),o(A,zt),o(A,En),d(ie,A,null),c(e,Lo,n),d(ze,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,Xt),o(J,Fn),o(J,Kt),o(J,qn),o(J,Ot),o(J,Qn),o(J,eo),o(J,Yn),o(J,W),d(rt,W,null),o(W,zn),o(W,to),o(W,Xn),o(W,oo),o(W,Kn),o(W,it),o(W,On),d(me,W,null),o(J,es),o(J,U),d(mt,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(ct,e,n),c(e,Ro,n),c(e,pt,n),c(e,Fo,n),c(e,gt,n),c(e,qo,n),c(e,dt,n),c(e,Qo,n),c(e,ut,n),c(e,Yo,n),d(ft,e,n),c(e,zo,n),c(e,Q,n),d(ht,Q,null),o(Q,rs),o(Q,lo),c(e,Xo,n),d($t,e,n),c(e,Ko,n),c(e,Z,n),d(bt,Z,null),o(Z,is),o(Z,ro),o(Z,ms),o(Z,de),d(vt,de,null),o(de,cs),o(de,io),o(Z,ps),o(Z,ue),d(Tt,ue,null),o(ue,gs),o(ue,mo),o(Z,ds),o(Z,fe),d(_t,fe,null),o(fe,us),o(fe,co),c(e,Oo,n),d(yt,e,n),c(e,en,n),c(e,L,n),d(wt,L,null),o(L,fs),o(L,po),o(L,hs),o(L,he),d(xt,he,null),o(he,$s),o(he,go),o(L,bs),o(L,$e),d(Mt,$e,null),o($e,vs),o($e,uo),c(e,tn,n),d(Ct,e,n),c(e,on,n),c(e,ho,n),nn=!0},p(e,[n]){const Y={};n&2&&(Y.$$scope={dirty:n,ctx:e}),x.$set(Y);const jt={};n&2&&(jt.$$scope={dirty:n,ctx:e}),K.$set(jt);const j={};n&2&&(j.$$scope={dirty:n,ctx:e}),te.$set(j);const It={};n&2&&(It.$$scope={dirty:n,ctx:e}),ne.$set(It);const Jt={};n&2&&(Jt.$$scope={dirty:n,ctx:e}),se.$set(Jt);const z={};n&2&&(z.$$scope={dirty:n,ctx:e}),ie.$set(z);const kt={};n&2&&(kt.$$scope={dirty:n,ctx:e}),me.$set(kt);const P={};n&2&&(P.$$scope={dirty:n,ctx:e}),ce.$set(P);const Ut={};n&2&&(Ut.$$scope={dirty:n,ctx:e}),pe.$set(Ut);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(Qe.$$.fragment,e),u(Ye.$$.fragment,e),u(ie.$$.fragment,e),u(ze.$$.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(mt.$$.fragment,e),u(ce.$$.fragment,e),u(pe.$$.fragment,e),u(ge.$$.fragment,e),u(ct.$$.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),u(Ct.$$.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(Qe.$$.fragment,e),f(Ye.$$.fragment,e),f(ie.$$.fragment,e),f(ze.$$.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(mt.$$.fragment,e),f(ce.$$.fragment,e),f(pe.$$.fragment,e),f(ge.$$.fragment,e),f(ct.$$.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),f(Ct.$$.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(pt),t(Fo),t(gt),t(qo),t(dt),t(Qo),t(ut),t(Yo),t(zo),t(Q),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(Qe,e),h(Ye),h(ie),h(ze,e),h(Ke),h(Oe,e),h(tt),h(ot,e),h(st),h(at,e),h(lt),h(rt),h(me),h(mt),h(ce),h(pe),h(ge),h(ct,e),h(ft,e),h(ht),h($t,e),h(bt),h(vt),h(Tt),h(_t),h(yt,e),h(wt),h(xt),h(Mt),h(Ct,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 Sa extends fa{constructor(r){super(),ha(this,r,Ua,Ja,da,{})}}export{Sa as component};
