import{s as Ls,o as zs,n as Y}from"../chunks/scheduler.3d32dc09.js";import{S as Ys,i as Ds,e as i,s,c,q as Os,h as Xs,a as T,d as l,b as a,f as L,g as m,j as U,r as Ss,k as Al,l as Z,m as t,n as g,t as h,o as b,p as I}from"../chunks/index.f9718211.js";import{C as qs,H as x,E as Ps}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.51ba2db0.js";import{C as E}from"../chunks/CodeBlock.4d1ab73b.js";import{D as Ks}from"../chunks/DocNotebookDropdown.6e97ed3d.js";import{H as Hs,a as z}from"../chunks/HfOption.7cc30e92.js";function ea(Q){let o,j="Inference Providers need a <code>HF_TOKEN</code> to authenticate, but a free HF account already comes with included credits. Upgrade to PRO to raise your included credits.",M,u,d='To access gated models or rise your rate limits with a PRO account, you need to set the environment variable <code>HF_TOKEN</code> or pass <code>token</code> variable upon initialization of <code>InferenceClientModel</code>. You can get your token from your <a href="https://huggingface.co/settings/tokens" rel="nofollow">settings page</a>',p,f,B;return f=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMy03MEItSW5zdHJ1Y3QlMjIlMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKG1vZGVsX2lkJTNEbW9kZWxfaWQlMkMlMjB0b2tlbiUzRCUyMiUzQ1lPVVJfSFVHR0lOR0ZBQ0VIVUJfQVBJX1RPS0VOJTNFJTIyKSUyMCUyMyUyMFlvdSUyMGNhbiUyMGNob29zZSUyMHRvJTIwbm90JTIwcGFzcyUyMGFueSUyMG1vZGVsX2lkJTIwdG8lMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUyMHRvJTIwdXNlJTIwYSUyMGRlZmF1bHQlMjBtb2RlbCUwQSUyMyUyMHlvdSUyMGNhbiUyMGFsc28lMjBzcGVjaWZ5JTIwYSUyMHBhcnRpY3VsYXIlMjBwcm92aWRlciUyMGUuZy4lMjBwcm92aWRlciUzRCUyMnRvZ2V0aGVyJTIyJTIwb3IlMjBwcm92aWRlciUzRCUyMnNhbWJhbm92YSUyMiUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

model_id = <span class="hljs-string">&quot;meta-llama/Llama-3.3-70B-Instruct&quot;</span>

