import{s as oa,o as na,n as Q}from"../chunks/scheduler.f6319a2a.js";import{S as sa,i as aa,g as r,s as o,r as g,A as la,h as i,f as a,c as n,j as M,u,x as v,k as x,y as t,a as d,v as h,d as f,t as b,w as $}from"../chunks/index.85aa684c.js";import{T as ms}from"../chunks/Tip.3d397a88.js";import{D as J,E as vt}from"../chunks/ExampleCodeBlock.3d8cc3b7.js";import{C as yt}from"../chunks/CodeBlock.3400fc53.js";import{H as S,E as ra}from"../chunks/getInferenceSnippets.55a93fbe.js";function ia(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=r("p"),l.textContent=T},l(m){l=i(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-19v5hvw"&&(l.textContent=T)},m(m,p){d(m,l,p)},p:Q,d(m){m&&a(l)}}}function ca(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=r("p"),l.textContent=T},l(m){l=i(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-1kcherd"&&(l.textContent=T)},m(m,p){d(m,l,p)},p:Q,d(m){m&&a(l)}}}function ma(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=r("p"),l.textContent=T},l(m){l=i(m,"P",{"data-svelte-h":!0}),v(l)!=="svelte-fpk7e5"&&(l.textContent=T)},m(m,p){d(m,l,p)},p:Q,d(m){m&&a(l)}}}function da(j){let l,T="Examples:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-kvfsh7"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function pa(j){let l,T;return l=new yt({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,p){h(l,m,p),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 ga(j){let l,T="Example:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-11lpom8"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function ua(j){let l,T="Example with a Stdio MCP server:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-49dhgx"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function ha(j){let l,T="Example with structured output enabled:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-ghl0yb"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function fa(j){let l,T="Example with a Streamable HTTP MCP server:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-178fndi"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function ba(j){let l,T="Example:",m,p,y;return p=new yt({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=r("p"),l.textContent=T,m=o(),g(p.$$.fragment)},l(s){l=i(s,"P",{"data-svelte-h":!0}),v(l)!=="svelte-11lpom8"&&(l.textContent=T),m=n(s),u(p.$$.fragment,s)},m(s,_){d(s,l,_),d(s,m,_),h(p,s,_),y=!0},p:Q,i(s){y||(f(p.$$.fragment,s),y=!0)},o(s){b(p.$$.fragment,s),y=!1},d(s){s&&(a(l),a(m)),$(p,s)}}}function $a(j){let l,T,m,p,y,s,_,co,we,ds=`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.`,mo,Me,po,xe,go,H,Ce,qo,Tt,ps="Main function to quickly load a tool from the Hub.",Xo,ee,uo,Je,ho,Y,je,zo,_t,gs="Convert a function into an instance of a dynamically created Tool subclass.",fo,Ie,bo,w,Ue,Ko,wt,us=`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:`,Oo,Mt,hs=`<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>`,en,xt,fs=`You can also override the method <a href="/docs/smolagents/main/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/main/en/reference/tools#smolagents.Tool.setup">setup()</a> will be called the first time you use your tool, but not at
instantiation.`,tn,te,ke,on,Ct,bs="Create tool from a dictionary representation.",nn,oe,Ze,sn,Jt,$s='Creates a <a href="/docs/smolagents/main/en/reference/tools#smolagents.Tool">Tool</a> from a gradio tool.',an,G,We,ln,jt,vs="Loads a tool defined on the Hub.",rn,ne,cn,se,Be,mn,It,ys='Creates a <a href="/docs/smolagents/main/en/reference/tools#smolagents.Tool">Tool</a> from a langchain tool.',dn,V,Pe,pn,Ut,Ts='Creates a <a href="/docs/smolagents/main/en/reference/tools#smolagents.Tool">Tool</a> from a Space given its id on the Hub.',gn,ae,un,le,hn,re,Ne,fn,kt,_s="Upload the tool to the Hub.",bn,L,Ae,$n,Zt,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:`,vn,Wt,Ms=`<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>`,yn,ie,Ve,Tn,Bt,xs=`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.`,_n,ce,Se,wn,Pt,Cs="Returns a dictionary representing the tool",$o,He,vo,q,Ee,Mn,Nt,Js=`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>.`,yo,Ge,To,I,Le,xn,At,js="Tool collections enable loading a collection of tools in the agent’s toolbox.",Cn,Vt,Is="Collections can be loaded from a collection in the Hub or from an MCP server, see:",Jn,St,Us='<li><a href="/docs/smolagents/main/en/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a></li> <li><a href="/docs/smolagents/main/en/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a></li>',jn,Ht,ks='For example and usage, see: <a href="/docs/smolagents/main/en/reference/tools#smolagents.ToolCollection.from_hub">ToolCollection.from_hub()</a> and <a href="/docs/smolagents/main/en/reference/tools#smolagents.ToolCollection.from_mcp">ToolCollection.from_mcp()</a>',In,W,De,Un,Et,Zs="Loads a tool collection from the Hub.",kn,Gt,Ws="it adds a collection of tools from all Spaces in the collection to the agent’s toolbox",Zn,Lt,Bs=`<p>[!NOTE]
Only Spaces will be fetched, so you can feel free to add models and datasets to your collection if you’d
like for this collection to showcase them.</p>`,Wn,me,Bn,k,Re,Pn,Dt,Ps="Automatically load a tool collection from an MCP server.",Nn,Rt,Ns=`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.`,An,Ft,As=`Note: a separate thread will be spawned to run an asyncio event loop handling
the MCP server.`,Vn,de,Sn,pe,Hn,ge,_o,Fe,wo,U,Qe,En,Qt,Vs="Manages the connection to an MCP server and make its tools available to SmolAgents.",Gn,Yt,Ss=`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.`,Ln,ue,Dn,he,Ye,Rn,qt,Hs="Connect to the MCP server and initialize the tools.",Fn,fe,qe,Qn,Xt,Es="Disconnect from the MCP server",Yn,D,Xe,qn,zt,Gs="The SmolAgents tools available from the MCP server.",Xn,Kt,Ls=`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.`,Mo,ze,xo,Ke,Ds=`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.`,Co,Oe,Rs=`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>.`,Jo,et,Fs="These types have three specific purposes:",jo,tt,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>`,Io,ot,Uo,X,nt,zn,Ot,Ys="Text type returned by the agent. Behaves as a string.",ko,st,Zo,Z,at,Kn,eo,qs="Image type returned by the agent. Behaves as a PIL.Image.Image.",On,be,lt,es,to,Xs="Saves the image to a file.",ts,$e,rt,os,oo,zs="Returns the “raw” version of that object. In the case of an AgentImage, it is a PIL.Image.Image.",ns,ve,it,ss,no,Ks=`Returns the stringified version of that object. In the case of an AgentImage, it is a path to the serialized
version of the image.`,Wo,ct,Bo,A,mt,as,so,Os="Audio type returned by the agent.",ls,ye,dt,rs,ao,ea="Returns the “raw” version of that object. It is a <code>torch.Tensor</code> object.",is,Te,pt,cs,lo,ta=`Returns the stringified version of that object. In the case of an AgentAudio, it is a path to the serialized
version of the audio.`,Po,gt,No,io,Ao;return y=new S({props:{title:"Tools",local:"tools",headingTag:"h1"}}),_=new ms({props:{warning:!0,$$slots:{default:[ia]},$$scope:{ctx:j}}}),Me=new S({props:{title:"Tool Base Classes",local:"tool-base-classes",headingTag:"h2"}}),xe=new S({props:{title:"load_tool",local:"smolagents.load_tool",headingTag:"h3"}}),Ce=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/main/src/smolagents/tools.py#L840"}}),ee=new ms({props:{warning:!0,$$slots:{default:[ca]},$$scope:{ctx:j}}}),Je=new S({props:{title:"tool",local:"smolagents.tool",headingTag:"h3"}}),je=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/main/src/smolagents/tools.py#L1061"}}),Ie=new S({props:{title:"Tool",local:"smolagents.Tool",headingTag:"h3"}}),Ue=new J({props:{name:"class smolagents.Tool",anchor:"smolagents.Tool",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L106"}}),ke=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/main/src/smolagents/tools.py#L367",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><code>Tool</code></p>
`}}),Ze=new J({props:{name:"from_gradio",anchor:"smolagents.Tool.from_gradio",parameters:[{name:"gradio_tool",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L741"}}),We=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/main/src/smolagents/tools.py#L516"}}),ne=new ms({props:{warning:!0,$$slots:{default:[ma]},$$scope:{ctx:j}}}),Be=new J({props:{name:"from_langchain",anchor:"smolagents.Tool.from_langchain",parameters:[{name:"langchain_tool",val:""}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L762"}}),Pe=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/main/src/smolagents/tools.py#L599",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p><a href="/docs/smolagents/main/en/reference/tools#smolagents.Tool">Tool</a></p>
`}}),ae=new vt({props:{anchor:"smolagents.Tool.from_space.example",$$slots:{default:[da]},$$scope:{ctx:j}}}),le=new vt({props:{anchor:"smolagents.Tool.from_space.example-2",$$slots:{default:[pa]},$$scope:{ctx:j}}}),Ne=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/main/src/smolagents/tools.py#L421"}}),Ae=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/main/src/smolagents/tools.py#L390"}}),Ve=new J({props:{name:"setup",anchor:"smolagents.Tool.setup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L251"}}),Se=new J({props:{name:"to_dict",anchor:"smolagents.Tool.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L292"}}),He=new S({props:{title:"launch_gradio_demo",local:"smolagents.launch_gradio_demo",headingTag:"h3"}}),Ee=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/main/src/smolagents/tools.py#L794"}}),Ge=new S({props:{title:"ToolCollection",local:"smolagents.ToolCollection",headingTag:"h2"}}),Le=new J({props:{name:"class smolagents.ToolCollection",anchor:"smolagents.ToolCollection",parameters:[{name:"tools",val:": list[Tool]"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/tools.py#L895"}}),De=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/main/src/smolagents/tools.py#L909",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


<p>ToolCollection</p>
`}}),me=new vt({props:{anchor:"smolagents.ToolCollection.from_hub.example",$$slots:{default:[ga]},$$scope:{ctx:j}}}),Re=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/main/src/smolagents/tools.py#L949",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


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


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