import{s as sa,o as aa,n as Q}from"../chunks/scheduler.3d32dc09.js";import{S as la,i as ra,e as i,s as o,c as g,h as ia,a as c,d as a,b as n,f as x,g as u,j as v,k as M,l as t,m as p,n as h,t as f,o as b,p as $}from"../chunks/index.f9718211.js";import{T as ds}from"../chunks/Tip.6cf8c24b.js";import{C as ca,H as S,E as ma}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.51c38499.js";import{D as J,E as Tt}from"../chunks/ExampleCodeBlock.9d054956.js";import{C as _t}from"../chunks/CodeBlock.ab331c21.js";function pa(j){let l,T=`Smolagents is an experimental API which is subject to change at any time. Results returned by the agents
can vary as the APIs or underlying models are prone to change.`;return{c(){l=i("p"),l.textContent=T},l(m){l=c(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-19v5hvw"&&(l.textContent=T)},m(m,d){p(m,l,d)},p:Q,d(m){m&&a(l)}}}function da(j){let l,T=`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(){l=i("p"),l.textContent=T},l(m){l=c(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-1kcherd"&&(l.textContent=T)},m(m,d){p(m,l,d)},p:Q,d(m){m&&a(l)}}}function ga(j){let l,T=`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(){l=i("p"),l.textContent=T},l(m){l=c(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-fpk7e5"&&(l.textContent=T)},m(m,d){p(m,l,d)},p:Q,d(m){m&&a(l)}}}function ua(j){let l,T="Examples:",m,d,y;return d=new _t({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(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-kvfsh7"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function ha(j){let l,T;return l=new _t({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(){g(l.$$.fragment)},l(m){u(l.$$.fragment,m)},m(m,d){h(l,m,d),T=!0},p:Q,i(m){T||(f(l.$$.fragment,m),T=!0)},o(m){b(l.$$.fragment,m),T=!1},d(m){$(l,m)}}}function fa(j){let l,T="Example:",m,d,y;return d=new _t({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(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-11lpom8"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function ba(j){let l,T="Example with a Stdio MCP server:",m,d,y;return d=new _t({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(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-49dhgx"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function $a(j){let l,T="Example with structured output enabled:",m,d,y;return d=new _t({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(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-ghl0yb"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function va(j){let l,T="Example with a Streamable HTTP MCP server:",m,d,y;return d=new _t({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(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-178fndi"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function ya(j){let l,T="Example:",m,d,y;return d=new _t({props:{code:"JTIzJTIwZnVsbHklMjBtYW5hZ2VkJTIwY29udGV4dCUyMG1hbmFnZXIlMjAlMkIlMjBzdGRpbyUwQXdpdGglMjBNQ1BDbGllbnQoLi4uKSUyMGFzJTIwdG9vbHMlM0ElMEElMjAlMjAlMjAlMjAlMjMlMjB0b29scyUyMGFyZSUyMG5vdyUyMGF2YWlsYWJsZSUwQSUwQSUyMyUyMGNvbnRleHQlMjBtYW5hZ2VyJTIwJTJCJTIwU3RyZWFtYWJsZSUyMEhUVFAlMjB0cmFuc3BvcnQlM0ElMEF3aXRoJTIwTUNQQ2xpZW50KCU3QiUyMnVybCUyMiUzQSUyMCUyMmh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0E4MDAwJTJGbWNwJTIyJTJDJTIwJTIydHJhbnNwb3J0JTIyJTNBJTIwJTIyc3RyZWFtYWJsZS1odHRwJTIyJTdEKSUyMGFzJTIwdG9vbHMlM0ElMEElMjAlMjAlMjAlMjAlMjMlMjB0b29scyUyMGFyZSUyMG5vdyUyMGF2YWlsYWJsZSUwQSUwQSUyMyUyMEVuYWJsZSUyMHN0cnVjdHVyZWQlMjBvdXRwdXQlMjBmb3IlMjBhZHZhbmNlZCUyME1DUCUyMHRvb2xzJTNBJTBBd2l0aCUyME1DUENsaWVudChzZXJ2ZXJfcGFyYW1ldGVycyUyQyUyMHN0cnVjdHVyZWRfb3V0cHV0JTNEVHJ1ZSklMjBhcyUyMHRvb2xzJTNBJTBBJTIwJTIwJTIwJTIwJTIzJTIwdG9vbHMlMjB3aXRoJTIwc3RydWN0dXJlZCUyMG91dHB1dCUyMHN1cHBvcnQlMjBhcmUlMjBub3clMjBhdmFpbGFibGUlMEElMEElMjMlMjBtYW51YWxseSUyMG1hbmFnZSUyMHRoZSUyMGNvbm5lY3Rpb24lMjB2aWElMjB0aGUlMjBtY3BfY2xpZW50JTIwb2JqZWN0JTNBJTBBdHJ5JTNBJTBBJTIwJTIwJTIwJTIwbWNwX2NsaWVudCUyMCUzRCUyME1DUENsaWVudCguLi4pJTBBJTIwJTIwJTIwJTIwdG9vbHMlMjAlM0QlMjBtY3BfY2xpZW50LmdldF90b29scygpJTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwdXNlJTIweW91ciUyMHRvb2xzJTIwaGVyZS4lMEFmaW5hbGx5JTNBJTBBJTIwJTIwJTIwJTIwbWNwX2NsaWVudC5kaXNjb25uZWN0KCk=",highlighted:`<span class="hljs-comment"># fully managed context manager + stdio</span>
<span class="hljs-keyword">with</span> MCPClient(...) <span class="hljs-keyword">as</span> tools:
    <span class="hljs-comment"># tools are now available</span>

<span class="hljs-comment"># context manager + Streamable HTTP transport:</span>
<span class="hljs-keyword">with</span> MCPClient({<span class="hljs-string">&quot;url&quot;</span>: <span class="hljs-string">&quot;http://localhost:8000/mcp&quot;</span>, <span class="hljs-string">&quot;transport&quot;</span>: <span class="hljs-string">&quot;streamable-http&quot;</span>}) <span class="hljs-keyword">as</span> tools:
    <span class="hljs-comment"># tools are now available</span>

<span class="hljs-comment"># Enable structured output for advanced MCP tools:</span>
<span class="hljs-keyword">with</span> MCPClient(server_parameters, structured_output=<span class="hljs-literal">True</span>) <span class="hljs-keyword">as</span> tools:
    <span class="hljs-comment"># tools with structured output support are now available</span>

<span class="hljs-comment"># manually manage the connection via the mcp_client object:</span>
<span class="hljs-keyword">try</span>:
    mcp_client = MCPClient(...)
    tools = mcp_client.get_tools()

    <span class="hljs-comment"># use your tools here.</span>
<span class="hljs-keyword">finally</span>:
    mcp_client.disconnect()`,wrap:!1}}),{c(){l=i("p"),l.textContent=T,m=o(),g(d.$$.fragment)},l(s){l=c(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-11lpom8"&&(l.textContent=T),m=n(s),u(d.$$.fragment,s)},m(s,_){p(s,l,_),p(s,m,_),h(d,s,_),y=!0},p:Q,i(s){y||(f(d.$$.fragment,s),y=!0)},o(s){b(d.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(d,s)}}}function Ta(j){let l,T,m,d,y,s,_,mo,ee,po,Me,gs=`To learn more about agents and tools make sure to read the <a href="../index">introductory guide</a>. This page
contains the API docs for the underlying classes.`,go,xe,uo,Ce,ho,H,Je,zo,wt,us="Main function to quickly load a tool from the Hub.",Ko,te,fo,je,bo,Y,Ie,Oo,Mt,hs="Convert a function into an instance of a dynamically created Tool subclass.",$o,Ue,vo,w,ke,en,xt,fs=`A base class for the functions used by the agent. Subclass this and implement the <code>forward</code> method as well as the
following class attributes:`,tn,Ct,bs=`<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>`,on,Jt,$s=`You can also override the method <a href="/docs/smolagents/v1.22.0/en/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/en/reference/tools#smolagents.Tool.setup">setup()</a> will be called the first time you use your tool, but not at
instantiation.`,nn,oe,Ze,sn,jt,vs="Create tool from a dictionary representation.",an,ne,We,ln,It,ys='Creates a <a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.Tool">Tool</a> from a gradio tool.',rn,L,Be,cn,Ut,Ts="Loads a tool defined on the Hub.",mn,se,pn,ae,Pe,dn,kt,_s='Creates a <a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.Tool">Tool</a> from a langchain tool.',gn,V,Ne,un,Zt,ws='Creates a <a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.Tool">Tool</a> from a Space given its id on the Hub.',hn,le,fn,re,bn,ie,Ae,$n,Wt,Ms="Upload the tool to the Hub.",vn,G,Ve,yn,Bt,xs=`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:`,Tn,Pt,Cs=`<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>`,_n,ce,Se,wn,Nt,Js=`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.`,Mn,me,He,xn,At,js="Returns a dictionary representing the tool",yo,Ee,To,q,Le,Cn,Vt,Is=`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>.`,_o,Ge,wo,I,De,Jn,St,Us="Tool collections enable loading a collection of tools in the agent’s toolbox.",jn,Ht,ks="Collections can be loaded from a collection in the Hub or from an MCP server, see:",In,Et,Zs='<li><a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a></li> <li><a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a></li>',Un,Lt,Ws='For example and usage, see: <a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a> and <a href="/docs/smolagents/v1.22.0/en/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a>',kn,W,Re,Zn,Gt,Bs="Loads a tool collection from the Hub.",Wn,Dt,Ps="it adds a collection of tools from all Spaces in the collection to the agent’s toolbox",Bn,Fe,Ns=`<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>`,Pn,pe,Nn,k,Qe,An,Rt,As="Automatically load a tool collection from an MCP server.",Vn,Ft,Vs=`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.`,Sn,Qt,Ss=`Note: a separate thread will be spawned to run an asyncio event loop handling
the MCP server.`,Hn,de,En,ge,Ln,ue,Mo,Ye,xo,U,qe,Gn,Yt,Hs="Manages the connection to an MCP server and make its tools available to SmolAgents.",Dn,qt,Es=`Note: tools can only be accessed after the connection has been started with the
<code>connect()</code> method, done during the init. If you don’t use the context manager
we strongly encourage to use “try … finally” to ensure the connection is cleaned up.`,Rn,he,Fn,fe,Xe,Qn,Xt,Ls="Connect to the MCP server and initialize the tools.",Yn,be,ze,qn,zt,Gs="Disconnect from the MCP server",Xn,D,Ke,zn,Kt,Ds="The SmolAgents tools available from the MCP server.",Kn,Ot,Rs=`Note: for now, this always returns the tools available at the creation of the session,
but it will in a future release return also new tools available from the MCP server if
any at call time.`,Co,Oe,Jo,et,Fs=`Agents can handle any type of object in-between tools; tools, being completely multimodal, can accept and return
text, image, audio, video, among other types. In order to increase compatibility between tools, as well as to
correctly render these returns in ipython (jupyter, colab, ipython notebooks, …), we implement wrapper classes
around these types.`,jo,tt,Qs=`The wrapped objects should continue behaving as initially; a text object should still behave as a string, an image
object should still behave as a <code>PIL.Image</code>.`,Io,ot,Ys="These types have three specific purposes:",Uo,nt,qs=`<li>Calling <code>to_raw</code> on the type should return the underlying object</li> <li>Calling <code>to_string</code> on the type should return the object as a string: that can be the string in case of an <code>AgentText</code>
but will be the path of the serialized version of the object in other instances</li> <li>Displaying it in an ipython kernel should display the object correctly</li>`,ko,st,Zo,X,at,On,eo,Xs="Text type returned by the agent. Behaves as a string.",Wo,lt,Bo,Z,rt,es,to,zs="Image type returned by the agent. Behaves as a PIL.Image.Image.",ts,$e,it,os,oo,Ks="Saves the image to a file.",ns,ve,ct,ss,no,Os="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.Image.",as,ye,mt,ls,so,ea=`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`,Po,pt,No,A,dt,rs,ao,ta="Audio type returned by the agent.",is,Te,gt,cs,lo,oa="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",ms,_e,ut,ps,ro,na=`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`,Ao,ht,Vo,co,So;return y=new ca({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),_=new S({props:{title:"Tools",local:"tools",headingTag:"h1"}}),ee=new ds({props:{warning:!0,$$slots:{default:[pa]},$$scope:{ctx:j}}}),xe=new S({props:{title:"Tool Base Classes",local:"tool-base-classes",headingTag:"h2"}}),Ce=new S({props:{title:"load_tool",local:"smolagents.load_tool",headingTag:"h3"}}),Je=new J({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"}}),te=new ds({props:{warning:!0,$$slots:{default:[da]},$$scope:{ctx:j}}}),je=new S({props:{title:"tool",local:"smolagents.tool",headingTag:"h3"}}),Ie=new J({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"}}),Ue=new S({props:{title:"Tool",local:"smolagents.Tool",headingTag:"h3"}}),ke=new J({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"}}),Ze=new J({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>
`}}),We=new J({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"}}),Be=new J({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"}}),se=new ds({props:{warning:!0,$$slots:{default:[ga]},$$scope:{ctx:j}}}),Pe=new J({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"}}),Ne=new J({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/en/reference/tools#smolagents.Tool">Tool</a></p>
`}}),le=new Tt({props:{anchor:"smolagents.Tool.from_space.example",$$slots:{default:[ua]},$$scope:{ctx:j}}}),re=new Tt({props:{anchor:"smolagents.Tool.from_space.example-2",$$slots:{default:[ha]},$$scope:{ctx:j}}}),Ae=new J({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"}}),Ve=new J({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"}}),Se=new J({props:{name:"setup",anchor:"smolagents.Tool.setup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/tools.py#L251"}}),He=new J({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"}}),Ee=new S({props:{title:"launch_gradio_demo",local:"smolagents.launch_gradio_demo",headingTag:"h3"}}),Le=new J({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 S({props:{title:"ToolCollection",local:"smolagents.ToolCollection",headingTag:"h2"}}),De=new J({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"}}),Re=new J({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>
`}}),pe=new Tt({props:{anchor:"smolagents.ToolCollection.from_hub.example",$$slots:{default:[fa]},$$scope:{ctx:j}}}),Qe=new J({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>
`}}),de=new Tt({props:{anchor:"smolagents.ToolCollection.from_mcp.example",$$slots:{default:[ba]},$$scope:{ctx:j}}}),ge=new Tt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-2",$$slots:{default:[$a]},$$scope:{ctx:j}}}),ue=new Tt({props:{anchor:"smolagents.ToolCollection.from_mcp.example-3",$$slots:{default:[va]},$$scope:{ctx:j}}}),Ye=new S({props:{title:"MCP Client",local:"smolagents.MCPClient",headingTag:"h2"}}),qe=new J({props:{name:"class smolagents.MCPClient",anchor:"smolagents.MCPClient",parameters:[{name:"server_parameters",val:": 'StdioServerParameters' | dict[str, Any] | list['StdioServerParameters' | dict[str, Any]]"},{name:"adapter_kwargs",val:": dict[str, Any] | None = None"},{name:"structured_output",val:": bool | None = None"}],parametersDescription:[{anchor:"smolagents.MCPClient.server_parameters",description:`<strong>server_parameters</strong> (StdioServerParameters | dict[str, Any] | list[StdioServerParameters | dict[str, Any]]) &#x2014;
Configuration parameters to connect to the MCP server. Can be a list if you want to connect multiple MCPs at once.</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.MCPClient.adapter_kwargs",description:`<strong>adapter_kwargs</strong> (dict[str, Any], optional) &#x2014;
Additional keyword arguments to be passed directly to <code>MCPAdapt</code>.`,name:"adapter_kwargs"},{anchor:"smolagents.MCPClient.structured_output",description:`<strong>structured_output</strong> (bool, optional, defaults to False) &#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/mcp_client.py#L33"}}),he=new Tt({props:{anchor:"smolagents.MCPClient.example",$$slots:{default:[ya]},$$scope:{ctx:j}}}),Xe=new J({props:{name:"connect",anchor:"smolagents.MCPClient.connect",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/mcp_client.py#L124"}}),ze=new J({props:{name:"disconnect",anchor:"smolagents.MCPClient.disconnect",parameters:[{name:"exc_type",val:": type[BaseException] | None = None"},{name:"exc_value",val:": BaseException | None = None"},{name:"exc_traceback",val:": TracebackType | None = None"}],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/mcp_client.py#L128"}}),Ke=new J({props:{name:"get_tools",anchor:"smolagents.MCPClient.get_tools",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.22.0/src/smolagents/mcp_client.py#L137",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>The SmolAgents tools available from the MCP server.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p>list[Tool]</p>
`,raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> — If the MCP server tools is None (usually assuming the server is not started).</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),Oe=new S({props:{title:"Agent Types",local:"agent-types",headingTag:"h2"}}),st=new S({props:{title:"AgentText",local:"smolagents.AgentText",headingTag:"h3"}}),at=new J({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"}}),lt=new S({props:{title:"AgentImage",local:"smolagents.AgentImage",headingTag:"h3"}}),rt=new J({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"}}),it=new J({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"}}),ct=new J({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"}}),mt=new J({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"}}),pt=new S({props:{title:"AgentAudio",local:"smolagents.AgentAudio",headingTag:"h3"}}),dt=new J({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"}}),gt=new J({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"}}),ut=new J({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"}}),ht=new ma({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/reference/tools.md"}}),{c(){l=i("meta"),T=o(),m=i("p"),d=o(),g(y.$$.fragment),s=o(),g(_.$$.fragment),mo=o(),g(ee.$$.fragment),po=o(),Me=i("p"),Me.innerHTML=gs,go=o(),g(xe.$$.fragment),uo=o(),g(Ce.$$.fragment),ho=o(),H=i("div"),g(Je.$$.fragment),zo=o(),wt=i("p"),wt.textContent=us,Ko=o(),g(te.$$.fragment),fo=o(),g(je.$$.fragment),bo=o(),Y=i("div"),g(Ie.$$.fragment),Oo=o(),Mt=i("p"),Mt.textContent=hs,$o=o(),g(Ue.$$.fragment),vo=o(),w=i("div"),g(ke.$$.fragment),en=o(),xt=i("p"),xt.innerHTML=fs,tn=o(),Ct=i("ul"),Ct.innerHTML=bs,on=o(),Jt=i("p"),Jt.innerHTML=$s,nn=o(),oe=i("div"),g(Ze.$$.fragment),sn=o(),jt=i("p"),jt.textContent=vs,an=o(),ne=i("div"),g(We.$$.fragment),ln=o(),It=i("p"),It.innerHTML=ys,rn=o(),L=i("div"),g(Be.$$.fragment),cn=o(),Ut=i("p"),Ut.textContent=Ts,mn=o(),g(se.$$.fragment),pn=o(),ae=i("div"),g(Pe.$$.fragment),dn=o(),kt=i("p"),kt.innerHTML=_s,gn=o(),V=i("div"),g(Ne.$$.fragment),un=o(),Zt=i("p"),Zt.innerHTML=ws,hn=o(),g(le.$$.fragment),fn=o(),g(re.$$.fragment),bn=o(),ie=i("div"),g(Ae.$$.fragment),$n=o(),Wt=i("p"),Wt.textContent=Ms,vn=o(),G=i("div"),g(Ve.$$.fragment),yn=o(),Bt=i("p"),Bt.innerHTML=xs,Tn=o(),Pt=i("ul"),Pt.innerHTML=Cs,_n=o(),ce=i("div"),g(Se.$$.fragment),wn=o(),Nt=i("p"),Nt.textContent=Js,Mn=o(),me=i("div"),g(He.$$.fragment),xn=o(),At=i("p"),At.textContent=js,yo=o(),g(Ee.$$.fragment),To=o(),q=i("div"),g(Le.$$.fragment),Cn=o(),Vt=i("p"),Vt.innerHTML=Is,_o=o(),g(Ge.$$.fragment),wo=o(),I=i("div"),g(De.$$.fragment),Jn=o(),St=i("p"),St.textContent=Us,jn=o(),Ht=i("p"),Ht.textContent=ks,In=o(),Et=i("ul"),Et.innerHTML=Zs,Un=o(),Lt=i("p"),Lt.innerHTML=Ws,kn=o(),W=i("div"),g(Re.$$.fragment),Zn=o(),Gt=i("p"),Gt.textContent=Bs,Wn=o(),Dt=i("p"),Dt.textContent=Ps,Bn=o(),Fe=i("blockquote"),Fe.innerHTML=Ns,Pn=o(),g(pe.$$.fragment),Nn=o(),k=i("div"),g(Qe.$$.fragment),An=o(),Rt=i("p"),Rt.textContent=As,Vn=o(),Ft=i("p"),Ft.innerHTML=Vs,Sn=o(),Qt=i("p"),Qt.textContent=Ss,Hn=o(),g(de.$$.fragment),En=o(),g(ge.$$.fragment),Ln=o(),g(ue.$$.fragment),Mo=o(),g(Ye.$$.fragment),xo=o(),U=i("div"),g(qe.$$.fragment),Gn=o(),Yt=i("p"),Yt.textContent=Hs,Dn=o(),qt=i("p"),qt.innerHTML=Es,Rn=o(),g(he.$$.fragment),Fn=o(),fe=i("div"),g(Xe.$$.fragment),Qn=o(),Xt=i("p"),Xt.textContent=Ls,Yn=o(),be=i("div"),g(ze.$$.fragment),qn=o(),zt=i("p"),zt.textContent=Gs,Xn=o(),D=i("div"),g(Ke.$$.fragment),zn=o(),Kt=i("p"),Kt.textContent=Ds,Kn=o(),Ot=i("p"),Ot.textContent=Rs,Co=o(),g(Oe.$$.fragment),Jo=o(),et=i("p"),et.textContent=Fs,jo=o(),tt=i("p"),tt.innerHTML=Qs,Io=o(),ot=i("p"),ot.textContent=Ys,Uo=o(),nt=i("ul"),nt.innerHTML=qs,ko=o(),g(st.$$.fragment),Zo=o(),X=i("div"),g(at.$$.fragment),On=o(),eo=i("p"),eo.textContent=Xs,Wo=o(),g(lt.$$.fragment),Bo=o(),Z=i("div"),g(rt.$$.fragment),es=o(),to=i("p"),to.textContent=zs,ts=o(),$e=i("div"),g(it.$$.fragment),os=o(),oo=i("p"),oo.textContent=Ks,ns=o(),ve=i("div"),g(ct.$$.fragment),ss=o(),no=i("p"),no.textContent=Os,as=o(),ye=i("div"),g(mt.$$.fragment),ls=o(),so=i("p"),so.textContent=ea,Po=o(),g(pt.$$.fragment),No=o(),A=i("div"),g(dt.$$.fragment),rs=o(),ao=i("p"),ao.textContent=ta,is=o(),Te=i("div"),g(gt.$$.fragment),cs=o(),lo=i("p"),lo.innerHTML=oa,ms=o(),_e=i("div"),g(ut.$$.fragment),ps=o(),ro=i("p"),ro.textContent=na,Ao=o(),g(ht.$$.fragment),Vo=o(),co=i("p"),this.h()},l(e){const r=ia("svelte-u9bgzb",document.head);l=c(r,"META",{name:!0,content:!0}),r.forEach(a),T=n(e),m=c(e,"P",{}),x(m).forEach(a),d=n(e),u(y.$$.fragment,e),s=n(e),u(_.$$.fragment,e),mo=n(e),u(ee.$$.fragment,e),po=n(e),Me=c(e,"P",{"data-svelte-h":!0}),v(Me)!=="svelte-17nnzxz"&&(Me.innerHTML=gs),go=n(e),u(xe.$$.fragment,e),uo=n(e),u(Ce.$$.fragment,e),ho=n(e),H=c(e,"DIV",{class:!0});var z=x(H);u(Je.$$.fragment,z),zo=n(z),wt=c(z,"P",{"data-svelte-h":!0}),v(wt)!=="svelte-fgf0mn"&&(wt.textContent=us),Ko=n(z),u(te.$$.fragment,z),z.forEach(a),fo=n(e),u(je.$$.fragment,e),bo=n(e),Y=c(e,"DIV",{class:!0});var ft=x(Y);u(Ie.$$.fragment,ft),Oo=n(ft),Mt=c(ft,"P",{"data-svelte-h":!0}),v(Mt)!=="svelte-1yvj8b1"&&(Mt.textContent=hs),ft.forEach(a),$o=n(e),u(Ue.$$.fragment,e),vo=n(e),w=c(e,"DIV",{class:!0});var C=x(w);u(ke.$$.fragment,C),en=n(C),xt=c(C,"P",{"data-svelte-h":!0}),v(xt)!=="svelte-1poxk5s"&&(xt.innerHTML=fs),tn=n(C),Ct=c(C,"UL",{"data-svelte-h":!0}),v(Ct)!=="svelte-wwkyr"&&(Ct.innerHTML=bs),on=n(C),Jt=c(C,"P",{"data-svelte-h":!0}),v(Jt)!=="svelte-1bc29gu"&&(Jt.innerHTML=$s),nn=n(C),oe=c(C,"DIV",{class:!0});var bt=x(oe);u(Ze.$$.fragment,bt),sn=n(bt),jt=c(bt,"P",{"data-svelte-h":!0}),v(jt)!=="svelte-2agex6"&&(jt.textContent=vs),bt.forEach(a),an=n(C),ne=c(C,"DIV",{class:!0});var $t=x(ne);u(We.$$.fragment,$t),ln=n($t),It=c($t,"P",{"data-svelte-h":!0}),v(It)!=="svelte-7ayhwa"&&(It.innerHTML=ys),$t.forEach(a),rn=n(C),L=c(C,"DIV",{class:!0});var K=x(L);u(Be.$$.fragment,K),cn=n(K),Ut=c(K,"P",{"data-svelte-h":!0}),v(Ut)!=="svelte-yy7b2c"&&(Ut.textContent=Ts),mn=n(K),u(se.$$.fragment,K),K.forEach(a),pn=n(C),ae=c(C,"DIV",{class:!0});var vt=x(ae);u(Pe.$$.fragment,vt),dn=n(vt),kt=c(vt,"P",{"data-svelte-h":!0}),v(kt)!=="svelte-hk0ndt"&&(kt.innerHTML=_s),vt.forEach(a),gn=n(C),V=c(C,"DIV",{class:!0});var E=x(V);u(Ne.$$.fragment,E),un=n(E),Zt=c(E,"P",{"data-svelte-h":!0}),v(Zt)!=="svelte-3clht1"&&(Zt.innerHTML=ws),hn=n(E),u(le.$$.fragment,E),fn=n(E),u(re.$$.fragment,E),E.forEach(a),bn=n(C),ie=c(C,"DIV",{class:!0});var yt=x(ie);u(Ae.$$.fragment,yt),$n=n(yt),Wt=c(yt,"P",{"data-svelte-h":!0}),v(Wt)!=="svelte-1u3gku9"&&(Wt.textContent=Ms),yt.forEach(a),vn=n(C),G=c(C,"DIV",{class:!0});var O=x(G);u(Ve.$$.fragment,O),yn=n(O),Bt=c(O,"P",{"data-svelte-h":!0}),v(Bt)!=="svelte-19evuwa"&&(Bt.innerHTML=xs),Tn=n(O),Pt=c(O,"UL",{"data-svelte-h":!0}),v(Pt)!=="svelte-1s62xm4"&&(Pt.innerHTML=Cs),O.forEach(a),_n=n(C),ce=c(C,"DIV",{class:!0});var Ho=x(ce);u(Se.$$.fragment,Ho),wn=n(Ho),Nt=c(Ho,"P",{"data-svelte-h":!0}),v(Nt)!=="svelte-63kthh"&&(Nt.textContent=Js),Ho.forEach(a),Mn=n(C),me=c(C,"DIV",{class:!0});var Eo=x(me);u(He.$$.fragment,Eo),xn=n(Eo),At=c(Eo,"P",{"data-svelte-h":!0}),v(At)!=="svelte-1l397l"&&(At.textContent=js),Eo.forEach(a),C.forEach(a),yo=n(e),u(Ee.$$.fragment,e),To=n(e),q=c(e,"DIV",{class:!0});var Lo=x(q);u(Le.$$.fragment,Lo),Cn=n(Lo),Vt=c(Lo,"P",{"data-svelte-h":!0}),v(Vt)!=="svelte-j4u4it"&&(Vt.innerHTML=Is),Lo.forEach(a),_o=n(e),u(Ge.$$.fragment,e),wo=n(e),I=c(e,"DIV",{class:!0});var B=x(I);u(De.$$.fragment,B),Jn=n(B),St=c(B,"P",{"data-svelte-h":!0}),v(St)!=="svelte-g073wf"&&(St.textContent=Us),jn=n(B),Ht=c(B,"P",{"data-svelte-h":!0}),v(Ht)!=="svelte-wb0eyv"&&(Ht.textContent=ks),In=n(B),Et=c(B,"UL",{"data-svelte-h":!0}),v(Et)!=="svelte-yntzea"&&(Et.innerHTML=Zs),Un=n(B),Lt=c(B,"P",{"data-svelte-h":!0}),v(Lt)!=="svelte-kas1t9"&&(Lt.innerHTML=Ws),kn=n(B),W=c(B,"DIV",{class:!0});var R=x(W);u(Re.$$.fragment,R),Zn=n(R),Gt=c(R,"P",{"data-svelte-h":!0}),v(Gt)!=="svelte-pdgtcq"&&(Gt.textContent=Bs),Wn=n(R),Dt=c(R,"P",{"data-svelte-h":!0}),v(Dt)!=="svelte-b4jhp8"&&(Dt.textContent=Ps),Bn=n(R),Fe=c(R,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),v(Fe)!=="svelte-1i2n8tt"&&(Fe.innerHTML=Ns),Pn=n(R),u(pe.$$.fragment,R),R.forEach(a),Nn=n(B),k=c(B,"DIV",{class:!0});var P=x(k);u(Qe.$$.fragment,P),An=n(P),Rt=c(P,"P",{"data-svelte-h":!0}),v(Rt)!=="svelte-tdu9dm"&&(Rt.textContent=As),Vn=n(P),Ft=c(P,"P",{"data-svelte-h":!0}),v(Ft)!=="svelte-ovzouy"&&(Ft.innerHTML=Vs),Sn=n(P),Qt=c(P,"P",{"data-svelte-h":!0}),v(Qt)!=="svelte-17y4fsr"&&(Qt.textContent=Ss),Hn=n(P),u(de.$$.fragment,P),En=n(P),u(ge.$$.fragment,P),Ln=n(P),u(ue.$$.fragment,P),P.forEach(a),B.forEach(a),Mo=n(e),u(Ye.$$.fragment,e),xo=n(e),U=c(e,"DIV",{class:!0});var N=x(U);u(qe.$$.fragment,N),Gn=n(N),Yt=c(N,"P",{"data-svelte-h":!0}),v(Yt)!=="svelte-1li5bg5"&&(Yt.textContent=Hs),Dn=n(N),qt=c(N,"P",{"data-svelte-h":!0}),v(qt)!=="svelte-17v54jk"&&(qt.innerHTML=Es),Rn=n(N),u(he.$$.fragment,N),Fn=n(N),fe=c(N,"DIV",{class:!0});var Go=x(fe);u(Xe.$$.fragment,Go),Qn=n(Go),Xt=c(Go,"P",{"data-svelte-h":!0}),v(Xt)!=="svelte-9sr97u"&&(Xt.textContent=Ls),Go.forEach(a),Yn=n(N),be=c(N,"DIV",{class:!0});var Do=x(be);u(ze.$$.fragment,Do),qn=n(Do),zt=c(Do,"P",{"data-svelte-h":!0}),v(zt)!=="svelte-aq9jm8"&&(zt.textContent=Gs),Do.forEach(a),Xn=n(N),D=c(N,"DIV",{class:!0});var io=x(D);u(Ke.$$.fragment,io),zn=n(io),Kt=c(io,"P",{"data-svelte-h":!0}),v(Kt)!=="svelte-1jb0ikk"&&(Kt.textContent=Ds),Kn=n(io),Ot=c(io,"P",{"data-svelte-h":!0}),v(Ot)!=="svelte-1smt0wn"&&(Ot.textContent=Rs),io.forEach(a),N.forEach(a),Co=n(e),u(Oe.$$.fragment,e),Jo=n(e),et=c(e,"P",{"data-svelte-h":!0}),v(et)!=="svelte-jsq4jz"&&(et.textContent=Fs),jo=n(e),tt=c(e,"P",{"data-svelte-h":!0}),v(tt)!=="svelte-1ixcu88"&&(tt.innerHTML=Qs),Io=n(e),ot=c(e,"P",{"data-svelte-h":!0}),v(ot)!=="svelte-1nfvcwf"&&(ot.textContent=Ys),Uo=n(e),nt=c(e,"UL",{"data-svelte-h":!0}),v(nt)!=="svelte-ysem30"&&(nt.innerHTML=qs),ko=n(e),u(st.$$.fragment,e),Zo=n(e),X=c(e,"DIV",{class:!0});var Ro=x(X);u(at.$$.fragment,Ro),On=n(Ro),eo=c(Ro,"P",{"data-svelte-h":!0}),v(eo)!=="svelte-57fhj7"&&(eo.textContent=Xs),Ro.forEach(a),Wo=n(e),u(lt.$$.fragment,e),Bo=n(e),Z=c(e,"DIV",{class:!0});var F=x(Z);u(rt.$$.fragment,F),es=n(F),to=c(F,"P",{"data-svelte-h":!0}),v(to)!=="svelte-1qa18j9"&&(to.textContent=zs),ts=n(F),$e=c(F,"DIV",{class:!0});var Fo=x($e);u(it.$$.fragment,Fo),os=n(Fo),oo=c(Fo,"P",{"data-svelte-h":!0}),v(oo)!=="svelte-qix5eq"&&(oo.textContent=Ks),Fo.forEach(a),ns=n(F),ve=c(F,"DIV",{class:!0});var Qo=x(ve);u(ct.$$.fragment,Qo),ss=n(Qo),no=c(Qo,"P",{"data-svelte-h":!0}),v(no)!=="svelte-xppdw9"&&(no.textContent=Os),Qo.forEach(a),as=n(F),ye=c(F,"DIV",{class:!0});var Yo=x(ye);u(mt.$$.fragment,Yo),ls=n(Yo),so=c(Yo,"P",{"data-svelte-h":!0}),v(so)!=="svelte-chc6sp"&&(so.textContent=ea),Yo.forEach(a),F.forEach(a),Po=n(e),u(pt.$$.fragment,e),No=n(e),A=c(e,"DIV",{class:!0});var we=x(A);u(dt.$$.fragment,we),rs=n(we),ao=c(we,"P",{"data-svelte-h":!0}),v(ao)!=="svelte-ckiqb6"&&(ao.textContent=ta),is=n(we),Te=c(we,"DIV",{class:!0});var qo=x(Te);u(gt.$$.fragment,qo),cs=n(qo),lo=c(qo,"P",{"data-svelte-h":!0}),v(lo)!=="svelte-10rnn1x"&&(lo.innerHTML=oa),qo.forEach(a),ms=n(we),_e=c(we,"DIV",{class:!0});var Xo=x(_e);u(ut.$$.fragment,Xo),ps=n(Xo),ro=c(Xo,"P",{"data-svelte-h":!0}),v(ro)!=="svelte-1xu9o93"&&(ro.textContent=na),Xo.forEach(a),we.forEach(a),Ao=n(e),u(ht.$$.fragment,e),Vo=n(e),co=c(e,"P",{}),x(co).forEach(a),this.h()},h(){M(l,"name","hf:doc:metadata"),M(l,"content",_a),M(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(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(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Fe,"class","note"),M(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(X,"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,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(Te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),M(A,"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,r){t(document.head,l),p(e,T,r),p(e,m,r),p(e,d,r),h(y,e,r),p(e,s,r),h(_,e,r),p(e,mo,r),h(ee,e,r),p(e,po,r),p(e,Me,r),p(e,go,r),h(xe,e,r),p(e,uo,r),h(Ce,e,r),p(e,ho,r),p(e,H,r),h(Je,H,null),t(H,zo),t(H,wt),t(H,Ko),h(te,H,null),p(e,fo,r),h(je,e,r),p(e,bo,r),p(e,Y,r),h(Ie,Y,null),t(Y,Oo),t(Y,Mt),p(e,$o,r),h(Ue,e,r),p(e,vo,r),p(e,w,r),h(ke,w,null),t(w,en),t(w,xt),t(w,tn),t(w,Ct),t(w,on),t(w,Jt),t(w,nn),t(w,oe),h(Ze,oe,null),t(oe,sn),t(oe,jt),t(w,an),t(w,ne),h(We,ne,null),t(ne,ln),t(ne,It),t(w,rn),t(w,L),h(Be,L,null),t(L,cn),t(L,Ut),t(L,mn),h(se,L,null),t(w,pn),t(w,ae),h(Pe,ae,null),t(ae,dn),t(ae,kt),t(w,gn),t(w,V),h(Ne,V,null),t(V,un),t(V,Zt),t(V,hn),h(le,V,null),t(V,fn),h(re,V,null),t(w,bn),t(w,ie),h(Ae,ie,null),t(ie,$n),t(ie,Wt),t(w,vn),t(w,G),h(Ve,G,null),t(G,yn),t(G,Bt),t(G,Tn),t(G,Pt),t(w,_n),t(w,ce),h(Se,ce,null),t(ce,wn),t(ce,Nt),t(w,Mn),t(w,me),h(He,me,null),t(me,xn),t(me,At),p(e,yo,r),h(Ee,e,r),p(e,To,r),p(e,q,r),h(Le,q,null),t(q,Cn),t(q,Vt),p(e,_o,r),h(Ge,e,r),p(e,wo,r),p(e,I,r),h(De,I,null),t(I,Jn),t(I,St),t(I,jn),t(I,Ht),t(I,In),t(I,Et),t(I,Un),t(I,Lt),t(I,kn),t(I,W),h(Re,W,null),t(W,Zn),t(W,Gt),t(W,Wn),t(W,Dt),t(W,Bn),t(W,Fe),t(W,Pn),h(pe,W,null),t(I,Nn),t(I,k),h(Qe,k,null),t(k,An),t(k,Rt),t(k,Vn),t(k,Ft),t(k,Sn),t(k,Qt),t(k,Hn),h(de,k,null),t(k,En),h(ge,k,null),t(k,Ln),h(ue,k,null),p(e,Mo,r),h(Ye,e,r),p(e,xo,r),p(e,U,r),h(qe,U,null),t(U,Gn),t(U,Yt),t(U,Dn),t(U,qt),t(U,Rn),h(he,U,null),t(U,Fn),t(U,fe),h(Xe,fe,null),t(fe,Qn),t(fe,Xt),t(U,Yn),t(U,be),h(ze,be,null),t(be,qn),t(be,zt),t(U,Xn),t(U,D),h(Ke,D,null),t(D,zn),t(D,Kt),t(D,Kn),t(D,Ot),p(e,Co,r),h(Oe,e,r),p(e,Jo,r),p(e,et,r),p(e,jo,r),p(e,tt,r),p(e,Io,r),p(e,ot,r),p(e,Uo,r),p(e,nt,r),p(e,ko,r),h(st,e,r),p(e,Zo,r),p(e,X,r),h(at,X,null),t(X,On),t(X,eo),p(e,Wo,r),h(lt,e,r),p(e,Bo,r),p(e,Z,r),h(rt,Z,null),t(Z,es),t(Z,to),t(Z,ts),t(Z,$e),h(it,$e,null),t($e,os),t($e,oo),t(Z,ns),t(Z,ve),h(ct,ve,null),t(ve,ss),t(ve,no),t(Z,as),t(Z,ye),h(mt,ye,null),t(ye,ls),t(ye,so),p(e,Po,r),h(pt,e,r),p(e,No,r),p(e,A,r),h(dt,A,null),t(A,rs),t(A,ao),t(A,is),t(A,Te),h(gt,Te,null),t(Te,cs),t(Te,lo),t(A,ms),t(A,_e),h(ut,_e,null),t(_e,ps),t(_e,ro),p(e,Ao,r),h(ht,e,r),p(e,Vo,r),p(e,co,r),So=!0},p(e,[r]){const z={};r&2&&(z.$$scope={dirty:r,ctx:e}),ee.$set(z);const ft={};r&2&&(ft.$$scope={dirty:r,ctx:e}),te.$set(ft);const C={};r&2&&(C.$$scope={dirty:r,ctx:e}),se.$set(C);const bt={};r&2&&(bt.$$scope={dirty:r,ctx:e}),le.$set(bt);const $t={};r&2&&($t.$$scope={dirty:r,ctx:e}),re.$set($t);const K={};r&2&&(K.$$scope={dirty:r,ctx:e}),pe.$set(K);const vt={};r&2&&(vt.$$scope={dirty:r,ctx:e}),de.$set(vt);const E={};r&2&&(E.$$scope={dirty:r,ctx:e}),ge.$set(E);const yt={};r&2&&(yt.$$scope={dirty:r,ctx:e}),ue.$set(yt);const O={};r&2&&(O.$$scope={dirty:r,ctx:e}),he.$set(O)},i(e){So||(f(y.$$.fragment,e),f(_.$$.fragment,e),f(ee.$$.fragment,e),f(xe.$$.fragment,e),f(Ce.$$.fragment,e),f(Je.$$.fragment,e),f(te.$$.fragment,e),f(je.$$.fragment,e),f(Ie.$$.fragment,e),f(Ue.$$.fragment,e),f(ke.$$.fragment,e),f(Ze.$$.fragment,e),f(We.$$.fragment,e),f(Be.$$.fragment,e),f(se.$$.fragment,e),f(Pe.$$.fragment,e),f(Ne.$$.fragment,e),f(le.$$.fragment,e),f(re.$$.fragment,e),f(Ae.$$.fragment,e),f(Ve.$$.fragment,e),f(Se.$$.fragment,e),f(He.$$.fragment,e),f(Ee.$$.fragment,e),f(Le.$$.fragment,e),f(Ge.$$.fragment,e),f(De.$$.fragment,e),f(Re.$$.fragment,e),f(pe.$$.fragment,e),f(Qe.$$.fragment,e),f(de.$$.fragment,e),f(ge.$$.fragment,e),f(ue.$$.fragment,e),f(Ye.$$.fragment,e),f(qe.$$.fragment,e),f(he.$$.fragment,e),f(Xe.$$.fragment,e),f(ze.$$.fragment,e),f(Ke.$$.fragment,e),f(Oe.$$.fragment,e),f(st.$$.fragment,e),f(at.$$.fragment,e),f(lt.$$.fragment,e),f(rt.$$.fragment,e),f(it.$$.fragment,e),f(ct.$$.fragment,e),f(mt.$$.fragment,e),f(pt.$$.fragment,e),f(dt.$$.fragment,e),f(gt.$$.fragment,e),f(ut.$$.fragment,e),f(ht.$$.fragment,e),So=!0)},o(e){b(y.$$.fragment,e),b(_.$$.fragment,e),b(ee.$$.fragment,e),b(xe.$$.fragment,e),b(Ce.$$.fragment,e),b(Je.$$.fragment,e),b(te.$$.fragment,e),b(je.$$.fragment,e),b(Ie.$$.fragment,e),b(Ue.$$.fragment,e),b(ke.$$.fragment,e),b(Ze.$$.fragment,e),b(We.$$.fragment,e),b(Be.$$.fragment,e),b(se.$$.fragment,e),b(Pe.$$.fragment,e),b(Ne.$$.fragment,e),b(le.$$.fragment,e),b(re.$$.fragment,e),b(Ae.$$.fragment,e),b(Ve.$$.fragment,e),b(Se.$$.fragment,e),b(He.$$.fragment,e),b(Ee.$$.fragment,e),b(Le.$$.fragment,e),b(Ge.$$.fragment,e),b(De.$$.fragment,e),b(Re.$$.fragment,e),b(pe.$$.fragment,e),b(Qe.$$.fragment,e),b(de.$$.fragment,e),b(ge.$$.fragment,e),b(ue.$$.fragment,e),b(Ye.$$.fragment,e),b(qe.$$.fragment,e),b(he.$$.fragment,e),b(Xe.$$.fragment,e),b(ze.$$.fragment,e),b(Ke.$$.fragment,e),b(Oe.$$.fragment,e),b(st.$$.fragment,e),b(at.$$.fragment,e),b(lt.$$.fragment,e),b(rt.$$.fragment,e),b(it.$$.fragment,e),b(ct.$$.fragment,e),b(mt.$$.fragment,e),b(pt.$$.fragment,e),b(dt.$$.fragment,e),b(gt.$$.fragment,e),b(ut.$$.fragment,e),b(ht.$$.fragment,e),So=!1},d(e){e&&(a(T),a(m),a(d),a(s),a(mo),a(po),a(Me),a(go),a(uo),a(ho),a(H),a(fo),a(bo),a(Y),a($o),a(vo),a(w),a(yo),a(To),a(q),a(_o),a(wo),a(I),a(Mo),a(xo),a(U),a(Co),a(Jo),a(et),a(jo),a(tt),a(Io),a(ot),a(Uo),a(nt),a(ko),a(Zo),a(X),a(Wo),a(Bo),a(Z),a(Po),a(No),a(A),a(Ao),a(Vo),a(co)),a(l),$(y,e),$(_,e),$(ee,e),$(xe,e),$(Ce,e),$(Je),$(te),$(je,e),$(Ie),$(Ue,e),$(ke),$(Ze),$(We),$(Be),$(se),$(Pe),$(Ne),$(le),$(re),$(Ae),$(Ve),$(Se),$(He),$(Ee,e),$(Le),$(Ge,e),$(De),$(Re),$(pe),$(Qe),$(de),$(ge),$(ue),$(Ye,e),$(qe),$(he),$(Xe),$(ze),$(Ke),$(Oe,e),$(st,e),$(at),$(lt,e),$(rt),$(it),$(ct),$(mt),$(pt,e),$(dt),$(gt),$(ut),$(ht,e)}}}const _a='{"title":"Tools","local":"tools","sections":[{"title":"Tool Base Classes","local":"tool-base-classes","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":"ToolCollection","local":"smolagents.ToolCollection","sections":[],"depth":2},{"title":"MCP Client","local":"smolagents.MCPClient","sections":[],"depth":2},{"title":"Agent Types","local":"agent-types","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 wa(j){return aa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ua extends la{constructor(l){super(),ra(this,l,wa,Ta,sa,{})}}export{Ua as component};