model = InferenceClientModel(model_id=model_id, token=<span class="hljs-string">&quot;&lt;YOUR_HUGGINGFACEHUB_API_TOKEN&gt;&quot;</span>) <span class="hljs-comment"># You can choose to not pass any model_id to InferenceClientModel to use a default model</span>
<span class="hljs-comment"># you can also specify a particular provider e.g. provider=&quot;together&quot; or provider=&quot;sambanova&quot;</span>
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){o=i("p"),o.innerHTML=j,M=s(),u=i("p"),u.innerHTML=d,p=s(),c(f.$$.fragment)},l(r){o=T(r,"P",{"data-svelte-h":!0}),U(o)!=="svelte-1wdptq1"&&(o.innerHTML=j),M=a(r),u=T(r,"P",{"data-svelte-h":!0}),U(u)!=="svelte-bsbjyv"&&(u.innerHTML=d),p=a(r),m(f.$$.fragment,r)},m(r,N){t(r,o,N),t(r,M,N),t(r,u,N),t(r,p,N),g(f,r,N),B=!0},p:Y,i(r){B||(h(f.$$.fragment,r),B=!0)},o(r){b(f.$$.fragment,r),B=!1},d(r){r&&(l(o),l(M),l(u),l(p)),I(f,r)}}}function la(Q){let o,j;return o=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QnRyYW5zZm9ybWVycyU1RCclMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMFRyYW5zZm9ybWVyc01vZGVsJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4yLTNCLUluc3RydWN0JTIyJTBBJTBBbW9kZWwlMjAlM0QlMjBUcmFuc2Zvcm1lcnNNb2RlbChtb2RlbF9pZCUzRG1vZGVsX2lkKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[transformers]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, TransformersModel

model_id = <span class="hljs-string">&quot;meta-llama/Llama-3.2-3B-Instruct&quot;</span>

model = TransformersModel(model_id=model_id)
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){c(o.$$.fragment)},l(M){m(o.$$.fragment,M)},m(M,u){g(o,M,u),j=!0},p:Y,i(M){j||(h(o.$$.fragment,M),j=!0)},o(M){b(o.$$.fragment,M),j=!1},d(M){I(o,M)}}}function ta(Q){let o,j="To use <code>LiteLLMModel</code>, you need to set the environment variable <code>ANTHROPIC_API_KEY</code> or <code>OPENAI_API_KEY</code>, or pass <code>api_key</code> variable upon initialization.",M,u,d;return u=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QmxpdGVsbG0lNUQnJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBMaXRlTExNTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Nb2RlbChtb2RlbF9pZCUzRCUyMmFudGhyb3BpYyUyRmNsYXVkZS0zLTUtc29ubmV0LWxhdGVzdCUyMiUyQyUyMGFwaV9rZXklM0QlMjJZT1VSX0FOVEhST1BJQ19BUElfS0VZJTIyKSUyMCUyMyUyMENvdWxkJTIwdXNlJTIwJ2dwdC00byclMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[litellm]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, LiteLLMModel

model = LiteLLMModel(model_id=<span class="hljs-string">&quot;anthropic/claude-3-5-sonnet-latest&quot;</span>, api_key=<span class="hljs-string">&quot;YOUR_ANTHROPIC_API_KEY&quot;</span>) <span class="hljs-comment"># Could use &#x27;gpt-4o&#x27;</span>
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){o=i("p"),o.innerHTML=j,M=s(),c(u.$$.fragment)},l(p){o=T(p,"P",{"data-svelte-h":!0}),U(o)!=="svelte-1iplh0r"&&(o.innerHTML=j),M=a(p),m(u.$$.fragment,p)},m(p,f){t(p,o,f),t(p,M,f),g(u,p,f),d=!0},p:Y,i(p){d||(h(u.$$.fragment,p),d=!0)},o(p){b(u.$$.fragment,p),d=!1},d(p){p&&(l(o),l(M)),I(u,p)}}}function na(Q){let o,j;return o=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QmxpdGVsbG0lNUQnJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBMaXRlTExNTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Nb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMm9sbGFtYV9jaGF0JTJGbGxhbWEzLjIlMjIlMkMlMjAlMjMlMjBUaGlzJTIwbW9kZWwlMjBpcyUyMGElMjBiaXQlMjB3ZWFrJTIwZm9yJTIwYWdlbnRpYyUyMGJlaGF2aW91cnMlMjB0aG91Z2glMEElMjAlMjAlMjAlMjBhcGlfYmFzZSUzRCUyMmh0dHAlM0ElMkYlMkZsb2NhbGhvc3QlM0ExMTQzNCUyMiUyQyUyMCUyMyUyMHJlcGxhY2UlMjB3aXRoJTIwMTI3LjAuMC4xJTNBMTE0MzQlMjBvciUyMHJlbW90ZSUyMG9wZW4tYWklMjBjb21wYXRpYmxlJTIwc2VydmVyJTIwaWYlMjBuZWNlc3NhcnklMEElMjAlMjAlMjAlMjBhcGlfa2V5JTNEJTIyWU9VUl9BUElfS0VZJTIyJTJDJTIwJTIzJTIwcmVwbGFjZSUyMHdpdGglMjBBUEklMjBrZXklMjBpZiUyMG5lY2Vzc2FyeSUwQSUyMCUyMCUyMCUyMG51bV9jdHglM0Q4MTkyJTJDJTIwJTIzJTIwb2xsYW1hJTIwZGVmYXVsdCUyMGlzJTIwMjA0OCUyMHdoaWNoJTIwd2lsbCUyMGZhaWwlMjBob3JyaWJseS4lMjA4MTkyJTIwd29ya3MlMjBmb3IlMjBlYXN5JTIwdGFza3MlMkMlMjBtb3JlJTIwaXMlMjBiZXR0ZXIuJTIwQ2hlY2slMjBodHRwcyUzQSUyRiUyRmh1Z2dpbmdmYWNlLmNvJTJGc3BhY2VzJTJGTnl4S3JhZ2UlMkZMTE0tTW9kZWwtVlJBTS1DYWxjdWxhdG9yJTIwdG8lMjBjYWxjdWxhdGUlMjBob3clMjBtdWNoJTIwVlJBTSUyMHRoaXMlMjB3aWxsJTIwbmVlZCUyMGZvciUyMHRoZSUyMHNlbGVjdGVkJTIwbW9kZWwuJTBBKSUwQSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[litellm]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, LiteLLMModel

model = LiteLLMModel(
    model_id=<span class="hljs-string">&quot;ollama_chat/llama3.2&quot;</span>, <span class="hljs-comment"># This model is a bit weak for agentic behaviours though</span>
    api_base=<span class="hljs-string">&quot;http://localhost:11434&quot;</span>, <span class="hljs-comment"># replace with 127.0.0.1:11434 or remote open-ai compatible server if necessary</span>
    api_key=<span class="hljs-string">&quot;YOUR_API_KEY&quot;</span>, <span class="hljs-comment"># replace with API key if necessary</span>
    num_ctx=<span class="hljs-number">8192</span>, <span class="hljs-comment"># ollama default is 2048 which will fail horribly. 8192 works for easy tasks, more is better. Check https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator to calculate how much VRAM this will need for the selected model.</span>
)

agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){c(o.$$.fragment)},l(M){m(o.$$.fragment,M)},m(M,u){g(o,M,u),j=!0},p:Y,i(M){j||(h(o.$$.fragment,M),j=!0)},o(M){b(o.$$.fragment,M),j=!1},d(M){I(o,M)}}}function sa(Q){let o,j="To connect to Azure OpenAI, you can either use <code>AzureOpenAIModel</code> directly, or use <code>LiteLLMModel</code> and configure it accordingly.",M,u,d="To initialize an instance of <code>AzureOpenAIModel</code>, you need to pass your model deployment name and then either pass the <code>azure_endpoint</code>, <code>api_key</code>, and <code>api_version</code> arguments, or set the environment variables <code>AZURE_OPENAI_ENDPOINT</code>, <code>AZURE_OPENAI_API_KEY</code>, and <code>OPENAI_API_VERSION</code>.",p,f,B,r,N="Similarly, you can configure <code>LiteLLMModel</code> to connect to Azure OpenAI as follows:",v,R,$="<li>pass your model deployment name as <code>model_id</code>, and make sure to prefix it with <code>azure/</code></li> <li>make sure to set the environment variable <code>AZURE_API_VERSION</code></li> <li>either pass the <code>api_base</code> and <code>api_key</code> arguments, or set the environment variables <code>AZURE_API_KEY</code>, and <code>AZURE_API_BASE</code></li>",y,J,A;return f=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1Qm9wZW5haSU1RCclMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMEF6dXJlT3BlbkFJTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEF6dXJlT3BlbkFJTW9kZWwobW9kZWxfaWQlM0QlMjJncHQtNG8tbWluaSUyMiklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[openai]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, AzureOpenAIModel

model = AzureOpenAIModel(model_id=<span class="hljs-string">&quot;gpt-4o-mini&quot;</span>)
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),J=new E({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMExpdGVMTE1Nb2RlbCUwQSUwQUFaVVJFX09QRU5BSV9DSEFUX0RFUExPWU1FTlRfTkFNRSUzRCUyMmdwdC0zNS10dXJiby0xNmstZGVwbG95bWVudCUyMiUyMCUyMyUyMGV4YW1wbGUlMjBvZiUyMGRlcGxveW1lbnQlMjBuYW1lJTBBJTBBb3MuZW52aXJvbiU1QiUyMkFaVVJFX0FQSV9LRVklMjIlNUQlMjAlM0QlMjAlMjIlMjIlMjAlMjMlMjBhcGlfa2V5JTBBb3MuZW52aXJvbiU1QiUyMkFaVVJFX0FQSV9CQVNFJTIyJTVEJTIwJTNEJTIwJTIyJTIyJTIwJTIzJTIwJTIyaHR0cHMlM0ElMkYlMkZleGFtcGxlLWVuZHBvaW50Lm9wZW5haS5henVyZS5jb20lMjIlMEFvcy5lbnZpcm9uJTVCJTIyQVpVUkVfQVBJX1ZFUlNJT04lMjIlNUQlMjAlM0QlMjAlMjIlMjIlMjAlMjMlMjAlMjIyMDI0LTEwLTAxLXByZXZpZXclMjIlMEElMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Nb2RlbChtb2RlbF9pZCUzRCUyMmF6dXJlJTJGJTIyJTIwJTJCJTIwQVpVUkVfT1BFTkFJX0NIQVRfREVQTE9ZTUVOVF9OQU1FKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, LiteLLMModel

AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=<span class="hljs-string">&quot;gpt-35-turbo-16k-deployment&quot;</span> <span class="hljs-comment"># example of deployment name</span>

os.environ[<span class="hljs-string">&quot;AZURE_API_KEY&quot;</span>] = <span class="hljs-string">&quot;&quot;</span> <span class="hljs-comment"># api_key</span>
os.environ[<span class="hljs-string">&quot;AZURE_API_BASE&quot;</span>] = <span class="hljs-string">&quot;&quot;</span> <span class="hljs-comment"># &quot;https://example-endpoint.openai.azure.com&quot;</span>
os.environ[<span class="hljs-string">&quot;AZURE_API_VERSION&quot;</span>] = <span class="hljs-string">&quot;&quot;</span> <span class="hljs-comment"># &quot;2024-10-01-preview&quot;</span>

model = LiteLLMModel(model_id=<span class="hljs-string">&quot;azure/&quot;</span> + AZURE_OPENAI_CHAT_DEPLOYMENT_NAME)
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
   <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){o=i("p"),o.innerHTML=j,M=s(),u=i("p"),u.innerHTML=d,p=s(),c(f.$$.fragment),B=s(),r=i("p"),r.innerHTML=N,v=s(),R=i("ul"),R.innerHTML=$,y=s(),c(J.$$.fragment)},l(C){o=T(C,"P",{"data-svelte-h":!0}),U(o)!=="svelte-k0rdx7"&&(o.innerHTML=j),M=a(C),u=T(C,"P",{"data-svelte-h":!0}),U(u)!=="svelte-1fitxie"&&(u.innerHTML=d),p=a(C),m(f.$$.fragment,C),B=a(C),r=T(C,"P",{"data-svelte-h":!0}),U(r)!=="svelte-116rusl"&&(r.innerHTML=N),v=a(C),R=T(C,"UL",{"data-svelte-h":!0}),U(R)!=="svelte-1nzt61u"&&(R.innerHTML=$),y=a(C),m(J.$$.fragment,C)},m(C,V){t(C,o,V),t(C,M,V),t(C,u,V),t(C,p,V),g(f,C,V),t(C,B,V),t(C,r,V),t(C,v,V),t(C,R,V),t(C,y,V),g(J,C,V),A=!0},p:Y,i(C){A||(h(f.$$.fragment,C),h(J.$$.fragment,C),A=!0)},o(C){b(f.$$.fragment,C),b(J.$$.fragment,C),A=!1},d(C){C&&(l(o),l(M),l(u),l(p),l(B),l(r),l(v),l(R),l(y)),I(f,C),I(J,C)}}}function aa(Q){let o,j="The <code>AmazonBedrockModel</code> class provides native integration with Amazon Bedrock, allowing for direct API calls and comprehensive configuration.",M,u,d="Basic Usage:",p,f,B,r,N="Advanced Configuration:",v,R,$,y,J="Using LiteLLMModel:",A,C,V="Alternatively, you can use <code>LiteLLMModel</code> with Bedrock models:",G,w,F;return f=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QmJlZHJvY2slNUQnJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBBbWF6b25CZWRyb2NrTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tNb2RlbChtb2RlbF9pZCUzRCUyMmFudGhyb3BpYy5jbGF1ZGUtMy1zb25uZXQtMjAyNDAyMjktdjElM0EwJTIyKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[bedrock]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, AmazonBedrockModel

model = AmazonBedrockModel(model_id=<span class="hljs-string">&quot;anthropic.claude-3-sonnet-20240229-v1:0&quot;</span>)
agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),R=new E({props:{code:"aW1wb3J0JTIwYm90bzMlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEFtYXpvbkJlZHJvY2tNb2RlbCUwQSUwQSUyMyUyMENyZWF0ZSUyMGElMjBjdXN0b20lMjBCZWRyb2NrJTIwY2xpZW50JTBBYmVkcm9ja19jbGllbnQlMjAlM0QlMjBib3RvMy5jbGllbnQoJTBBJTIwJTIwJTIwJTIwJ2JlZHJvY2stcnVudGltZSclMkMlMEElMjAlMjAlMjAlMjByZWdpb25fbmFtZSUzRCd1cy1lYXN0LTEnJTJDJTBBJTIwJTIwJTIwJTIwYXdzX2FjY2Vzc19rZXlfaWQlM0QnWU9VUl9BQ0NFU1NfS0VZJyUyQyUwQSUyMCUyMCUyMCUyMGF3c19zZWNyZXRfYWNjZXNzX2tleSUzRCdZT1VSX1NFQ1JFVF9LRVknJTBBKSUwQSUwQWFkZGl0aW9uYWxfYXBpX2NvbmZpZyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmluZmVyZW5jZUNvbmZpZyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1heFRva2VucyUyMiUzQSUyMDMwMDAlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxDb25maWclMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxJZGVudGlmaWVyJTIyJTNBJTIwJTIyaWRlbnRpZnkxJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyZ3VhcmRyYWlsVmVyc2lvbiUyMiUzQSUyMCd2MSclMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElN0QlMEElMEElMjMlMjBJbml0aWFsaXplJTIwd2l0aCUyMGNvbXByZWhlbnNpdmUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJ1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJTIyJTJDJTBBJTIwJTIwJTIwJTIwY2xpZW50JTNEYmVkcm9ja19jbGllbnQlMkMlMjAlMjAlMjMlMjBVc2UlMjBjdXN0b20lMjBjbGllbnQlMEElMjAlMjAlMjAlMjAqKmFkZGl0aW9uYWxfYXBpX2NvbmZpZyUwQSklMEElMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> boto3
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AmazonBedrockModel

<span class="hljs-comment"># Create a custom Bedrock client</span>
bedrock_client = boto3.client(
    <span class="hljs-string">&#x27;bedrock-runtime&#x27;</span>,
    region_name=<span class="hljs-string">&#x27;us-east-1&#x27;</span>,
    aws_access_key_id=<span class="hljs-string">&#x27;YOUR_ACCESS_KEY&#x27;</span>,
    aws_secret_access_key=<span class="hljs-string">&#x27;YOUR_SECRET_KEY&#x27;</span>
)

additional_api_config = {
    <span class="hljs-string">&quot;inferenceConfig&quot;</span>: {
        <span class="hljs-string">&quot;maxTokens&quot;</span>: <span class="hljs-number">3000</span>
    },
    <span class="hljs-string">&quot;guardrailConfig&quot;</span>: {
        <span class="hljs-string">&quot;guardrailIdentifier&quot;</span>: <span class="hljs-string">&quot;identify1&quot;</span>,
        <span class="hljs-string">&quot;guardrailVersion&quot;</span>: <span class="hljs-string">&#x27;v1&#x27;</span>
    },
}

<span class="hljs-comment"># Initialize with comprehensive configuration</span>
model = AmazonBedrockModel(
    model_id=<span class="hljs-string">&quot;us.amazon.nova-pro-v1:0&quot;</span>,
    client=bedrock_client,  <span class="hljs-comment"># Use custom client</span>
    **additional_api_config
)

agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),w=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNTW9kZWwlMkMlMjBDb2RlQWdlbnQlMEElMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Nb2RlbChtb2RlbF9uYW1lJTNEJTIyYmVkcm9jayUyRmFudGhyb3BpYy5jbGF1ZGUtMy1zb25uZXQtMjAyNDAyMjktdjElM0EwJTIyKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCklMEElMEFhZ2VudC5ydW4oJTIyRXhwbGFpbiUyMHRoZSUyMGNvbmNlcHQlMjBvZiUyMHF1YW50dW0lMjBjb21wdXRpbmclMjIp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMModel, CodeAgent

model = LiteLLMModel(model_name=<span class="hljs-string">&quot;bedrock/anthropic.claude-3-sonnet-20240229-v1:0&quot;</span>)
agent = CodeAgent(tools=[], model=model)

agent.run(<span class="hljs-string">&quot;Explain the concept of quantum computing&quot;</span>)`,wrap:!1}}),{c(){o=i("p"),o.innerHTML=j,M=s(),u=i("p"),u.textContent=d,p=s(),c(f.$$.fragment),B=s(),r=i("p"),r.textContent=N,v=s(),c(R.$$.fragment),$=s(),y=i("p"),y.textContent=J,A=s(),C=i("p"),C.innerHTML=V,G=s(),c(w.$$.fragment)},l(k){o=T(k,"P",{"data-svelte-h":!0}),U(o)!=="svelte-1yi5wnd"&&(o.innerHTML=j),M=a(k),u=T(k,"P",{"data-svelte-h":!0}),U(u)!=="svelte-16zanz3"&&(u.textContent=d),p=a(k),m(f.$$.fragment,k),B=a(k),r=T(k,"P",{"data-svelte-h":!0}),U(r)!=="svelte-e5fqn2"&&(r.textContent=N),v=a(k),m(R.$$.fragment,k),$=a(k),y=T(k,"P",{"data-svelte-h":!0}),U(y)!=="svelte-121tojm"&&(y.textContent=J),A=a(k),C=T(k,"P",{"data-svelte-h":!0}),U(C)!=="svelte-zwun4n"&&(C.innerHTML=V),G=a(k),m(w.$$.fragment,k)},m(k,W){t(k,o,W),t(k,M,W),t(k,u,W),t(k,p,W),g(f,k,W),t(k,B,W),t(k,r,W),t(k,v,W),g(R,k,W),t(k,$,W),t(k,y,W),t(k,A,W),t(k,C,W),t(k,G,W),g(w,k,W),F=!0},p:Y,i(k){F||(h(f.$$.fragment,k),h(R.$$.fragment,k),h(w.$$.fragment,k),F=!0)},o(k){b(f.$$.fragment,k),b(R.$$.fragment,k),b(w.$$.fragment,k),F=!1},d(k){k&&(l(o),l(M),l(u),l(p),l(B),l(r),l(v),l($),l(y),l(A),l(C),l(G)),I(f,k),I(R,k),I(w,k)}}}function oa(Q){let o,j;return o=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1Qm1seC1sbSU1RCclMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyME1MWE1vZGVsJTBBJTBBbWx4X21vZGVsJTIwJTNEJTIwTUxYTW9kZWwoJTIybWx4LWNvbW11bml0eSUyRlF3ZW4yLjUtQ29kZXItMzJCLUluc3RydWN0LTRiaXQlMjIpJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQobW9kZWwlM0RtbHhfbW9kZWwlMkMlMjB0b29scyUzRCU1QiU1RCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIp",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[mlx-lm]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, MLXModel

mlx_model = MLXModel(<span class="hljs-string">&quot;mlx-community/Qwen2.5-Coder-32B-Instruct-4bit&quot;</span>)
agent = CodeAgent(model=mlx_model, tools=[], add_base_tools=<span class="hljs-literal">True</span>)

agent.run(<span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>)`,wrap:!1}}),{c(){c(o.$$.fragment)},l(M){m(o.$$.fragment,M)},m(M,u){g(o,M,u),j=!0},p:Y,i(M){j||(h(o.$$.fragment,M),j=!0)},o(M){b(o.$$.fragment,M),j=!1},d(M){I(o,M)}}}function ia(Q){let o,j,M,u,d,p,f,B,r,N,v,R,$,y;return o=new z({props:{id:"Pick a LLM",option:"Inference Providers",$$slots:{default:[ea]},$$scope:{ctx:Q}}}),M=new z({props:{id:"Pick a LLM",option:"Local Transformers Model",$$slots:{default:[la]},$$scope:{ctx:Q}}}),d=new z({props:{id:"Pick a LLM",option:"OpenAI or Anthropic API",$$slots:{default:[ta]},$$scope:{ctx:Q}}}),f=new z({props:{id:"Pick a LLM",option:"Ollama",$$slots:{default:[na]},$$scope:{ctx:Q}}}),r=new z({props:{id:"Pick a LLM",option:"Azure OpenAI",$$slots:{default:[sa]},$$scope:{ctx:Q}}}),v=new z({props:{id:"Pick a LLM",option:"Amazon Bedrock",$$slots:{default:[aa]},$$scope:{ctx:Q}}}),$=new z({props:{id:"Pick a LLM",option:"mlx-lm",$$slots:{default:[oa]},$$scope:{ctx:Q}}}),{c(){c(o.$$.fragment),j=s(),c(M.$$.fragment),u=s(),c(d.$$.fragment),p=s(),c(f.$$.fragment),B=s(),c(r.$$.fragment),N=s(),c(v.$$.fragment),R=s(),c($.$$.fragment)},l(J){m(o.$$.fragment,J),j=a(J),m(M.$$.fragment,J),u=a(J),m(d.$$.fragment,J),p=a(J),m(f.$$.fragment,J),B=a(J),m(r.$$.fragment,J),N=a(J),m(v.$$.fragment,J),R=a(J),m($.$$.fragment,J)},m(J,A){g(o,J,A),t(J,j,A),g(M,J,A),t(J,u,A),g(d,J,A),t(J,p,A),g(f,J,A),t(J,B,A),g(r,J,A),t(J,N,A),g(v,J,A),t(J,R,A),g($,J,A),y=!0},p(J,A){const C={};A&2&&(C.$$scope={dirty:A,ctx:J}),o.$set(C);const V={};A&2&&(V.$$scope={dirty:A,ctx:J}),M.$set(V);const G={};A&2&&(G.$$scope={dirty:A,ctx:J}),d.$set(G);const w={};A&2&&(w.$$scope={dirty:A,ctx:J}),f.$set(w);const F={};A&2&&(F.$$scope={dirty:A,ctx:J}),r.$set(F);const k={};A&2&&(k.$$scope={dirty:A,ctx:J}),v.$set(k);const W={};A&2&&(W.$$scope={dirty:A,ctx:J}),$.$set(W)},i(J){y||(h(o.$$.fragment,J),h(M.$$.fragment,J),h(d.$$.fragment,J),h(f.$$.fragment,J),h(r.$$.fragment,J),h(v.$$.fragment,J),h($.$$.fragment,J),y=!0)},o(J){b(o.$$.fragment,J),b(M.$$.fragment,J),b(d.$$.fragment,J),b(f.$$.fragment,J),b(r.$$.fragment,J),b(v.$$.fragment,J),b($.$$.fragment,J),y=!1},d(J){J&&(l(j),l(u),l(p),l(B),l(N),l(R)),I(o,J),I(M,J),I(d,J),I(f,J),I(r,J),I(v,J),I($,J)}}}function Ta(Q){let o,j,M,u="The function needs:",d,p,f="<li>A clear name. The name should be descriptive enough of what this tool does to help the LLM brain powering the agent. Since this tool returns the model with the most downloads for a task, let’s name it <code>model_download_tool</code>.</li> <li>Type hints on both inputs and output</li> <li>A description, that includes an ‘Args:’ part where each argument is described (without a type indication this time, it will be pulled from the type hint). Same as for the tool name, this description is an instruction manual for the LLM powering your agent, so do not neglect it.</li>",B,r,N="All these elements will be automatically baked into the agent’s system prompt upon initialization: so strive to make them as clear as possible!",v,R,$='<p>This definition format is the same as tool schemas used in <code>apply_chat_template</code>, the only difference is the added <code>tool</code> decorator: read more on our tool use API <a href="https://huggingface.co/blog/unified-tool-use#passing-tools-to-a-chat-template" rel="nofollow">here</a>.</p>',y,J,A="Then you can directly initialize your agent:",C,V,G;return o=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjB0b29sJTBBJTBBJTQwdG9vbCUwQWRlZiUyMG1vZGVsX2Rvd25sb2FkX3Rvb2wodGFzayUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwJTIwJTIwVGhpcyUyMGlzJTIwYSUyMHRvb2wlMjB0aGF0JTIwcmV0dXJucyUyMHRoZSUyMG1vc3QlMjBkb3dubG9hZGVkJTIwbW9kZWwlMjBvZiUyMGElMjBnaXZlbiUyMHRhc2slMjBvbiUyMHRoZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViLiUwQSUyMCUyMCUyMCUyMEl0JTIwcmV0dXJucyUyMHRoZSUyMG5hbWUlMjBvZiUyMHRoZSUyMGNoZWNrcG9pbnQuJTBBJTBBJTIwJTIwJTIwJTIwQXJncyUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRhc2slM0ElMjBUaGUlMjB0YXNrJTIwZm9yJTIwd2hpY2glMjB0byUyMGdldCUyMHRoZSUyMGRvd25sb2FkJTIwY291bnQuJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwJTIwJTIwbW9zdF9kb3dubG9hZGVkX21vZGVsJTIwJTNEJTIwbmV4dChpdGVyKGxpc3RfbW9kZWxzKGZpbHRlciUzRHRhc2slMkMlMjBzb3J0JTNEJTIyZG93bmxvYWRzJTIyJTJDJTIwZGlyZWN0aW9uJTNELTEpKSklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBtb3N0X2Rvd25sb2FkZWRfbW9kZWwuaWQ=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> tool

<span class="hljs-meta">@tool</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">model_download_tool</span>(<span class="hljs-params">task: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
    <span class="hljs-string">&quot;&quot;&quot;
    This is a tool that returns the most downloaded model of a given task on the Hugging Face Hub.
    It returns the name of the checkpoint.

    Args:
        task: The task for which to get the download count.
    &quot;&quot;&quot;</span>
    most_downloaded_model = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(list_models(<span class="hljs-built_in">filter</span>=task, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>)))
    <span class="hljs-keyword">return</span> most_downloaded_model.<span class="hljs-built_in">id</span>`,wrap:!1}}),V=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCbW9kZWxfZG93bmxvYWRfdG9vbCU1RCUyQyUyMG1vZGVsJTNESW5mZXJlbmNlQ2xpZW50TW9kZWwoKSklMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ2FuJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwbW9kZWwlMjB0aGF0JTIwaGFzJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkcyUyMGluJTIwdGhlJTIwJ3RleHQtdG8tdmlkZW8nJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlM0YlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel
agent = CodeAgent(tools=[model_download_tool], model=InferenceClientModel())
agent.run(
    <span class="hljs-string">&quot;Can you give me the name of the model that has the most downloads in the &#x27;text-to-video&#x27; task on the Hugging Face Hub?&quot;</span>
)`,wrap:!1}}),{c(){c(o.$$.fragment),j=s(),M=i("p"),M.textContent=u,d=s(),p=i("ul"),p.innerHTML=f,B=s(),r=i("p"),r.textContent=N,v=s(),R=i("blockquote"),R.innerHTML=$,y=s(),J=i("p"),J.textContent=A,C=s(),c(V.$$.fragment),this.h()},l(w){m(o.$$.fragment,w),j=a(w),M=T(w,"P",{"data-svelte-h":!0}),U(M)!=="svelte-10btble"&&(M.textContent=u),d=a(w),p=T(w,"UL",{"data-svelte-h":!0}),U(p)!=="svelte-1uouvtx"&&(p.innerHTML=f),B=a(w),r=T(w,"P",{"data-svelte-h":!0}),U(r)!=="svelte-1prqddm"&&(r.textContent=N),v=a(w),R=T(w,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(R)!=="svelte-1262wle"&&(R.innerHTML=$),y=a(w),J=T(w,"P",{"data-svelte-h":!0}),U(J)!=="svelte-1bc8e8e"&&(J.textContent=A),C=a(w),m(V.$$.fragment,w),this.h()},h(){Al(R,"class","tip")},m(w,F){g(o,w,F),t(w,j,F),t(w,M,F),t(w,d,F),t(w,p,F),t(w,B,F),t(w,r,F),t(w,v,F),t(w,R,F),t(w,y,F),t(w,J,F),t(w,C,F),g(V,w,F),G=!0},p:Y,i(w){G||(h(o.$$.fragment,w),h(V.$$.fragment,w),G=!0)},o(w){b(o.$$.fragment,w),b(V.$$.fragment,w),G=!1},d(w){w&&(l(j),l(M),l(d),l(p),l(B),l(r),l(v),l(R),l(y),l(J),l(C)),I(o,w),I(V,w)}}}function Ja(Q){let o,j,M,u="The subclass needs the following attributes:",d,p,f=`<li>A clear <code>name</code>. The name should be descriptive enough of what this tool does to help the LLM brain powering the agent. Since this tool returns the model with the most downloads for a task, let’s name it <code>model_download_tool</code>.</li> <li>A <code>description</code>. Same as for the <code>name</code>, this description is an instruction manual for the LLM powering your agent, so do not neglect it.</li> <li>Input types and descriptions</li> <li>Output type
All these attributes will be automatically baked into the agent’s system prompt upon initialization: so strive to make them as clear as possible!</li>`,B,r,N="Then you can directly initialize your agent:",v,R,$;return o=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBJTBBY2xhc3MlMjBNb2RlbERvd25sb2FkVG9vbChUb29sKSUzQSUwQSUyMCUyMCUyMCUyMG5hbWUlMjAlM0QlMjAlMjJtb2RlbF9kb3dubG9hZF90b29sJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJUaGlzJTIwaXMlMjBhJTIwdG9vbCUyMHRoYXQlMjByZXR1cm5zJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMG9mJTIwYSUyMGdpdmVuJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIuJTIwSXQlMjByZXR1cm5zJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwY2hlY2twb2ludC4lMjIlMEElMjAlMjAlMjAlMjBpbnB1dHMlMjAlM0QlMjAlN0IlMjJ0YXNrJTIyJTNBJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnN0cmluZyUyMiUyQyUyMCUyMmRlc2NyaXB0aW9uJTIyJTNBJTIwJTIyVGhlJTIwdGFzayUyMGZvciUyMHdoaWNoJTIwdG8lMjBnZXQlMjB0aGUlMjBkb3dubG9hZCUyMGNvdW50LiUyMiU3RCU3RCUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTIwJTNEJTIwJTIyc3RyaW5nJTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIwdGFzayUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9zdF9kb3dubG9hZGVkX21vZGVsJTIwJTNEJTIwbmV4dChpdGVyKGxpc3RfbW9kZWxzKGZpbHRlciUzRHRhc2slMkMlMjBzb3J0JTNEJTIyZG93bmxvYWRzJTIyJTJDJTIwZGlyZWN0aW9uJTNELTEpKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBtb3N0X2Rvd25sb2FkZWRfbW9kZWwuaWQ=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Tool

<span class="hljs-keyword">class</span> <span class="hljs-title class_">ModelDownloadTool</span>(<span class="hljs-title class_ inherited__">Tool</span>):
    name = <span class="hljs-string">&quot;model_download_tool&quot;</span>
    description = <span class="hljs-string">&quot;This is a tool that returns the most downloaded model of a given task on the Hugging Face Hub. It returns the name of the checkpoint.&quot;</span>
    inputs = {<span class="hljs-string">&quot;task&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-string">&quot;description&quot;</span>: <span class="hljs-string">&quot;The task for which to get the download count.&quot;</span>}}
    output_type = <span class="hljs-string">&quot;string&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, task: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
        most_downloaded_model = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(list_models(<span class="hljs-built_in">filter</span>=task, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>)))
        <span class="hljs-keyword">return</span> most_downloaded_model.<span class="hljs-built_in">id</span>`,wrap:!1}}),R=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCTW9kZWxEb3dubG9hZFRvb2woKSU1RCUyQyUyMG1vZGVsJTNESW5mZXJlbmNlQ2xpZW50TW9kZWwoKSklMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ2FuJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwbW9kZWwlMjB0aGF0JTIwaGFzJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkcyUyMGluJTIwdGhlJTIwJ3RleHQtdG8tdmlkZW8nJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlM0YlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel
agent = CodeAgent(tools=[ModelDownloadTool()], model=InferenceClientModel())
agent.run(
    <span class="hljs-string">&quot;Can you give me the name of the model that has the most downloads in the &#x27;text-to-video&#x27; task on the Hugging Face Hub?&quot;</span>
)`,wrap:!1}}),{c(){c(o.$$.fragment),j=s(),M=i("p"),M.textContent=u,d=s(),p=i("ul"),p.innerHTML=f,B=s(),r=i("p"),r.textContent=N,v=s(),c(R.$$.fragment)},l(y){m(o.$$.fragment,y),j=a(y),M=T(y,"P",{"data-svelte-h":!0}),U(M)!=="svelte-1axnp6t"&&(M.textContent=u),d=a(y),p=T(y,"UL",{"data-svelte-h":!0}),U(p)!=="svelte-1e7an1b"&&(p.innerHTML=f),B=a(y),r=T(y,"P",{"data-svelte-h":!0}),U(r)!=="svelte-1bc8e8e"&&(r.textContent=N),v=a(y),m(R.$$.fragment,y)},m(y,J){g(o,y,J),t(y,j,J),t(y,M,J),t(y,d,J),t(y,p,J),t(y,B,J),t(y,r,J),t(y,v,J),g(R,y,J),$=!0},p:Y,i(y){$||(h(o.$$.fragment,y),h(R.$$.fragment,y),$=!0)},o(y){b(o.$$.fragment,y),b(R.$$.fragment,y),$=!1},d(y){y&&(l(j),l(M),l(d),l(p),l(B),l(r),l(v)),I(o,y),I(R,y)}}}function Ma(Q){let o,j,M,u;return o=new z({props:{id:"build-a-tool",option:"Decorate a function with @tool",$$slots:{default:[Ta]},$$scope:{ctx:Q}}}),M=new z({props:{id:"build-a-tool",option:"Subclass Tool",$$slots:{default:[Ja]},$$scope:{ctx:Q}}}),{c(){c(o.$$.fragment),j=s(),c(M.$$.fragment)},l(d){m(o.$$.fragment,d),j=a(d),m(M.$$.fragment,d)},m(d,p){g(o,d,p),t(d,j,p),g(M,d,p),u=!0},p(d,p){const f={};p&2&&(f.$$scope={dirty:p,ctx:d}),o.$set(f);const B={};p&2&&(B.$$scope={dirty:p,ctx:d}),M.$set(B)},i(d){u||(h(o.$$.fragment,d),h(M.$$.fragment,d),u=!0)},o(d){b(o.$$.fragment,d),b(M.$$.fragment,d),u=!1},d(d){d&&l(j),I(o,d),I(M,d)}}}function Ua(Q){let o,j,M,u,d,p,f,B,r,N,v,R="In this guided visit, you will learn how to build an agent, how to run it, and how to customize it to make it work better for your use-case.",$,y,J,A,C=`<code>smolagents</code> comes with two agent classes: <a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> and <a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a>, which represent two different paradigms for how agents interact with tools.
The key difference lies in how actions are specified and executed: code generation vs structured tool calling.`,V,G,w,F,k='<a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> generates tool calls as Python code snippets.',W,_,Rl,Zn="The code is executed either locally (potentially unsecure) or in a secure sandbox.",mn,Bl,$n="Tools are exposed as Python functions (via bindings).",gn,vl,hn,le,bn,Vl,Fn=`Strengths:
<ul><li>Highly expressive: Allows for complex logic and control flow and can combine tools, loop, transform, reason.</li> <li>Flexible: No need to predefine every possible action, can dynamically generate new actions/tools.</li> <li>Emergent reasoning: Ideal for multi-step problems or dynamic logic.</li></ul>`,In,Zl,Nn=`Limitations
<ul><li>Risk of errors: Must handle syntax errors, exceptions.</li> <li>Less predictable: More prone to unexpected or unsafe outputs.</li> <li>Requires secure execution environment.</li></ul>`,fn,te,$l,En='<a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> writes tool calls as structured JSON.',Cn,O,Fl,Qn="This is the common format used in many frameworks (OpenAI API), allowing for structured tool interactions without code execution.",jn,Nl,Wn="Tools are defined with a JSON schema: name, description, parameter types, etc.",kn,El,An,ne,Rn,Ql,Gn=`Strengths:
<ul><li>Reliable: Less prone to hallucination, outputs are structured and validated.</li> <li>Safe: Arguments are strictly validated, no risk of arbitrary code running.</li> <li>Interoperable: Easy to map to external APIs or services.</li></ul>`,Bn,Wl,xn=`Limitations:
<ul><li>Low expressivity: Can’t easily combine or transform results dynamically, or perform complex logic or control flow.</li> <li>Inflexible: Must define all possible actions in advance, limited to predefined tools.</li> <li>No code synthesis: Limited to tool capabilities.</li></ul>`,xl,se,_n="When to use which agent type:",_l,ae,On='<li><p>Use <a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> when:</p> <ul><li>You need reasoning, chaining, or dynamic composition.</li> <li>Tools are functions that can be combined (e.g., parsing + math + querying).</li> <li>Your agent is a problem solver or programmer.</li></ul></li> <li><p>Use <a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> when:</p> <ul><li>You have simple, atomic tools (e.g., call an API, fetch a document).</li> <li>You want high reliability and clear validation.</li> <li>Your agent is like a dispatcher or controller.</li></ul></li>',Ol,oe,Sl,ie,Sn='<a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> generates Python code snippets to perform actions and solve tasks.',Hl,Te,Hn=`By default, the Python code execution is done in your local environment.
This should be safe because the only functions that can be called are the tools you provided (especially if it’s only tools by Hugging Face) and a set of predefined safe functions like <code>print</code> or functions from the <code>math</code> module, so you’re already limited in what can be executed.`,Ll,Je,Ln=`The Python interpreter also doesn’t allow imports by default outside of a safe list, so all the most obvious attacks shouldn’t be an issue.
You can authorize additional imports by passing the authorized modules as a list of strings in argument <code>additional_authorized_imports</code> upon initialization of your <a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a>:`,zl,Me,Yl,Ue,zn=`Additionally, as an extra security layer, access to submodule is forbidden by default, unless explicitly authorized within the import list.
For instance, to access the <code>numpy.random</code> submodule, you need to add <code>&#39;numpy.random&#39;</code> to the <code>additional_authorized_imports</code> list.
This could also be authorized by using <code>numpy.*</code>, which will allow <code>numpy</code> as well as any subpackage like <code>numpy.random</code> and its own subpackages.`,Dl,D,Yn="<p>The LLM can generate arbitrary code that will then be executed: do not add any unsafe imports!</p>",Xl,re,Dn="The execution will stop at any code trying to perform an illegal operation or if there is a regular Python error with the code generated by the agent.",ql,pe,Xn='You can also use <a href="https://e2b.dev/docs#what-is-e2-b" rel="nofollow">E2B code executor</a> or Docker instead of a local Python interpreter. For E2B, first <a href="https://e2b.dev/dashboard?tab=keys" rel="nofollow">set the <code>E2B_API_KEY</code> environment variable</a> and then pass <code>executor_type=&quot;e2b&quot;</code> upon agent initialization. For Docker, pass <code>executor_type=&quot;docker&quot;</code> during initialization.',Pl,X,qn='<p>Learn more about code execution <a href="tutorials/secure_code_execution">in this tutorial</a>.</p>',Kl,de,et,ye,Pn='<a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> outputs JSON tool calls, which is the common format used in many frameworks (OpenAI API), allowing for structured tool interactions without code execution. We utilize the built-in WebSearchTool (from the smolagents toolkit extra, which will be described in more detail later) to enable our agent to perform web searches.',lt,ue,Kn='It works much in the same way like <a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a>, of course without <code>additional_authorized_imports</code> since it doesn’t execute code:',tt,we,nt,ce,st,me,es="To initialize a minimal agent, you need at least these two arguments:",at,ge,ls='<li><p><code>model</code>, a text-generation model to power your agent - because the agent is different from a simple LLM, it is a system that uses a LLM as its engine. You can use any of these options:</p> <ul><li><a href="/docs/smolagents/main/en/reference/models#smolagents.TransformersModel">TransformersModel</a> takes a pre-initialized <code>transformers</code> pipeline to run inference on your local machine using <code>transformers</code>.</li> <li><a href="/docs/smolagents/main/en/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a> leverages a <code>huggingface_hub.InferenceClient</code> under the hood and supports all Inference Providers on the Hub: Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.</li> <li><a href="/docs/smolagents/main/en/reference/models#smolagents.LiteLLMModel">LiteLLMModel</a> similarly lets you call 100+ different models and providers through <a href="https://docs.litellm.ai/" rel="nofollow">LiteLLM</a>!</li> <li><a href="/docs/smolagents/main/en/reference/models#smolagents.AzureOpenAIModel">AzureOpenAIModel</a> allows you to use OpenAI models deployed in <a href="https://azure.microsoft.com/en-us/products/ai-services/openai-service" rel="nofollow">Azure</a>.</li> <li><a href="/docs/smolagents/main/en/reference/models#smolagents.AmazonBedrockModel">AmazonBedrockModel</a> allows you to use Amazon Bedrock in <a href="https://aws.amazon.com/bedrock/?nc1=h_ls" rel="nofollow">AWS</a>.</li> <li><a href="/docs/smolagents/main/en/reference/models#smolagents.MLXModel">MLXModel</a> creates a <a href="https://pypi.org/project/mlx-lm/" rel="nofollow">mlx-lm</a> pipeline to run inference on your local machine.</li></ul></li> <li><p><code>tools</code>, a list of <code>Tools</code> that the agent can use to solve the task. It can be an empty list. You can also add the default toolbox on top of your <code>tools</code> list by defining the optional argument <code>add_base_tools=True</code>.</p></li>',ot,he,ts='Once you have these two arguments, <code>tools</code> and <code>model</code>,  you can create an agent and run it. You can use any LLM you’d like, either through <a href="https://huggingface.co/blog/inference-providers" rel="nofollow">Inference Providers</a>, <a href="https://github.com/huggingface/transformers/" rel="nofollow">transformers</a>, <a href="https://ollama.com/" rel="nofollow">ollama</a>, <a href="https://www.litellm.ai/" rel="nofollow">LiteLLM</a>, <a href="https://azure.microsoft.com/en-us/products/ai-services/openai-service" rel="nofollow">Azure OpenAI</a>, <a href="https://aws.amazon.com/bedrock/?nc1=h_ls" rel="nofollow">Amazon Bedrock</a>, or <a href="https://pypi.org/project/mlx-lm/" rel="nofollow">mlx-lm</a>.',it,be,ns=`All model classes support passing additional keyword arguments (like <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time.
These parameters are automatically forwarded to the underlying model’s completion calls, allowing you to configure model behavior such as creativity, response length, and sampling strategies.`,Tt,q,Jt,Ie,Mt,fe,ss=`When initializing models, you can pass keyword arguments that will be forwarded as completion parameters to the
underlying model API during inference.`,Ut,Ce,as=`For fine-grained control over parameter handling, the <code>REMOVE_PARAMETER</code> sentinel value allows you to explicitly exclude
parameters that might otherwise be set by default or passed through elsewhere:`,rt,je,pt,ke,os="This is particularly useful when:",dt,Ae,is="<li>You want to override default parameters that might be applied automatically</li> <li>You need to ensure certain parameters are completely excluded from API calls</li> <li>You want to let the model provider use their own defaults for specific parameters</li>",yt,Re,ut,Be,wt,ve,Ts=`By default, an agent continues running until it calls the <code>final_answer</code> function or reaches the maximum number of steps.
The <code>final_answer_checks</code> parameter gives you more control over when and how an agent terminates its execution:`,ct,Ve,mt,Ze,Js="The <code>final_answer_checks</code> parameter accepts a list of functions that each:",gt,$e,Ms="<li>Take the agent’s final_answer and the agent itself as parameters</li> <li>Return a boolean indicating whether the final_answer is valid (True) or not (False)</li>",ht,Fe,Us=`If any function returns <code>False</code>, the agent will log the error message and continue the run.
This validation mechanism enables:`,bt,Ne,rs="<li>Enforcing output format requirements (e.g., ensuring numeric answers for math problems)</li> <li>Implementing domain-specific validation rules</li> <li>Creating more robust agents that validate their own outputs</li>",It,Ee,ft,Qe,ps="Here are a few useful attributes to inspect what happened after a run:",Ct,We,ds="<li><code>agent.logs</code> stores the fine-grained logs of the agent. At every step of the agent’s run, everything gets stored in a dictionary that then is appended to <code>agent.logs</code>.</li> <li>Running <code>agent.write_memory_to_messages()</code> writes the agent’s memory as list of chat messages for the Model to view. This method goes over each step of the log and only stores what it’s interested in as a message: for instance, it will save the system prompt and task in separate messages, then for each step it will store the LLM output as a message, and the tool call output as another message. Use this if you want a higher-level view of what has happened - but not every log will be transcripted by this method.</li>",jt,Ge,kt,xe,ys="A tool is an atomic function to be used by an agent. To be used by an LLM, it also needs a few attributes that constitute its API and will be used to describe to the LLM how to call this tool:",At,_e,us="<li>A name</li> <li>A description</li> <li>Input types and descriptions</li> <li>An output type</li>",Rt,Oe,ws='You can for instance check the <a href="/docs/smolagents/main/en/reference/default_tools#smolagents.PythonInterpreterTool">PythonInterpreterTool</a>: it has a name, a description, input descriptions, an output type, and a <code>forward</code> method to perform the action.',Bt,Se,cs="When the agent is initialized, the tool attributes are used to generate a tool description which is baked into the agent’s system prompt. This lets the agent know which tools it can use and why.",vt,He,ms="<strong>Schema Information</strong>: For tools that have an <code>output_schema</code> defined (such as MCP tools with structured output), the <code>CodeAgent</code> system prompt automatically includes the JSON schema information. This helps the agent understand the expected structure of tool outputs and access the data appropriately.",Vt,Le,Zt,ze,gs="If you install <code>smolagents</code> with the “toolkit” extra, it comes with a default toolbox for empowering agents, that you can add to your agent upon initialization with argument <code>add_base_tools=True</code>:",$t,Ye,hs='<li><strong>DuckDuckGo web search*</strong>: performs a web search using DuckDuckGo browser.</li> <li><strong>Python code interpreter</strong>: runs your LLM generated Python code in a secure environment. This tool will only be added to <a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> if you initialize it with <code>add_base_tools=True</code>, since code-based agent can already natively execute Python code</li> <li><strong>Transcriber</strong>: a speech-to-text pipeline built on Whisper-Turbo that transcribes an audio to text.</li>',Ft,De,bs="You can manually use a tool by calling it with its arguments.",Nt,Xe,Et,qe,Qt,Pe,Is=`You can create your own tool for use cases not covered by the default tools from Hugging Face.
For example, let’s create a tool that returns the most downloaded model for a given task from the Hub.`,Wt,Ke,fs="You’ll start with the code below.",Gt,el,xt,ll,Cs=`This code can quickly be converted into a tool, just by wrapping it in a function and adding the <code>tool</code> decorator:
This is not the only way to build the tool: you can directly define it as a subclass of <a href="/docs/smolagents/main/en/reference/tools#smolagents.Tool">Tool</a>, which gives you more flexibility, for instance the possibility to initialize heavy class attributes.`,_t,tl,js="Let’s see how it works for both options:",Ot,P,St,nl,ks="You get the following logs:",Ht,sl,Lt,K,As='<p>Read more on tools in the <a href="./tutorials/tools#what-is-a-tool-and-how-to-build-one">dedicated tutorial</a>.</p>',zt,al,Yt,ol,Rs='Multi-agent systems have been introduced with Microsoft’s framework <a href="https://huggingface.co/papers/2308.08155" rel="nofollow">Autogen</a>.',Dt,il,Bs=`In this type of framework, you have several agents working together to solve your task instead of only one.
It empirically yields better performance on most benchmarks. The reason for this better performance is conceptually simple: for many tasks, rather than using a do-it-all system, you would prefer to specialize units on sub-tasks. Here, having agents with separate tool sets and memories allows to achieve efficient specialization. For instance, why fill the memory of the code generating agent with all the content of webpages visited by the web search agent? It’s better to keep them separate.`,Xt,Tl,vs="You can easily build hierarchical multi-agent systems with <code>smolagents</code>.",qt,Jl,Vs=`To do so, just ensure your agent has <code>name</code> and<code>description</code> attributes, which will then be embedded in the manager agent’s system prompt to let it know how to call this managed agent, as we also do for tools.
Then you can pass this managed agent in the parameter managed_agents upon initialization of the manager agent.`,Pt,Ml,Zs='Here’s an example of making an agent that managed a specific web search agent using our native <a href="/docs/smolagents/main/en/reference/default_tools#smolagents.WebSearchTool">WebSearchTool</a>:',Kt,Ul,en,ee,$s='<p>For an in-depth example of an efficient multi-agent implementation, see <a href="https://huggingface.co/blog/beating-gaia" rel="nofollow">how we pushed our multi-agent system to the top of the GAIA leaderboard</a>.</p>',ln,rl,tn,pl,Fs="You can use <code>GradioUI</code> to interactively submit tasks to your agent and observe its thought and execution process, here is an example:",nn,dl,sn,yl,Ns=`Under the hood, when the user types a new answer, the agent is launched with <code>agent.run(user_request, reset=False)</code>.
The <code>reset=False</code> flag means the agent’s memory is not flushed before launching this new task, which lets the conversation go on.`,an,ul,Es="You can also use this <code>reset=False</code> argument to keep the conversation going in any other agentic application.",on,wl,Qs=`In gradio UIs, if you want to allow users to interrupt a running agent, you could do this with a button that triggers method <code>agent.interrupt()</code>.
This will stop the agent at the end of its current step, then raise an error.`,Tn,cl,Jn,ml,Ws="Finally, when you’ve configured your agent to your needs, you can share it to the Hub!",Mn,gl,Un,hl,Gs="Similarly, to load an agent that has been pushed to hub, if you trust the code from its tools, use:",rn,bl,pn,Il,xs="For more in-depth usage, you will then want to check out our tutorials:",dn,fl,_s='<li><a href="./tutorials/secure_code_execution">the explanation of how our code agents work</a></li> <li><a href="./tutorials/building_good_agents">this guide on how to build good agents</a>.</li> <li><a href="./tutorials/building_good_agents">the in-depth guide for tool usage</a>.</li>',yn,Cl,un,Gl,wn;return d=new qs({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new Ks({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/guided_tour.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/pytorch/guided_tour.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/en/tensorflow/guided_tour.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/guided_tour.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/pytorch/guided_tour.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/en/tensorflow/guided_tour.ipynb"}]}}),r=new x({props:{title:"Agents - Guided tour",local:"agents---guided-tour",headingTag:"h1"}}),y=new x({props:{title:"Choosing an agent type: CodeAgent or ToolCallingAgent",local:"choosing-an-agent-type-codeagent-or-toolcallingagent",headingTag:"h2"}}),le=new E({props:{code:"cmVzdWx0JTIwJTNEJTIwc2VhcmNoX2RvY3MoJTIyV2hhdCUyMGlzJTIwdGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTNGJTIyKSUwQXByaW50KHJlc3VsdCk=",highlighted:`result = search_docs(<span class="hljs-string">&quot;What is the capital of France?&quot;</span>)
<span class="hljs-built_in">print</span>(result)`,wrap:!1}}),ne=new E({props:{code:"JTdCJTBBJTIwJTIwJTIydG9vbF9jYWxsJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMnNlYXJjaF9kb2NzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXJndW1lbnRzJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIycXVlcnklMjIlM0ElMjAlMjJXaGF0JTIwaXMlMjB0aGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlM0YlMjIlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlN0QlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;tool_call&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;search_docs&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;arguments&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">&quot;query&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;What is the capital of France?&quot;</span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),oe=new x({props:{title:"CodeAgent",local:"codeagent",headingTag:"h2"}}),Me=new E({props:{code:"bW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkaXRpb25hbF9hdXRob3JpemVkX2ltcG9ydHMlM0QlNUIncmVxdWVzdHMnJTJDJTIwJ2JzNCclNUQpJTBBYWdlbnQucnVuKCUyMkNvdWxkJTIweW91JTIwZ2V0JTIwbWUlMjB0aGUlMjB0aXRsZSUyMG9mJTIwdGhlJTIwcGFnZSUyMGF0JTIwdXJsJTIwJ2h0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZibG9nJyUzRiUyMik=",highlighted:`model = InferenceClientModel()
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=[<span class="hljs-string">&#x27;requests&#x27;</span>, <span class="hljs-string">&#x27;bs4&#x27;</span>])
agent.run(<span class="hljs-string">&quot;Could you get me the title of the page at url &#x27;https://huggingface.co/blog&#x27;?&quot;</span>)`,wrap:!1}}),de=new x({props:{title:"ToolCallingAgent",local:"toolcallingagent",headingTag:"h3"}}),we=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sQ2FsbGluZ0FnZW50JTJDJTIwV2ViU2VhcmNoVG9vbCUwQSUwQWFnZW50JTIwJTNEJTIwVG9vbENhbGxpbmdBZ2VudCh0b29scyUzRCU1QldlYlNlYXJjaFRvb2woKSU1RCUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBYWdlbnQucnVuKCUyMkNvdWxkJTIweW91JTIwZ2V0JTIwbWUlMjB0aGUlMjB0aXRsZSUyMG9mJTIwdGhlJTIwcGFnZSUyMGF0JTIwdXJsJTIwJ2h0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZibG9nJyUzRiUyMik=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> ToolCallingAgent, WebSearchTool

agent = ToolCallingAgent(tools=[WebSearchTool()], model=model)
agent.run(<span class="hljs-string">&quot;Could you get me the title of the page at url &#x27;https://huggingface.co/blog&#x27;?&quot;</span>)`,wrap:!1}}),ce=new x({props:{title:"Building your agent",local:"building-your-agent",headingTag:"h2"}}),q=new Hs({props:{id:"Pick a LLM",options:["Inference Providers","Local Transformers Model","OpenAI or Anthropic API","Ollama","Azure OpenAI","Amazon Bedrock","mlx-lm"],$$slots:{default:[ia]},$$scope:{ctx:Q}}}),Ie=new x({props:{title:"Model parameter management",local:"model-parameter-management",headingTag:"h3"}}),je=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBPcGVuQUlNb2RlbCUyQyUyMFJFTU9WRV9QQVJBTUVURVIlMEElMEElMjMlMjBSZW1vdmUlMjAlMjJzdG9wJTIyJTIwcGFyYW1ldGVyJTBBbW9kZWwlMjAlM0QlMjBPcGVuQUlNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC01JTIyJTJDJTBBJTIwJTIwJTIwJTIwc3RvcCUzRFJFTU9WRV9QQVJBTUVURVIlMkMlMjAlMjAlMjMlMjBFbnN1cmVzJTIwJTIyc3RvcCUyMiUyMGlzJTIwbm90JTIwaW5jbHVkZWQlMjBpbiUyMEFQSSUyMGNhbGxzJTBBJTIwJTIwJTIwJTIwdGVtcGVyYXR1cmUlM0QwLjclMEEpJTBBJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> OpenAIModel, REMOVE_PARAMETER

<span class="hljs-comment"># Remove &quot;stop&quot; parameter</span>
model = OpenAIModel(
    model_id=<span class="hljs-string">&quot;gpt-5&quot;</span>,
    stop=REMOVE_PARAMETER,  <span class="hljs-comment"># Ensures &quot;stop&quot; is not included in API calls</span>
    temperature=<span class="hljs-number">0.7</span>
)

agent = CodeAgent(tools=[], model=model, add_base_tools=<span class="hljs-literal">True</span>)`,wrap:!1}}),Re=new x({props:{title:"Advanced agent configuration",local:"advanced-agent-configuration",headingTag:"h2"}}),Be=new x({props:{title:"Customizing agent termination conditions",local:"customizing-agent-termination-conditions",headingTag:"h3"}}),Ve=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQSUyMyUyMERlZmluZSUyMGElMjBjdXN0b20lMjBmaW5hbCUyMGFuc3dlciUyMGNoZWNrJTIwZnVuY3Rpb24lMEFkZWYlMjBpc19pbnRlZ2VyKGZpbmFsX2Fuc3dlciUzQSUyMHN0ciUyQyUyMGFnZW50X21lbW9yeSUzRE5vbmUpJTIwLSUzRSUyMGJvb2wlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJSZXR1cm4lMjBUcnVlJTIwaWYlMjBmaW5hbF9hbnN3ZXIlMjBpcyUyMGFuJTIwaW50ZWdlci4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjB0cnklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpbnQoZmluYWxfYW5zd2VyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMFRydWUlMEElMjAlMjAlMjAlMjBleGNlcHQlMjBWYWx1ZUVycm9yJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwRmFsc2UlMEElMEElMjMlMjBJbml0aWFsaXplJTIwYWdlbnQlMjB3aXRoJTIwY3VzdG9tJTIwZmluYWwlMjBhbnN3ZXIlMjBjaGVjayUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KCUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEJTVCJTVEJTJDJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0RJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTJDJTBBJTIwJTIwJTIwJTIwZmluYWxfYW5zd2VyX2NoZWNrcyUzRCU1QmlzX2ludGVnZXIlNUQlMEEpJTBBJTBBYWdlbnQucnVuKCUyMkNhbGN1bGF0ZSUyMHRoZSUyMGxlYXN0JTIwY29tbW9uJTIwbXVsdGlwbGUlMjBvZiUyMDMlMjBhbmQlMjA3JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

<span class="hljs-comment"># Define a custom final answer check function</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">is_integer</span>(<span class="hljs-params">final_answer: <span class="hljs-built_in">str</span>, agent_memory=<span class="hljs-literal">None</span></span>) -&gt; <span class="hljs-built_in">bool</span>:
    <span class="hljs-string">&quot;&quot;&quot;Return True if final_answer is an integer.&quot;&quot;&quot;</span>
    <span class="hljs-keyword">try</span>:
        <span class="hljs-built_in">int</span>(final_answer)
        <span class="hljs-keyword">return</span> <span class="hljs-literal">True</span>
    <span class="hljs-keyword">except</span> ValueError:
        <span class="hljs-keyword">return</span> <span class="hljs-literal">False</span>

<span class="hljs-comment"># Initialize agent with custom final answer check</span>
agent = CodeAgent(
    tools=[],
    model=InferenceClientModel(),
    final_answer_checks=[is_integer]
)

agent.run(<span class="hljs-string">&quot;Calculate the least common multiple of 3 and 7&quot;</span>)`,wrap:!1}}),Ee=new x({props:{title:"Inspecting an agent run",local:"inspecting-an-agent-run",headingTag:"h2"}}),Ge=new x({props:{title:"Tools",local:"tools",headingTag:"h2"}}),Le=new x({props:{title:"Default toolbox",local:"default-toolbox",headingTag:"h3"}}),Xe=new E({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QnRvb2xraXQlNUQnJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBXZWJTZWFyY2hUb29sJTBBJTBBc2VhcmNoX3Rvb2wlMjAlM0QlMjBXZWJTZWFyY2hUb29sKCklMEFwcmludChzZWFyY2hfdG9vbCglMjJXaG8ncyUyMHRoZSUyMGN1cnJlbnQlMjBwcmVzaWRlbnQlMjBvZiUyMFJ1c3NpYSUzRiUyMikp",highlighted:`<span class="hljs-comment"># !pip install &#x27;smolagents[toolkit]&#x27;</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> WebSearchTool

search_tool = WebSearchTool()
<span class="hljs-built_in">print</span>(search_tool(<span class="hljs-string">&quot;Who&#x27;s the current president of Russia?&quot;</span>))`,wrap:!1}}),qe=new x({props:{title:"Create a new tool",local:"create-a-new-tool",headingTag:"h3"}}),el=new E({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfbW9kZWxzJTBBJTBBdGFzayUyMCUzRCUyMCUyMnRleHQtY2xhc3NpZmljYXRpb24lMjIlMEElMEFtb3N0X2Rvd25sb2FkZWRfbW9kZWwlMjAlM0QlMjBuZXh0KGl0ZXIobGlzdF9tb2RlbHMoZmlsdGVyJTNEdGFzayUyQyUyMHNvcnQlM0QlMjJkb3dubG9hZHMlMjIlMkMlMjBkaXJlY3Rpb24lM0QtMSkpKSUwQXByaW50KG1vc3RfZG93bmxvYWRlZF9tb2RlbC5pZCk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

task = <span class="hljs-string">&quot;text-classification&quot;</span>

most_downloaded_model = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(list_models(<span class="hljs-built_in">filter</span>=task, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>)))
<span class="hljs-built_in">print</span>(most_downloaded_model.<span class="hljs-built_in">id</span>)`,wrap:!1}}),P=new Hs({props:{id:"build-a-tool",options:["Decorate a function with @tool","Subclass Tool"],$$slots:{default:[Ma]},$$scope:{ctx:Q}}}),sl=new E({props:{code:" ",highlighted:`╭──────────────────────────────────────── New run ─────────────────────────────────────────╮
│                                                                                          │
│ Can you give me the name of the model that has the most downloads in the &#x27;text-to-video&#x27; │
│ task on the Hugging Face Hub?                                                            │
│                                                                                          │
╰─ InferenceClientModel - Qwen/Qwen2.5-Coder-32B-Instruct ───────────────────────────────────────────╯
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 0 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─ Executing this code: ───────────────────────────────────────────────────────────────────╮
│   1 model_name = model_download_tool(task=&quot;text-to-video&quot;)                               │
│   2 print(model_name)                                                                    │
╰──────────────────────────────────────────────────────────────────────────────────────────╯
Execution logs:
ByteDance/AnimateDiff-Lightning

Out: None
[Step 0: Duration 0.27 seconds| Input tokens: 2,069 | Output tokens: 60]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Step 1 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
╭─ Executing this code: ───────────────────────────────────────────────────────────────────╮
│   1 final_answer(&quot;ByteDance/AnimateDiff-Lightning&quot;)                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────╯
Out - Final answer: ByteDance/AnimateDiff-Lightning
[Step 1: Duration 0.10 seconds| Input tokens: 4,288 | Output tokens: 148]
Out[20]: &#x27;ByteDance/AnimateDiff-Lightning&#x27;`,wrap:!1}}),al=new x({props:{title:"Multi-agents",local:"multi-agents",headingTag:"h2"}}),Ul=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUyQyUyMFdlYlNlYXJjaFRvb2wlMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKCklMEElMEF3ZWJfYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQoJTBBJTIwJTIwJTIwJTIwdG9vbHMlM0QlNUJXZWJTZWFyY2hUb29sKCklNUQlMkMlMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwbmFtZSUzRCUyMndlYl9zZWFyY2hfYWdlbnQlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXNjcmlwdGlvbiUzRCUyMlJ1bnMlMjB3ZWIlMjBzZWFyY2hlcyUyMGZvciUyMHlvdS4lMjBHaXZlJTIwaXQlMjB5b3VyJTIwcXVlcnklMjBhcyUyMGFuJTIwYXJndW1lbnQuJTIyJTBBKSUwQSUwQW1hbmFnZXJfYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQoJTBBJTIwJTIwJTIwJTIwdG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwbWFuYWdlZF9hZ2VudHMlM0QlNUJ3ZWJfYWdlbnQlNUQlMEEpJTBBJTBBbWFuYWdlcl9hZ2VudC5ydW4oJTIyV2hvJTIwaXMlMjB0aGUlMjBDRU8lMjBvZiUyMEh1Z2dpbmclMjBGYWNlJTNGJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel, WebSearchTool

model = InferenceClientModel()

web_agent = CodeAgent(
    tools=[WebSearchTool()],
    model=model,
    name=<span class="hljs-string">&quot;web_search_agent&quot;</span>,
    description=<span class="hljs-string">&quot;Runs web searches for you. Give it your query as an argument.&quot;</span>
)

manager_agent = CodeAgent(
    tools=[], model=model, managed_agents=[web_agent]
)

manager_agent.run(<span class="hljs-string">&quot;Who is the CEO of Hugging Face?&quot;</span>)`,wrap:!1}}),rl=new x({props:{title:"Talk with your agent and visualize its thoughts in a cool Gradio interface",local:"talk-with-your-agent-and-visualize-its-thoughts-in-a-cool-gradio-interface",headingTag:"h2"}}),dl=new E({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjAoJTBBJTIwJTIwJTIwJTIwbG9hZF90b29sJTJDJTBBJTIwJTIwJTIwJTIwQ29kZUFnZW50JTJDJTBBJTIwJTIwJTIwJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwlMkMlMEElMjAlMjAlMjAlMjBHcmFkaW9VSSUwQSklMEElMEElMjMlMjBJbXBvcnQlMjB0b29sJTIwZnJvbSUyMEh1YiUwQWltYWdlX2dlbmVyYXRpb25fdG9vbCUyMCUzRCUyMGxvYWRfdG9vbCglMjJtLXJpYyUyRnRleHQtdG8taW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbChtb2RlbF9pZCUzRG1vZGVsX2lkKSUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBhZ2VudCUyMHdpdGglMjB0aGUlMjBpbWFnZSUyMGdlbmVyYXRpb24lMjB0b29sJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUJpbWFnZV9nZW5lcmF0aW9uX3Rvb2wlNUQlMkMlMjBtb2RlbCUzRG1vZGVsKSUwQSUwQUdyYWRpb1VJKGFnZW50KS5sYXVuY2goKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> (
    load_tool,
    CodeAgent,
    InferenceClientModel,
    GradioUI
)

<span class="hljs-comment"># Import tool from Hub</span>
image_generation_tool = load_tool(<span class="hljs-string">&quot;m-ric/text-to-image&quot;</span>, trust_remote_code=<span class="hljs-literal">True</span>)

model = InferenceClientModel(model_id=model_id)

<span class="hljs-comment"># Initialize the agent with the image generation tool</span>
agent = CodeAgent(tools=[image_generation_tool], model=model)

GradioUI(agent).launch()`,wrap:!1}}),cl=new x({props:{title:"Next steps",local:"next-steps",headingTag:"h2"}}),gl=new E({props:{code:"YWdlbnQucHVzaF90b19odWIoJTIybS1yaWMlMkZteV9hZ2VudCUyMik=",highlighted:'agent.push_to_hub(<span class="hljs-string">&quot;m-ric/my_agent&quot;</span>)',wrap:!1}}),bl=new E({props:{code:"YWdlbnQuZnJvbV9odWIoJTIybS1yaWMlMkZteV9hZ2VudCUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSk=",highlighted:'agent.from_hub(<span class="hljs-string">&quot;m-ric/my_agent&quot;</span>, trust_remote_code=<span class="hljs-literal">True</span>)',wrap:!1}}),Cl=new Ps({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/guided_tour.md"}}),{c(){o=i("meta"),j=s(),M=i("p"),u=s(),c(d.$$.fragment),p=s(),c(f.$$.fragment),B=s(),c(r.$$.fragment),N=s(),v=i("p"),v.textContent=R,$=s(),c(y.$$.fragment),J=s(),A=i("p"),A.innerHTML=C,V=s(),G=i("ul"),w=i("li"),F=i("p"),F.innerHTML=k,W=s(),_=i("ul"),Rl=i("li"),Rl.textContent=Zn,mn=s(),Bl=i("li"),Bl.textContent=$n,gn=s(),vl=i("li"),hn=Os(`Example of tool call:

	`),c(le.$$.fragment),bn=s(),Vl=i("li"),Vl.innerHTML=Fn,In=s(),Zl=i("li"),Zl.innerHTML=Nn,fn=s(),te=i("li"),$l=i("p"),$l.innerHTML=En,Cn=s(),O=i("ul"),Fl=i("li"),Fl.textContent=Qn,jn=s(),Nl=i("li"),Nl.textContent=Wn,kn=s(),El=i("li"),An=Os(`Example of tool call:

	`),c(ne.$$.fragment),Rn=s(),Ql=i("li"),Ql.innerHTML=Gn,Bn=s(),Wl=i("li"),Wl.innerHTML=xn,xl=s(),se=i("p"),se.textContent=_n,_l=s(),ae=i("ul"),ae.innerHTML=On,Ol=s(),c(oe.$$.fragment),Sl=s(),ie=i("p"),ie.innerHTML=Sn,Hl=s(),Te=i("p"),Te.innerHTML=Hn,Ll=s(),Je=i("p"),Je.innerHTML=Ln,zl=s(),c(Me.$$.fragment),Yl=s(),Ue=i("p"),Ue.innerHTML=zn,Dl=s(),D=i("blockquote"),D.innerHTML=Yn,Xl=s(),re=i("p"),re.textContent=Dn,ql=s(),pe=i("p"),pe.innerHTML=Xn,Pl=s(),X=i("blockquote"),X.innerHTML=qn,Kl=s(),c(de.$$.fragment),et=s(),ye=i("p"),ye.innerHTML=Pn,lt=s(),ue=i("p"),ue.innerHTML=Kn,tt=s(),c(we.$$.fragment),nt=s(),c(ce.$$.fragment),st=s(),me=i("p"),me.textContent=es,at=s(),ge=i("ul"),ge.innerHTML=ls,ot=s(),he=i("p"),he.innerHTML=ts,it=s(),be=i("p"),be.innerHTML=ns,Tt=s(),c(q.$$.fragment),Jt=s(),c(Ie.$$.fragment),Mt=s(),fe=i("p"),fe.textContent=ss,Ut=s(),Ce=i("p"),Ce.innerHTML=as,rt=s(),c(je.$$.fragment),pt=s(),ke=i("p"),ke.textContent=os,dt=s(),Ae=i("ul"),Ae.innerHTML=is,yt=s(),c(Re.$$.fragment),ut=s(),c(Be.$$.fragment),wt=s(),ve=i("p"),ve.innerHTML=Ts,ct=s(),c(Ve.$$.fragment),mt=s(),Ze=i("p"),Ze.innerHTML=Js,gt=s(),$e=i("ul"),$e.innerHTML=Ms,ht=s(),Fe=i("p"),Fe.innerHTML=Us,bt=s(),Ne=i("ul"),Ne.innerHTML=rs,It=s(),c(Ee.$$.fragment),ft=s(),Qe=i("p"),Qe.textContent=ps,Ct=s(),We=i("ul"),We.innerHTML=ds,jt=s(),c(Ge.$$.fragment),kt=s(),xe=i("p"),xe.textContent=ys,At=s(),_e=i("ul"),_e.innerHTML=us,Rt=s(),Oe=i("p"),Oe.innerHTML=ws,Bt=s(),Se=i("p"),Se.textContent=cs,vt=s(),He=i("p"),He.innerHTML=ms,Vt=s(),c(Le.$$.fragment),Zt=s(),ze=i("p"),ze.innerHTML=gs,$t=s(),Ye=i("ul"),Ye.innerHTML=hs,Ft=s(),De=i("p"),De.textContent=bs,Nt=s(),c(Xe.$$.fragment),Et=s(),c(qe.$$.fragment),Qt=s(),Pe=i("p"),Pe.textContent=Is,Wt=s(),Ke=i("p"),Ke.textContent=fs,Gt=s(),c(el.$$.fragment),xt=s(),ll=i("p"),ll.innerHTML=Cs,_t=s(),tl=i("p"),tl.textContent=js,Ot=s(),c(P.$$.fragment),St=s(),nl=i("p"),nl.textContent=ks,Ht=s(),c(sl.$$.fragment),Lt=s(),K=i("blockquote"),K.innerHTML=As,zt=s(),c(al.$$.fragment),Yt=s(),ol=i("p"),ol.innerHTML=Rs,Dt=s(),il=i("p"),il.textContent=Bs,Xt=s(),Tl=i("p"),Tl.innerHTML=vs,qt=s(),Jl=i("p"),Jl.innerHTML=Vs,Pt=s(),Ml=i("p"),Ml.innerHTML=Zs,Kt=s(),c(Ul.$$.fragment),en=s(),ee=i("blockquote"),ee.innerHTML=$s,ln=s(),c(rl.$$.fragment),tn=s(),pl=i("p"),pl.innerHTML=Fs,nn=s(),c(dl.$$.fragment),sn=s(),yl=i("p"),yl.innerHTML=Ns,an=s(),ul=i("p"),ul.innerHTML=Es,on=s(),wl=i("p"),wl.innerHTML=Qs,Tn=s(),c(cl.$$.fragment),Jn=s(),ml=i("p"),ml.textContent=Ws,Mn=s(),c(gl.$$.fragment),Un=s(),hl=i("p"),hl.textContent=Gs,rn=s(),c(bl.$$.fragment),pn=s(),Il=i("p"),Il.textContent=xs,dn=s(),fl=i("ul"),fl.innerHTML=_s,yn=s(),c(Cl.$$.fragment),un=s(),Gl=i("p"),this.h()},l(e){const n=Xs("svelte-u9bgzb",document.head);o=T(n,"META",{name:!0,content:!0}),n.forEach(l),j=a(e),M=T(e,"P",{}),L(M).forEach(l),u=a(e),m(d.$$.fragment,e),p=a(e),m(f.$$.fragment,e),B=a(e),m(r.$$.fragment,e),N=a(e),v=T(e,"P",{"data-svelte-h":!0}),U(v)!=="svelte-c0efqa"&&(v.textContent=R),$=a(e),m(y.$$.fragment,e),J=a(e),A=T(e,"P",{"data-svelte-h":!0}),U(A)!=="svelte-h5uonc"&&(A.innerHTML=C),V=a(e),G=T(e,"UL",{});var jl=L(G);w=T(jl,"LI",{});var kl=L(w);F=T(kl,"P",{"data-svelte-h":!0}),U(F)!=="svelte-1af8c8i"&&(F.innerHTML=k),W=a(kl),_=T(kl,"UL",{});var S=L(_);Rl=T(S,"LI",{"data-svelte-h":!0}),U(Rl)!=="svelte-162n4d9"&&(Rl.textContent=Zn),mn=a(S),Bl=T(S,"LI",{"data-svelte-h":!0}),U(Bl)!=="svelte-8tmb6j"&&(Bl.textContent=$n),gn=a(S),vl=T(S,"LI",{});var vn=L(vl);hn=Ss(vn,`Example of tool call:

	`),m(le.$$.fragment,vn),vn.forEach(l),bn=a(S),Vl=T(S,"LI",{"data-svelte-h":!0}),U(Vl)!=="svelte-19a4b4m"&&(Vl.innerHTML=Fn),In=a(S),Zl=T(S,"LI",{"data-svelte-h":!0}),U(Zl)!=="svelte-1d48njn"&&(Zl.innerHTML=Nn),S.forEach(l),kl.forEach(l),fn=a(jl),te=T(jl,"LI",{});var cn=L(te);$l=T(cn,"P",{"data-svelte-h":!0}),U($l)!=="svelte-1415nt2"&&($l.innerHTML=En),Cn=a(cn),O=T(cn,"UL",{});var H=L(O);Fl=T(H,"LI",{"data-svelte-h":!0}),U(Fl)!=="svelte-zh2lf7"&&(Fl.textContent=Qn),jn=a(H),Nl=T(H,"LI",{"data-svelte-h":!0}),U(Nl)!=="svelte-11jmc23"&&(Nl.textContent=Wn),kn=a(H),El=T(H,"LI",{});var Vn=L(El);An=Ss(Vn,`Example of tool call:

	`),m(ne.$$.fragment,Vn),Vn.forEach(l),Rn=a(H),Ql=T(H,"LI",{"data-svelte-h":!0}),U(Ql)!=="svelte-1a7qesu"&&(Ql.innerHTML=Gn),Bn=a(H),Wl=T(H,"LI",{"data-svelte-h":!0}),U(Wl)!=="svelte-1jx67vo"&&(Wl.innerHTML=xn),H.forEach(l),cn.forEach(l),jl.forEach(l),xl=a(e),se=T(e,"P",{"data-svelte-h":!0}),U(se)!=="svelte-hdti8c"&&(se.textContent=_n),_l=a(e),ae=T(e,"UL",{"data-svelte-h":!0}),U(ae)!=="svelte-e8ufzt"&&(ae.innerHTML=On),Ol=a(e),m(oe.$$.fragment,e),Sl=a(e),ie=T(e,"P",{"data-svelte-h":!0}),U(ie)!=="svelte-14emhi0"&&(ie.innerHTML=Sn),Hl=a(e),Te=T(e,"P",{"data-svelte-h":!0}),U(Te)!=="svelte-j8myns"&&(Te.innerHTML=Hn),Ll=a(e),Je=T(e,"P",{"data-svelte-h":!0}),U(Je)!=="svelte-kajc6a"&&(Je.innerHTML=Ln),zl=a(e),m(Me.$$.fragment,e),Yl=a(e),Ue=T(e,"P",{"data-svelte-h":!0}),U(Ue)!=="svelte-1gm9mfe"&&(Ue.innerHTML=zn),Dl=a(e),D=T(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(D)!=="svelte-1dnx9c"&&(D.innerHTML=Yn),Xl=a(e),re=T(e,"P",{"data-svelte-h":!0}),U(re)!=="svelte-1iiqbq7"&&(re.textContent=Dn),ql=a(e),pe=T(e,"P",{"data-svelte-h":!0}),U(pe)!=="svelte-1kjrzws"&&(pe.innerHTML=Xn),Pl=a(e),X=T(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(X)!=="svelte-ypn55a"&&(X.innerHTML=qn),Kl=a(e),m(de.$$.fragment,e),et=a(e),ye=T(e,"P",{"data-svelte-h":!0}),U(ye)!=="svelte-14pd0s8"&&(ye.innerHTML=Pn),lt=a(e),ue=T(e,"P",{"data-svelte-h":!0}),U(ue)!=="svelte-6g59dc"&&(ue.innerHTML=Kn),tt=a(e),m(we.$$.fragment,e),nt=a(e),m(ce.$$.fragment,e),st=a(e),me=T(e,"P",{"data-svelte-h":!0}),U(me)!=="svelte-fbbc6g"&&(me.textContent=es),at=a(e),ge=T(e,"UL",{"data-svelte-h":!0}),U(ge)!=="svelte-1ocpzci"&&(ge.innerHTML=ls),ot=a(e),he=T(e,"P",{"data-svelte-h":!0}),U(he)!=="svelte-rh57s1"&&(he.innerHTML=ts),it=a(e),be=T(e,"P",{"data-svelte-h":!0}),U(be)!=="svelte-zqae9j"&&(be.innerHTML=ns),Tt=a(e),m(q.$$.fragment,e),Jt=a(e),m(Ie.$$.fragment,e),Mt=a(e),fe=T(e,"P",{"data-svelte-h":!0}),U(fe)!=="svelte-pfkmt8"&&(fe.textContent=ss),Ut=a(e),Ce=T(e,"P",{"data-svelte-h":!0}),U(Ce)!=="svelte-sessxc"&&(Ce.innerHTML=as),rt=a(e),m(je.$$.fragment,e),pt=a(e),ke=T(e,"P",{"data-svelte-h":!0}),U(ke)!=="svelte-1nzhrrw"&&(ke.textContent=os),dt=a(e),Ae=T(e,"UL",{"data-svelte-h":!0}),U(Ae)!=="svelte-1waly9s"&&(Ae.innerHTML=is),yt=a(e),m(Re.$$.fragment,e),ut=a(e),m(Be.$$.fragment,e),wt=a(e),ve=T(e,"P",{"data-svelte-h":!0}),U(ve)!=="svelte-1e83m24"&&(ve.innerHTML=Ts),ct=a(e),m(Ve.$$.fragment,e),mt=a(e),Ze=T(e,"P",{"data-svelte-h":!0}),U(Ze)!=="svelte-a39tyc"&&(Ze.innerHTML=Js),gt=a(e),$e=T(e,"UL",{"data-svelte-h":!0}),U($e)!=="svelte-2z1xqp"&&($e.innerHTML=Ms),ht=a(e),Fe=T(e,"P",{"data-svelte-h":!0}),U(Fe)!=="svelte-11i007g"&&(Fe.innerHTML=Us),bt=a(e),Ne=T(e,"UL",{"data-svelte-h":!0}),U(Ne)!=="svelte-xlpltp"&&(Ne.innerHTML=rs),It=a(e),m(Ee.$$.fragment,e),ft=a(e),Qe=T(e,"P",{"data-svelte-h":!0}),U(Qe)!=="svelte-4h2er2"&&(Qe.textContent=ps),Ct=a(e),We=T(e,"UL",{"data-svelte-h":!0}),U(We)!=="svelte-1bxk7ay"&&(We.innerHTML=ds),jt=a(e),m(Ge.$$.fragment,e),kt=a(e),xe=T(e,"P",{"data-svelte-h":!0}),U(xe)!=="svelte-izglpm"&&(xe.textContent=ys),At=a(e),_e=T(e,"UL",{"data-svelte-h":!0}),U(_e)!=="svelte-eja4z2"&&(_e.innerHTML=us),Rt=a(e),Oe=T(e,"P",{"data-svelte-h":!0}),U(Oe)!=="svelte-12z848a"&&(Oe.innerHTML=ws),Bt=a(e),Se=T(e,"P",{"data-svelte-h":!0}),U(Se)!=="svelte-u83m8z"&&(Se.textContent=cs),vt=a(e),He=T(e,"P",{"data-svelte-h":!0}),U(He)!=="svelte-130hadi"&&(He.innerHTML=ms),Vt=a(e),m(Le.$$.fragment,e),Zt=a(e),ze=T(e,"P",{"data-svelte-h":!0}),U(ze)!=="svelte-t7zb7o"&&(ze.innerHTML=gs),$t=a(e),Ye=T(e,"UL",{"data-svelte-h":!0}),U(Ye)!=="svelte-1t8zibg"&&(Ye.innerHTML=hs),Ft=a(e),De=T(e,"P",{"data-svelte-h":!0}),U(De)!=="svelte-1o4z3y"&&(De.textContent=bs),Nt=a(e),m(Xe.$$.fragment,e),Et=a(e),m(qe.$$.fragment,e),Qt=a(e),Pe=T(e,"P",{"data-svelte-h":!0}),U(Pe)!=="svelte-8dd7rj"&&(Pe.textContent=Is),Wt=a(e),Ke=T(e,"P",{"data-svelte-h":!0}),U(Ke)!=="svelte-jio97"&&(Ke.textContent=fs),Gt=a(e),m(el.$$.fragment,e),xt=a(e),ll=T(e,"P",{"data-svelte-h":!0}),U(ll)!=="svelte-1e46wc2"&&(ll.innerHTML=Cs),_t=a(e),tl=T(e,"P",{"data-svelte-h":!0}),U(tl)!=="svelte-x6h8bb"&&(tl.textContent=js),Ot=a(e),m(P.$$.fragment,e),St=a(e),nl=T(e,"P",{"data-svelte-h":!0}),U(nl)!=="svelte-1rndc0g"&&(nl.textContent=ks),Ht=a(e),m(sl.$$.fragment,e),Lt=a(e),K=T(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(K)!=="svelte-1asgeq0"&&(K.innerHTML=As),zt=a(e),m(al.$$.fragment,e),Yt=a(e),ol=T(e,"P",{"data-svelte-h":!0}),U(ol)!=="svelte-6s34wk"&&(ol.innerHTML=Rs),Dt=a(e),il=T(e,"P",{"data-svelte-h":!0}),U(il)!=="svelte-1x0er27"&&(il.textContent=Bs),Xt=a(e),Tl=T(e,"P",{"data-svelte-h":!0}),U(Tl)!=="svelte-1n3puco"&&(Tl.innerHTML=vs),qt=a(e),Jl=T(e,"P",{"data-svelte-h":!0}),U(Jl)!=="svelte-1mo0wtw"&&(Jl.innerHTML=Vs),Pt=a(e),Ml=T(e,"P",{"data-svelte-h":!0}),U(Ml)!=="svelte-fr8l0z"&&(Ml.innerHTML=Zs),Kt=a(e),m(Ul.$$.fragment,e),en=a(e),ee=T(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),U(ee)!=="svelte-gxkl5t"&&(ee.innerHTML=$s),ln=a(e),m(rl.$$.fragment,e),tn=a(e),pl=T(e,"P",{"data-svelte-h":!0}),U(pl)!=="svelte-8ye7ad"&&(pl.innerHTML=Fs),nn=a(e),m(dl.$$.fragment,e),sn=a(e),yl=T(e,"P",{"data-svelte-h":!0}),U(yl)!=="svelte-1k7bqf2"&&(yl.innerHTML=Ns),an=a(e),ul=T(e,"P",{"data-svelte-h":!0}),U(ul)!=="svelte-130f0gy"&&(ul.innerHTML=Es),on=a(e),wl=T(e,"P",{"data-svelte-h":!0}),U(wl)!=="svelte-3zhnpr"&&(wl.innerHTML=Qs),Tn=a(e),m(cl.$$.fragment,e),Jn=a(e),ml=T(e,"P",{"data-svelte-h":!0}),U(ml)!=="svelte-1hjlm82"&&(ml.textContent=Ws),Mn=a(e),m(gl.$$.fragment,e),Un=a(e),hl=T(e,"P",{"data-svelte-h":!0}),U(hl)!=="svelte-2wlmjx"&&(hl.textContent=Gs),rn=a(e),m(bl.$$.fragment,e),pn=a(e),Il=T(e,"P",{"data-svelte-h":!0}),U(Il)!=="svelte-1emppws"&&(Il.textContent=xs),dn=a(e),fl=T(e,"UL",{"data-svelte-h":!0}),U(fl)!=="svelte-1hcect5"&&(fl.innerHTML=_s),yn=a(e),m(Cl.$$.fragment,e),un=a(e),Gl=T(e,"P",{}),L(Gl).forEach(l),this.h()},h(){Al(o,"name","hf:doc:metadata"),Al(o,"content",ra),Al(D,"class","warning"),Al(X,"class","tip"),Al(K,"class","tip"),Al(ee,"class","tip")},m(e,n){Z(document.head,o),t(e,j,n),t(e,M,n),t(e,u,n),g(d,e,n),t(e,p,n),g(f,e,n),t(e,B,n),g(r,e,n),t(e,N,n),t(e,v,n),t(e,$,n),g(y,e,n),t(e,J,n),t(e,A,n),t(e,V,n),t(e,G,n),Z(G,w),Z(w,F),Z(w,W),Z(w,_),Z(_,Rl),Z(_,mn),Z(_,Bl),Z(_,gn),Z(_,vl),Z(vl,hn),g(le,vl,null),Z(_,bn),Z(_,Vl),Z(_,In),Z(_,Zl),Z(G,fn),Z(G,te),Z(te,$l),Z(te,Cn),Z(te,O),Z(O,Fl),Z(O,jn),Z(O,Nl),Z(O,kn),Z(O,El),Z(El,An),g(ne,El,null),Z(O,Rn),Z(O,Ql),Z(O,Bn),Z(O,Wl),t(e,xl,n),t(e,se,n),t(e,_l,n),t(e,ae,n),t(e,Ol,n),g(oe,e,n),t(e,Sl,n),t(e,ie,n),t(e,Hl,n),t(e,Te,n),t(e,Ll,n),t(e,Je,n),t(e,zl,n),g(Me,e,n),t(e,Yl,n),t(e,Ue,n),t(e,Dl,n),t(e,D,n),t(e,Xl,n),t(e,re,n),t(e,ql,n),t(e,pe,n),t(e,Pl,n),t(e,X,n),t(e,Kl,n),g(de,e,n),t(e,et,n),t(e,ye,n),t(e,lt,n),t(e,ue,n),t(e,tt,n),g(we,e,n),t(e,nt,n),g(ce,e,n),t(e,st,n),t(e,me,n),t(e,at,n),t(e,ge,n),t(e,ot,n),t(e,he,n),t(e,it,n),t(e,be,n),t(e,Tt,n),g(q,e,n),t(e,Jt,n),g(Ie,e,n),t(e,Mt,n),t(e,fe,n),t(e,Ut,n),t(e,Ce,n),t(e,rt,n),g(je,e,n),t(e,pt,n),t(e,ke,n),t(e,dt,n),t(e,Ae,n),t(e,yt,n),g(Re,e,n),t(e,ut,n),g(Be,e,n),t(e,wt,n),t(e,ve,n),t(e,ct,n),g(Ve,e,n),t(e,mt,n),t(e,Ze,n),t(e,gt,n),t(e,$e,n),t(e,ht,n),t(e,Fe,n),t(e,bt,n),t(e,Ne,n),t(e,It,n),g(Ee,e,n),t(e,ft,n),t(e,Qe,n),t(e,Ct,n),t(e,We,n),t(e,jt,n),g(Ge,e,n),t(e,kt,n),t(e,xe,n),t(e,At,n),t(e,_e,n),t(e,Rt,n),t(e,Oe,n),t(e,Bt,n),t(e,Se,n),t(e,vt,n),t(e,He,n),t(e,Vt,n),g(Le,e,n),t(e,Zt,n),t(e,ze,n),t(e,$t,n),t(e,Ye,n),t(e,Ft,n),t(e,De,n),t(e,Nt,n),g(Xe,e,n),t(e,Et,n),g(qe,e,n),t(e,Qt,n),t(e,Pe,n),t(e,Wt,n),t(e,Ke,n),t(e,Gt,n),g(el,e,n),t(e,xt,n),t(e,ll,n),t(e,_t,n),t(e,tl,n),t(e,Ot,n),g(P,e,n),t(e,St,n),t(e,nl,n),t(e,Ht,n),g(sl,e,n),t(e,Lt,n),t(e,K,n),t(e,zt,n),g(al,e,n),t(e,Yt,n),t(e,ol,n),t(e,Dt,n),t(e,il,n),t(e,Xt,n),t(e,Tl,n),t(e,qt,n),t(e,Jl,n),t(e,Pt,n),t(e,Ml,n),t(e,Kt,n),g(Ul,e,n),t(e,en,n),t(e,ee,n),t(e,ln,n),g(rl,e,n),t(e,tn,n),t(e,pl,n),t(e,nn,n),g(dl,e,n),t(e,sn,n),t(e,yl,n),t(e,an,n),t(e,ul,n),t(e,on,n),t(e,wl,n),t(e,Tn,n),g(cl,e,n),t(e,Jn,n),t(e,ml,n),t(e,Mn,n),g(gl,e,n),t(e,Un,n),t(e,hl,n),t(e,rn,n),g(bl,e,n),t(e,pn,n),t(e,Il,n),t(e,dn,n),t(e,fl,n),t(e,yn,n),g(Cl,e,n),t(e,un,n),t(e,Gl,n),wn=!0},p(e,[n]){const jl={};n&2&&(jl.$$scope={dirty:n,ctx:e}),q.$set(jl);const kl={};n&2&&(kl.$$scope={dirty:n,ctx:e}),P.$set(kl)},i(e){wn||(h(d.$$.fragment,e),h(f.$$.fragment,e),h(r.$$.fragment,e),h(y.$$.fragment,e),h(le.$$.fragment,e),h(ne.$$.fragment,e),h(oe.$$.fragment,e),h(Me.$$.fragment,e),h(de.$$.fragment,e),h(we.$$.fragment,e),h(ce.$$.fragment,e),h(q.$$.fragment,e),h(Ie.$$.fragment,e),h(je.$$.fragment,e),h(Re.$$.fragment,e),h(Be.$$.fragment,e),h(Ve.$$.fragment,e),h(Ee.$$.fragment,e),h(Ge.$$.fragment,e),h(Le.$$.fragment,e),h(Xe.$$.fragment,e),h(qe.$$.fragment,e),h(el.$$.fragment,e),h(P.$$.fragment,e),h(sl.$$.fragment,e),h(al.$$.fragment,e),h(Ul.$$.fragment,e),h(rl.$$.fragment,e),h(dl.$$.fragment,e),h(cl.$$.fragment,e),h(gl.$$.fragment,e),h(bl.$$.fragment,e),h(Cl.$$.fragment,e),wn=!0)},o(e){b(d.$$.fragment,e),b(f.$$.fragment,e),b(r.$$.fragment,e),b(y.$$.fragment,e),b(le.$$.fragment,e),b(ne.$$.fragment,e),b(oe.$$.fragment,e),b(Me.$$.fragment,e),b(de.$$.fragment,e),b(we.$$.fragment,e),b(ce.$$.fragment,e),b(q.$$.fragment,e),b(Ie.$$.fragment,e),b(je.$$.fragment,e),b(Re.$$.fragment,e),b(Be.$$.fragment,e),b(Ve.$$.fragment,e),b(Ee.$$.fragment,e),b(Ge.$$.fragment,e),b(Le.$$.fragment,e),b(Xe.$$.fragment,e),b(qe.$$.fragment,e),b(el.$$.fragment,e),b(P.$$.fragment,e),b(sl.$$.fragment,e),b(al.$$.fragment,e),b(Ul.$$.fragment,e),b(rl.$$.fragment,e),b(dl.$$.fragment,e),b(cl.$$.fragment,e),b(gl.$$.fragment,e),b(bl.$$.fragment,e),b(Cl.$$.fragment,e),wn=!1},d(e){e&&(l(j),l(M),l(u),l(p),l(B),l(N),l(v),l($),l(J),l(A),l(V),l(G),l(xl),l(se),l(_l),l(ae),l(Ol),l(Sl),l(ie),l(Hl),l(Te),l(Ll),l(Je),l(zl),l(Yl),l(Ue),l(Dl),l(D),l(Xl),l(re),l(ql),l(pe),l(Pl),l(X),l(Kl),l(et),l(ye),l(lt),l(ue),l(tt),l(nt),l(st),l(me),l(at),l(ge),l(ot),l(he),l(it),l(be),l(Tt),l(Jt),l(Mt),l(fe),l(Ut),l(Ce),l(rt),l(pt),l(ke),l(dt),l(Ae),l(yt),l(ut),l(wt),l(ve),l(ct),l(mt),l(Ze),l(gt),l($e),l(ht),l(Fe),l(bt),l(Ne),l(It),l(ft),l(Qe),l(Ct),l(We),l(jt),l(kt),l(xe),l(At),l(_e),l(Rt),l(Oe),l(Bt),l(Se),l(vt),l(He),l(Vt),l(Zt),l(ze),l($t),l(Ye),l(Ft),l(De),l(Nt),l(Et),l(Qt),l(Pe),l(Wt),l(Ke),l(Gt),l(xt),l(ll),l(_t),l(tl),l(Ot),l(St),l(nl),l(Ht),l(Lt),l(K),l(zt),l(Yt),l(ol),l(Dt),l(il),l(Xt),l(Tl),l(qt),l(Jl),l(Pt),l(Ml),l(Kt),l(en),l(ee),l(ln),l(tn),l(pl),l(nn),l(sn),l(yl),l(an),l(ul),l(on),l(wl),l(Tn),l(Jn),l(ml),l(Mn),l(Un),l(hl),l(rn),l(pn),l(Il),l(dn),l(fl),l(yn),l(un),l(Gl)),l(o),I(d,e),I(f,e),I(r,e),I(y,e),I(le),I(ne),I(oe,e),I(Me,e),I(de,e),I(we,e),I(ce,e),I(q,e),I(Ie,e),I(je,e),I(Re,e),I(Be,e),I(Ve,e),I(Ee,e),I(Ge,e),I(Le,e),I(Xe,e),I(qe,e),I(el,e),I(P,e),I(sl,e),I(al,e),I(Ul,e),I(rl,e),I(dl,e),I(cl,e),I(gl,e),I(bl,e),I(Cl,e)}}}const ra='{"title":"Agents - Guided tour","local":"agents---guided-tour","sections":[{"title":"Choosing an agent type: CodeAgent or ToolCallingAgent","local":"choosing-an-agent-type-codeagent-or-toolcallingagent","sections":[],"depth":2},{"title":"CodeAgent","local":"codeagent","sections":[{"title":"ToolCallingAgent","local":"toolcallingagent","sections":[],"depth":3}],"depth":2},{"title":"Building your agent","local":"building-your-agent","sections":[{"title":"Model parameter management","local":"model-parameter-management","sections":[],"depth":3}],"depth":2},{"title":"Advanced agent configuration","local":"advanced-agent-configuration","sections":[{"title":"Customizing agent termination conditions","local":"customizing-agent-termination-conditions","sections":[],"depth":3}],"depth":2},{"title":"Inspecting an agent run","local":"inspecting-an-agent-run","sections":[],"depth":2},{"title":"Tools","local":"tools","sections":[{"title":"Default toolbox","local":"default-toolbox","sections":[],"depth":3},{"title":"Create a new tool","local":"create-a-new-tool","sections":[],"depth":3}],"depth":2},{"title":"Multi-agents","local":"multi-agents","sections":[],"depth":2},{"title":"Talk with your agent and visualize its thoughts in a cool Gradio interface","local":"talk-with-your-agent-and-visualize-its-thoughts-in-a-cool-gradio-interface","sections":[],"depth":2},{"title":"Next steps","local":"next-steps","sections":[],"depth":2}],"depth":1}';function pa(Q){return zs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ga extends Ys{constructor(o){super(),Ds(this,o,pa,Ua,Ls,{})}}export{ga as component};
