import{s as Ls,o as zs,n as O}from"../chunks/scheduler.f6319a2a.js";import{S as Ys,i as Ds,g as T,s as a,r as c,m as xs,A as Xs,h as J,f as l,c as o,j as L,u as m,x as U,n as Ss,k as Os,y as v,a as n,v as g,d as h,t as f,w as b}from"../chunks/index.85aa684c.js";import{T as xl}from"../chunks/Tip.3d397a88.js";import{C as N}from"../chunks/CodeBlock.3400fc53.js";import{D as qs}from"../chunks/DocNotebookDropdown.3fc3604b.js";import{H as Q,E as Ps}from"../chunks/getInferenceSnippets.55a93fbe.js";import{H as Hs,a as z}from"../chunks/HfOption.bd631572.js";function Ks(R){let s,d="The LLM can generate arbitrary code that will then be executed: do not add any unsafe imports!";return{c(){s=T("p"),s.textContent=d},l(i){s=J(i,"P",{"data-svelte-h":!0}),U(s)!=="svelte-sjm8o2"&&(s.textContent=d)},m(i,p){n(i,s,p)},p:O,d(i){i&&l(s)}}}function ea(R){let s,d='Learn more about code execution <a href="tutorials/secure_code_execution">in this tutorial</a>.';return{c(){s=T("p"),s.innerHTML=d},l(i){s=J(i,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1c04ue1"&&(s.innerHTML=d)},m(i,p){n(i,s,p)},p:O,d(i){i&&l(s)}}}function la(R){let s,d="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.",i,p,y='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>',u,C,$;return C=new N({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(){s=T("p"),s.innerHTML=d,i=a(),p=T("p"),p.innerHTML=y,u=a(),c(C.$$.fragment)},l(r){s=J(r,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1wdptq1"&&(s.innerHTML=d),i=o(r),p=J(r,"P",{"data-svelte-h":!0}),U(p)!=="svelte-bsbjyv"&&(p.innerHTML=y),u=o(r),m(C.$$.fragment,r)},m(r,B){n(r,s,B),n(r,i,B),n(r,p,B),n(r,u,B),g(C,r,B),$=!0},p:O,i(r){$||(h(C.$$.fragment,r),$=!0)},o(r){f(C.$$.fragment,r),$=!1},d(r){r&&(l(s),l(i),l(p),l(u)),b(C,r)}}}function ta(R){let s,d;return s=new N({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(s.$$.fragment)},l(i){m(s.$$.fragment,i)},m(i,p){g(s,i,p),d=!0},p:O,i(i){d||(h(s.$$.fragment,i),d=!0)},o(i){f(s.$$.fragment,i),d=!1},d(i){b(s,i)}}}function na(R){let s,d="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.",i,p,y;return p=new N({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(){s=T("p"),s.innerHTML=d,i=a(),c(p.$$.fragment)},l(u){s=J(u,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1iplh0r"&&(s.innerHTML=d),i=o(u),m(p.$$.fragment,u)},m(u,C){n(u,s,C),n(u,i,C),g(p,u,C),y=!0},p:O,i(u){y||(h(p.$$.fragment,u),y=!0)},o(u){f(p.$$.fragment,u),y=!1},d(u){u&&(l(s),l(i)),b(p,u)}}}function sa(R){let s,d;return s=new N({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(s.$$.fragment)},l(i){m(s.$$.fragment,i)},m(i,p){g(s,i,p),d=!0},p:O,i(i){d||(h(s.$$.fragment,i),d=!0)},o(i){f(s.$$.fragment,i),d=!1},d(i){b(s,i)}}}function aa(R){let s,d="To connect to Azure OpenAI, you can either use <code>AzureOpenAIServerModel</code> directly, or use <code>LiteLLMModel</code> and configure it accordingly.",i,p,y="To initialize an instance of <code>AzureOpenAIServerModel</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>.",u,C,$,r,B="Similarly, you can configure <code>LiteLLMModel</code> to connect to Azure OpenAI as follows:",V,A,Z="<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>",I,M,k;return C=new N({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1Qm9wZW5haSU1RCclMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwobW9kZWxfaWQlM0QlMjJncHQtNG8tbWluaSUyMiklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",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, AzureOpenAIServerModel

model = AzureOpenAIServerModel(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}}),M=new N({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(){s=T("p"),s.innerHTML=d,i=a(),p=T("p"),p.innerHTML=y,u=a(),c(C.$$.fragment),$=a(),r=T("p"),r.innerHTML=B,V=a(),A=T("ul"),A.innerHTML=Z,I=a(),c(M.$$.fragment)},l(j){s=J(j,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1hxxlnu"&&(s.innerHTML=d),i=o(j),p=J(j,"P",{"data-svelte-h":!0}),U(p)!=="svelte-1q2js0j"&&(p.innerHTML=y),u=o(j),m(C.$$.fragment,j),$=o(j),r=J(j,"P",{"data-svelte-h":!0}),U(r)!=="svelte-116rusl"&&(r.innerHTML=B),V=o(j),A=J(j,"UL",{"data-svelte-h":!0}),U(A)!=="svelte-1nzt61u"&&(A.innerHTML=Z),I=o(j),m(M.$$.fragment,j)},m(j,F){n(j,s,F),n(j,i,F),n(j,p,F),n(j,u,F),g(C,j,F),n(j,$,F),n(j,r,F),n(j,V,F),n(j,A,F),n(j,I,F),g(M,j,F),k=!0},p:O,i(j){k||(h(C.$$.fragment,j),h(M.$$.fragment,j),k=!0)},o(j){f(C.$$.fragment,j),f(M.$$.fragment,j),k=!1},d(j){j&&(l(s),l(i),l(p),l(u),l($),l(r),l(V),l(A),l(I)),b(C,j),b(M,j)}}}function oa(R){let s,d="The <code>AmazonBedrockServerModel</code> class provides native integration with Amazon Bedrock, allowing for direct API calls and comprehensive configuration.",i,p,y="Basic Usage:",u,C,$,r,B="Advanced Configuration:",V,A,Z,I,M="Using LiteLLMModel:",k,j,F="Alternatively, you can use <code>LiteLLMModel</code> with Bedrock models:",W,G,H;return C=new N({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjAnc21vbGFnZW50cyU1QmJlZHJvY2slNUQnJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbChtb2RlbF9pZCUzRCUyMmFudGhyb3BpYy5jbGF1ZGUtMy1zb25uZXQtMjAyNDAyMjktdjElM0EwJTIyKSUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",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, AmazonBedrockServerModel

model = AmazonBedrockServerModel(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}}),A=new N({props:{code:"aW1wb3J0JTIwYm90bzMlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCUwQSUwQSUyMyUyMENyZWF0ZSUyMGElMjBjdXN0b20lMjBCZWRyb2NrJTIwY2xpZW50JTBBYmVkcm9ja19jbGllbnQlMjAlM0QlMjBib3RvMy5jbGllbnQoJTBBJTIwJTIwJTIwJTIwJ2JlZHJvY2stcnVudGltZSclMkMlMEElMjAlMjAlMjAlMjByZWdpb25fbmFtZSUzRCd1cy1lYXN0LTEnJTJDJTBBJTIwJTIwJTIwJTIwYXdzX2FjY2Vzc19rZXlfaWQlM0QnWU9VUl9BQ0NFU1NfS0VZJyUyQyUwQSUyMCUyMCUyMCUyMGF3c19zZWNyZXRfYWNjZXNzX2tleSUzRCdZT1VSX1NFQ1JFVF9LRVknJTBBKSUwQSUwQWFkZGl0aW9uYWxfYXBpX2NvbmZpZyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmluZmVyZW5jZUNvbmZpZyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1heFRva2VucyUyMiUzQSUyMDMwMDAlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxDb25maWclMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxJZGVudGlmaWVyJTIyJTNBJTIwJTIyaWRlbnRpZnkxJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyZ3VhcmRyYWlsVmVyc2lvbiUyMiUzQSUyMCd2MSclMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElN0QlMEElMEElMjMlMjBJbml0aWFsaXplJTIwd2l0aCUyMGNvbXByZWhlbnNpdmUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJ1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJTIyJTJDJTBBJTIwJTIwJTIwJTIwY2xpZW50JTNEYmVkcm9ja19jbGllbnQlMkMlMjAlMjAlMjMlMjBVc2UlMjBjdXN0b20lMjBjbGllbnQlMEElMjAlMjAlMjAlMjAqKmFkZGl0aW9uYWxfYXBpX2NvbmZpZyUwQSklMEElMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> boto3
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AmazonBedrockServerModel

<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 = AmazonBedrockServerModel(
    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}}),G=new N({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(){s=T("p"),s.innerHTML=d,i=a(),p=T("p"),p.textContent=y,u=a(),c(C.$$.fragment),$=a(),r=T("p"),r.textContent=B,V=a(),c(A.$$.fragment),Z=a(),I=T("p"),I.textContent=M,k=a(),j=T("p"),j.innerHTML=F,W=a(),c(G.$$.fragment)},l(w){s=J(w,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1t09vg6"&&(s.innerHTML=d),i=o(w),p=J(w,"P",{"data-svelte-h":!0}),U(p)!=="svelte-16zanz3"&&(p.textContent=y),u=o(w),m(C.$$.fragment,w),$=o(w),r=J(w,"P",{"data-svelte-h":!0}),U(r)!=="svelte-e5fqn2"&&(r.textContent=B),V=o(w),m(A.$$.fragment,w),Z=o(w),I=J(w,"P",{"data-svelte-h":!0}),U(I)!=="svelte-121tojm"&&(I.textContent=M),k=o(w),j=J(w,"P",{"data-svelte-h":!0}),U(j)!=="svelte-zwun4n"&&(j.innerHTML=F),W=o(w),m(G.$$.fragment,w)},m(w,E){n(w,s,E),n(w,i,E),n(w,p,E),n(w,u,E),g(C,w,E),n(w,$,E),n(w,r,E),n(w,V,E),g(A,w,E),n(w,Z,E),n(w,I,E),n(w,k,E),n(w,j,E),n(w,W,E),g(G,w,E),H=!0},p:O,i(w){H||(h(C.$$.fragment,w),h(A.$$.fragment,w),h(G.$$.fragment,w),H=!0)},o(w){f(C.$$.fragment,w),f(A.$$.fragment,w),f(G.$$.fragment,w),H=!1},d(w){w&&(l(s),l(i),l(p),l(u),l($),l(r),l(V),l(Z),l(I),l(k),l(j),l(W)),b(C,w),b(A,w),b(G,w)}}}function ia(R){let s,d;return s=new N({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(s.$$.fragment)},l(i){m(s.$$.fragment,i)},m(i,p){g(s,i,p),d=!0},p:O,i(i){d||(h(s.$$.fragment,i),d=!0)},o(i){f(s.$$.fragment,i),d=!1},d(i){b(s,i)}}}function Ta(R){let s,d,i,p,y,u,C,$,r,B,V,A,Z,I;return s=new z({props:{id:"Pick a LLM",option:"Inference Providers",$$slots:{default:[la]},$$scope:{ctx:R}}}),i=new z({props:{id:"Pick a LLM",option:"Local Transformers Model",$$slots:{default:[ta]},$$scope:{ctx:R}}}),y=new z({props:{id:"Pick a LLM",option:"OpenAI or Anthropic API",$$slots:{default:[na]},$$scope:{ctx:R}}}),C=new z({props:{id:"Pick a LLM",option:"Ollama",$$slots:{default:[sa]},$$scope:{ctx:R}}}),r=new z({props:{id:"Pick a LLM",option:"Azure OpenAI",$$slots:{default:[aa]},$$scope:{ctx:R}}}),V=new z({props:{id:"Pick a LLM",option:"Amazon Bedrock",$$slots:{default:[oa]},$$scope:{ctx:R}}}),Z=new z({props:{id:"Pick a LLM",option:"mlx-lm",$$slots:{default:[ia]},$$scope:{ctx:R}}}),{c(){c(s.$$.fragment),d=a(),c(i.$$.fragment),p=a(),c(y.$$.fragment),u=a(),c(C.$$.fragment),$=a(),c(r.$$.fragment),B=a(),c(V.$$.fragment),A=a(),c(Z.$$.fragment)},l(M){m(s.$$.fragment,M),d=o(M),m(i.$$.fragment,M),p=o(M),m(y.$$.fragment,M),u=o(M),m(C.$$.fragment,M),$=o(M),m(r.$$.fragment,M),B=o(M),m(V.$$.fragment,M),A=o(M),m(Z.$$.fragment,M)},m(M,k){g(s,M,k),n(M,d,k),g(i,M,k),n(M,p,k),g(y,M,k),n(M,u,k),g(C,M,k),n(M,$,k),g(r,M,k),n(M,B,k),g(V,M,k),n(M,A,k),g(Z,M,k),I=!0},p(M,k){const j={};k&2&&(j.$$scope={dirty:k,ctx:M}),s.$set(j);const F={};k&2&&(F.$$scope={dirty:k,ctx:M}),i.$set(F);const W={};k&2&&(W.$$scope={dirty:k,ctx:M}),y.$set(W);const G={};k&2&&(G.$$scope={dirty:k,ctx:M}),C.$set(G);const H={};k&2&&(H.$$scope={dirty:k,ctx:M}),r.$set(H);const w={};k&2&&(w.$$scope={dirty:k,ctx:M}),V.$set(w);const E={};k&2&&(E.$$scope={dirty:k,ctx:M}),Z.$set(E)},i(M){I||(h(s.$$.fragment,M),h(i.$$.fragment,M),h(y.$$.fragment,M),h(C.$$.fragment,M),h(r.$$.fragment,M),h(V.$$.fragment,M),h(Z.$$.fragment,M),I=!0)},o(M){f(s.$$.fragment,M),f(i.$$.fragment,M),f(y.$$.fragment,M),f(C.$$.fragment,M),f(r.$$.fragment,M),f(V.$$.fragment,M),f(Z.$$.fragment,M),I=!1},d(M){M&&(l(d),l(p),l(u),l($),l(B),l(A)),b(s,M),b(i,M),b(y,M),b(C,M),b(r,M),b(V,M),b(Z,M)}}}function Ja(R){let s,d='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>.';return{c(){s=T("p"),s.innerHTML=d},l(i){s=J(i,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1qhpksd"&&(s.innerHTML=d)},m(i,p){n(i,s,p)},p:O,d(i){i&&l(s)}}}function Ma(R){let s,d,i,p="The function needs:",y,u,C="<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>",$,r,B="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,A,Z;return s=new N({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}}),A=new xl({props:{warning:!1,$$slots:{default:[Ja]},$$scope:{ctx:R}}}),{c(){c(s.$$.fragment),d=a(),i=T("p"),i.textContent=p,y=a(),u=T("ul"),u.innerHTML=C,$=a(),r=T("p"),r.textContent=B,V=a(),c(A.$$.fragment)},l(I){m(s.$$.fragment,I),d=o(I),i=J(I,"P",{"data-svelte-h":!0}),U(i)!=="svelte-10btble"&&(i.textContent=p),y=o(I),u=J(I,"UL",{"data-svelte-h":!0}),U(u)!=="svelte-1uouvtx"&&(u.innerHTML=C),$=o(I),r=J(I,"P",{"data-svelte-h":!0}),U(r)!=="svelte-1prqddm"&&(r.textContent=B),V=o(I),m(A.$$.fragment,I)},m(I,M){g(s,I,M),n(I,d,M),n(I,i,M),n(I,y,M),n(I,u,M),n(I,$,M),n(I,r,M),n(I,V,M),g(A,I,M),Z=!0},p(I,M){const k={};M&2&&(k.$$scope={dirty:M,ctx:I}),A.$set(k)},i(I){Z||(h(s.$$.fragment,I),h(A.$$.fragment,I),Z=!0)},o(I){f(s.$$.fragment,I),f(A.$$.fragment,I),Z=!1},d(I){I&&(l(d),l(i),l(y),l(u),l($),l(r),l(V)),b(s,I),b(A,I)}}}function Ua(R){let s,d,i,p="The subclass needs the following attributes:",y,u,C=`<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>`,$;return s=new N({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}}),{c(){c(s.$$.fragment),d=a(),i=T("p"),i.textContent=p,y=a(),u=T("ul"),u.innerHTML=C},l(r){m(s.$$.fragment,r),d=o(r),i=J(r,"P",{"data-svelte-h":!0}),U(i)!=="svelte-1axnp6t"&&(i.textContent=p),y=o(r),u=J(r,"UL",{"data-svelte-h":!0}),U(u)!=="svelte-1e7an1b"&&(u.innerHTML=C)},m(r,B){g(s,r,B),n(r,d,B),n(r,i,B),n(r,y,B),n(r,u,B),$=!0},p:O,i(r){$||(h(s.$$.fragment,r),$=!0)},o(r){f(s.$$.fragment,r),$=!1},d(r){r&&(l(d),l(i),l(y),l(u)),b(s,r)}}}function ra(R){let s,d,i,p;return s=new z({props:{id:"build-a-tool",option:"Decorate a function with @tool",$$slots:{default:[Ma]},$$scope:{ctx:R}}}),i=new z({props:{id:"build-a-tool",option:"Subclass Tool",$$slots:{default:[Ua]},$$scope:{ctx:R}}}),{c(){c(s.$$.fragment),d=a(),c(i.$$.fragment)},l(y){m(s.$$.fragment,y),d=o(y),m(i.$$.fragment,y)},m(y,u){g(s,y,u),n(y,d,u),g(i,y,u),p=!0},p(y,u){const C={};u&2&&(C.$$scope={dirty:u,ctx:y}),s.$set(C);const $={};u&2&&($.$$scope={dirty:u,ctx:y}),i.$set($)},i(y){p||(h(s.$$.fragment,y),h(i.$$.fragment,y),p=!0)},o(y){f(s.$$.fragment,y),f(i.$$.fragment,y),p=!1},d(y){y&&l(d),b(s,y),b(i,y)}}}function pa(R){let s,d='Read more on tools in the <a href="./tutorials/tools#what-is-a-tool-and-how-to-build-one">dedicated tutorial</a>.';return{c(){s=T("p"),s.innerHTML=d},l(i){s=J(i,"P",{"data-svelte-h":!0}),U(s)!=="svelte-y9zy3b"&&(s.innerHTML=d)},m(i,p){n(i,s,p)},p:O,d(i){i&&l(s)}}}function da(R){let s,d='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>.';return{c(){s=T("p"),s.innerHTML=d},l(i){s=J(i,"P",{"data-svelte-h":!0}),U(s)!=="svelte-1d151kq"&&(s.innerHTML=d)},m(i,p){n(i,s,p)},p:O,d(i){i&&l(s)}}}function ua(R){let s,d,i,p,y,u,C,$,r,B="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.",V,A,Z,I,M=`<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.`,k,j,F,W,G='<a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> generates tool calls as Python code snippets.',H,w,E,Nn="The code is executed either locally (potentially unsecure) or in a secure sandbox.",fn,Rl,Fn="Tools are exposed as Python functions (via bindings).",bn,vl,In,ee,Cn,Bl,En="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>",jn,Vl,Qn="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>",kn,le,Zl,Wn='<a href="/docs/smolagents/main/en/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> writes tool calls as structured JSON.',$n,_,Nl,Gn="This is the common format used in many frameworks (OpenAI API), allowing for structured tool interactions without code execution.",An,Fl,_n="Tools are defined with a JSON schema: name, description, parameter types, etc.",Rn,El,vn,te,Bn,Ql,xn="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>",Vn,Wl,Sn="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>",Sl,ne,On="When to use which agent type:",Ol,se,Hn='<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>',Hl,ae,Ll,oe,Ln='<a href="/docs/smolagents/main/en/reference/agents#smolagents.CodeAgent">CodeAgent</a> generates Python code snippets to perform actions and solve tasks.',zl,ie,zn=`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.`,Yl,Te,Yn=`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>:`,Dl,Je,Xl,Me,Dn=`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.`,ql,Y,Pl,Ue,Xn="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.",Kl,re,qn='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.',et,D,lt,pe,tt,de,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.',nt,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:',st,ye,at,we,ot,ce,es="To initialize a minimal agent, you need at least these two arguments:",it,me,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.AzureOpenAIServerModel">AzureOpenAIServerModel</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.AmazonBedrockServerModel">AmazonBedrockServerModel</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>',Tt,ge,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>.',Jt,he,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.`,Mt,X,Ut,fe,rt,be,ss=`When initializing models, you can pass keyword arguments that will be forwarded as completion parameters to the
underlying model API during inference.`,pt,Ie,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:`,dt,Ce,ut,je,os="This is particularly useful when:",yt,ke,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>",wt,$e,ct,Ae,mt,Re,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:`,gt,ve,ht,Be,Js="The <code>final_answer_checks</code> parameter accepts a list of functions that each:",ft,Ve,Ms="<li>Take the agent’s final_answer string the agent’s memory as parameters</li> <li>Return a boolean indicating whether the final_answer is valid (True) or not (False)</li>",bt,Ze,Us=`If any function returns <code>False</code>, the agent will log the error message and continue the run.
This validation mechanism enables:`,It,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>",Ct,Fe,jt,Ee,ps="Here are a few useful attributes to inspect what happened after a run:",kt,Qe,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>",$t,We,At,Ge,us="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:",Rt,_e,ys="<li>A name</li> <li>A description</li> <li>Input types and descriptions</li> <li>An output type</li>",vt,xe,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,Oe,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.",Zt,He,Nt,Le,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>:",Ft,ze,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>',Et,Ye,fs="You can manually use a tool by calling it with its arguments.",Qt,De,Wt,Xe,Gt,qe,bs=`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.`,_t,Pe,Is="You’ll start with the code below.",xt,Ke,St,el,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.`,Ot,ll,js="Let’s see how it works for both options:",Ht,q,Lt,tl,ks="Then you can directly initialize your agent:",zt,nl,Yt,sl,$s="You get the following logs:",Dt,al,Xt,P,qt,ol,Pt,il,As='Multi-agent systems have been introduced with Microsoft’s framework <a href="https://huggingface.co/papers/2308.08155" rel="nofollow">Autogen</a>.',Kt,Tl,Rs=`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.`,en,Jl,vs="You can easily build hierarchical multi-agent systems with <code>smolagents</code>.",ln,Ml,Bs=`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.`,tn,Ul,Vs='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>:',nn,rl,sn,K,an,pl,on,dl,Zs="You can use <code>GradioUI</code> to interactively submit tasks to your agent and observe its thought and execution process, here is an example:",Tn,ul,Jn,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.`,Mn,wl,Fs="You can also use this <code>reset=False</code> argument to keep the conversation going in any other agentic application.",Un,cl,Es=`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.`,rn,ml,pn,gl,Qs="Finally, when you’ve configured your agent to your needs, you can share it to the Hub!",dn,hl,un,fl,Ws="Similarly, to load an agent that has been pushed to hub, if you trust the code from its tools, use:",yn,bl,wn,Il,Gs="For more in-depth usage, you will then want to check out our tutorials:",cn,Cl,_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>',mn,jl,gn,_l,hn;return y=new Q({props:{title:"Agents - Guided tour",local:"agents---guided-tour",headingTag:"h1"}}),C=new qs({props:{classNames:"absolute z-10 right-0 top-0",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"}]}}),A=new Q({props:{title:"Choosing an agent type: CodeAgent or ToolCallingAgent",local:"choosing-an-agent-type-codeagent-or-toolcallingagent",headingTag:"h2"}}),ee=new N({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}}),te=new N({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}}),ae=new Q({props:{title:"CodeAgent",local:"codeagent",headingTag:"h2"}}),Je=new N({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}}),Y=new xl({props:{warning:!0,$$slots:{default:[Ks]},$$scope:{ctx:R}}}),D=new xl({props:{warning:!1,$$slots:{default:[ea]},$$scope:{ctx:R}}}),pe=new Q({props:{title:"ToolCallingAgent",local:"toolcallingagent",headingTag:"h3"}}),ye=new N({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sQ2FsbGluZ0FnZW50JTBBJTBBYWdlbnQlMjAlM0QlMjBUb29sQ2FsbGluZ0FnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCklMEFhZ2VudC5ydW4oJTIyQ291bGQlMjB5b3UlMjBnZXQlMjBtZSUyMHRoZSUyMHRpdGxlJTIwb2YlMjB0aGUlMjBwYWdlJTIwYXQlMjB1cmwlMjAnaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRmJsb2cnJTNGJTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> ToolCallingAgent

agent = ToolCallingAgent(tools=[], 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}}),we=new Q({props:{title:"Building your agent",local:"building-your-agent",headingTag:"h2"}}),X=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:[Ta]},$$scope:{ctx:R}}}),fe=new Q({props:{title:"Model parameter management",local:"model-parameter-management",headingTag:"h3"}}),Ce=new N({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBPcGVuQUlTZXJ2ZXJNb2RlbCUyQyUyMFJFTU9WRV9QQVJBTUVURVIlMEElMEElMjMlMjBSZW1vdmUlMjAlMjJzdG9wJTIyJTIwcGFyYW1ldGVyJTBBbW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC01JTIyJTJDJTBBJTIwJTIwJTIwJTIwc3RvcCUzRFJFTU9WRV9QQVJBTUVURVIlMkMlMjAlMjAlMjMlMjBFbnN1cmVzJTIwJTIyc3RvcCUyMiUyMGlzJTIwbm90JTIwaW5jbHVkZWQlMjBpbiUyMEFQSSUyMGNhbGxzJTBBJTIwJTIwJTIwJTIwdGVtcGVyYXR1cmUlM0QwLjclMEEpJTBBJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> OpenAIServerModel, REMOVE_PARAMETER

<span class="hljs-comment"># Remove &quot;stop&quot; parameter</span>
model = OpenAIServerModel(
    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}}),$e=new Q({props:{title:"Advanced agent configuration",local:"advanced-agent-configuration",headingTag:"h2"}}),Ae=new Q({props:{title:"Customizing agent termination conditions",local:"customizing-agent-termination-conditions",headingTag:"h3"}}),ve=new N({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}}),Fe=new Q({props:{title:"Inspecting an agent run",local:"inspecting-an-agent-run",headingTag:"h2"}}),We=new Q({props:{title:"Tools",local:"tools",headingTag:"h2"}}),He=new Q({props:{title:"Default toolbox",local:"default-toolbox",headingTag:"h3"}}),De=new N({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}}),Xe=new Q({props:{title:"Create a new tool",local:"create-a-new-tool",headingTag:"h3"}}),Ke=new N({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}}),q=new Hs({props:{id:"build-a-tool",options:["Decorate a function with @tool","Subclass Tool"],$$slots:{default:[ra]},$$scope:{ctx:R}}}),nl=new N({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}}),al=new N({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}}),P=new xl({props:{warning:!1,$$slots:{default:[pa]},$$scope:{ctx:R}}}),ol=new Q({props:{title:"Multi-agents",local:"multi-agents",headingTag:"h2"}}),rl=new N({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}}),K=new xl({props:{warning:!1,$$slots:{default:[da]},$$scope:{ctx:R}}}),pl=new Q({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"}}),ul=new N({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}}),ml=new Q({props:{title:"Next steps",local:"next-steps",headingTag:"h2"}}),hl=new N({props:{code:"YWdlbnQucHVzaF90b19odWIoJTIybS1yaWMlMkZteV9hZ2VudCUyMik=",highlighted:'agent.push_to_hub(<span class="hljs-string">&quot;m-ric/my_agent&quot;</span>)',wrap:!1}}),bl=new N({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}}),jl=new Ps({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/guided_tour.md"}}),{c(){s=T("meta"),d=a(),i=T("p"),p=a(),c(y.$$.fragment),u=a(),c(C.$$.fragment),$=a(),r=T("p"),r.textContent=B,V=a(),c(A.$$.fragment),Z=a(),I=T("p"),I.innerHTML=M,k=a(),j=T("ul"),F=T("li"),W=T("p"),W.innerHTML=G,H=a(),w=T("ul"),E=T("li"),E.textContent=Nn,fn=a(),Rl=T("li"),Rl.textContent=Fn,bn=a(),vl=T("li"),In=xs(`Example of tool call:
	`),c(ee.$$.fragment),Cn=a(),Bl=T("li"),Bl.innerHTML=En,jn=a(),Vl=T("li"),Vl.innerHTML=Qn,kn=a(),le=T("li"),Zl=T("p"),Zl.innerHTML=Wn,$n=a(),_=T("ul"),Nl=T("li"),Nl.textContent=Gn,An=a(),Fl=T("li"),Fl.textContent=_n,Rn=a(),El=T("li"),vn=xs(`Example of tool call:
	`),c(te.$$.fragment),Bn=a(),Ql=T("li"),Ql.innerHTML=xn,Vn=a(),Wl=T("li"),Wl.innerHTML=Sn,Sl=a(),ne=T("p"),ne.textContent=On,Ol=a(),se=T("ul"),se.innerHTML=Hn,Hl=a(),c(ae.$$.fragment),Ll=a(),oe=T("p"),oe.innerHTML=Ln,zl=a(),ie=T("p"),ie.innerHTML=zn,Yl=a(),Te=T("p"),Te.innerHTML=Yn,Dl=a(),c(Je.$$.fragment),Xl=a(),Me=T("p"),Me.innerHTML=Dn,ql=a(),c(Y.$$.fragment),Pl=a(),Ue=T("p"),Ue.textContent=Xn,Kl=a(),re=T("p"),re.innerHTML=qn,et=a(),c(D.$$.fragment),lt=a(),c(pe.$$.fragment),tt=a(),de=T("p"),de.innerHTML=Pn,nt=a(),ue=T("p"),ue.innerHTML=Kn,st=a(),c(ye.$$.fragment),at=a(),c(we.$$.fragment),ot=a(),ce=T("p"),ce.textContent=es,it=a(),me=T("ul"),me.innerHTML=ls,Tt=a(),ge=T("p"),ge.innerHTML=ts,Jt=a(),he=T("p"),he.innerHTML=ns,Mt=a(),c(X.$$.fragment),Ut=a(),c(fe.$$.fragment),rt=a(),be=T("p"),be.textContent=ss,pt=a(),Ie=T("p"),Ie.innerHTML=as,dt=a(),c(Ce.$$.fragment),ut=a(),je=T("p"),je.textContent=os,yt=a(),ke=T("ul"),ke.innerHTML=is,wt=a(),c($e.$$.fragment),ct=a(),c(Ae.$$.fragment),mt=a(),Re=T("p"),Re.innerHTML=Ts,gt=a(),c(ve.$$.fragment),ht=a(),Be=T("p"),Be.innerHTML=Js,ft=a(),Ve=T("ul"),Ve.innerHTML=Ms,bt=a(),Ze=T("p"),Ze.innerHTML=Us,It=a(),Ne=T("ul"),Ne.innerHTML=rs,Ct=a(),c(Fe.$$.fragment),jt=a(),Ee=T("p"),Ee.textContent=ps,kt=a(),Qe=T("ul"),Qe.innerHTML=ds,$t=a(),c(We.$$.fragment),At=a(),Ge=T("p"),Ge.textContent=us,Rt=a(),_e=T("ul"),_e.innerHTML=ys,vt=a(),xe=T("p"),xe.innerHTML=ws,Bt=a(),Se=T("p"),Se.textContent=cs,Vt=a(),Oe=T("p"),Oe.innerHTML=ms,Zt=a(),c(He.$$.fragment),Nt=a(),Le=T("p"),Le.innerHTML=gs,Ft=a(),ze=T("ul"),ze.innerHTML=hs,Et=a(),Ye=T("p"),Ye.textContent=fs,Qt=a(),c(De.$$.fragment),Wt=a(),c(Xe.$$.fragment),Gt=a(),qe=T("p"),qe.textContent=bs,_t=a(),Pe=T("p"),Pe.textContent=Is,xt=a(),c(Ke.$$.fragment),St=a(),el=T("p"),el.innerHTML=Cs,Ot=a(),ll=T("p"),ll.textContent=js,Ht=a(),c(q.$$.fragment),Lt=a(),tl=T("p"),tl.textContent=ks,zt=a(),c(nl.$$.fragment),Yt=a(),sl=T("p"),sl.textContent=$s,Dt=a(),c(al.$$.fragment),Xt=a(),c(P.$$.fragment),qt=a(),c(ol.$$.fragment),Pt=a(),il=T("p"),il.innerHTML=As,Kt=a(),Tl=T("p"),Tl.textContent=Rs,en=a(),Jl=T("p"),Jl.innerHTML=vs,ln=a(),Ml=T("p"),Ml.innerHTML=Bs,tn=a(),Ul=T("p"),Ul.innerHTML=Vs,nn=a(),c(rl.$$.fragment),sn=a(),c(K.$$.fragment),an=a(),c(pl.$$.fragment),on=a(),dl=T("p"),dl.innerHTML=Zs,Tn=a(),c(ul.$$.fragment),Jn=a(),yl=T("p"),yl.innerHTML=Ns,Mn=a(),wl=T("p"),wl.innerHTML=Fs,Un=a(),cl=T("p"),cl.innerHTML=Es,rn=a(),c(ml.$$.fragment),pn=a(),gl=T("p"),gl.textContent=Qs,dn=a(),c(hl.$$.fragment),un=a(),fl=T("p"),fl.textContent=Ws,yn=a(),c(bl.$$.fragment),wn=a(),Il=T("p"),Il.textContent=Gs,cn=a(),Cl=T("ul"),Cl.innerHTML=_s,mn=a(),c(jl.$$.fragment),gn=a(),_l=T("p"),this.h()},l(e){const t=Xs("svelte-u9bgzb",document.head);s=J(t,"META",{name:!0,content:!0}),t.forEach(l),d=o(e),i=J(e,"P",{}),L(i).forEach(l),p=o(e),m(y.$$.fragment,e),u=o(e),m(C.$$.fragment,e),$=o(e),r=J(e,"P",{"data-svelte-h":!0}),U(r)!=="svelte-c0efqa"&&(r.textContent=B),V=o(e),m(A.$$.fragment,e),Z=o(e),I=J(e,"P",{"data-svelte-h":!0}),U(I)!=="svelte-h5uonc"&&(I.innerHTML=M),k=o(e),j=J(e,"UL",{});var kl=L(j);F=J(kl,"LI",{});var $l=L(F);W=J($l,"P",{"data-svelte-h":!0}),U(W)!=="svelte-1af8c8i"&&(W.innerHTML=G),H=o($l),w=J($l,"UL",{});var x=L(w);E=J(x,"LI",{"data-svelte-h":!0}),U(E)!=="svelte-162n4d9"&&(E.textContent=Nn),fn=o(x),Rl=J(x,"LI",{"data-svelte-h":!0}),U(Rl)!=="svelte-8tmb6j"&&(Rl.textContent=Fn),bn=o(x),vl=J(x,"LI",{});var Gl=L(vl);In=Ss(Gl,`Example of tool call:
	`),m(ee.$$.fragment,Gl),Gl.forEach(l),Cn=o(x),Bl=J(x,"LI",{"data-svelte-h":!0}),U(Bl)!=="svelte-lcg58m"&&(Bl.innerHTML=En),jn=o(x),Vl=J(x,"LI",{"data-svelte-h":!0}),U(Vl)!=="svelte-1aoquu3"&&(Vl.innerHTML=Qn),x.forEach(l),$l.forEach(l),kn=o(kl),le=J(kl,"LI",{});var Al=L(le);Zl=J(Al,"P",{"data-svelte-h":!0}),U(Zl)!=="svelte-1415nt2"&&(Zl.innerHTML=Wn),$n=o(Al),_=J(Al,"UL",{});var S=L(_);Nl=J(S,"LI",{"data-svelte-h":!0}),U(Nl)!=="svelte-zh2lf7"&&(Nl.textContent=Gn),An=o(S),Fl=J(S,"LI",{"data-svelte-h":!0}),U(Fl)!=="svelte-11jmc23"&&(Fl.textContent=_n),Rn=o(S),El=J(S,"LI",{});var Zn=L(El);vn=Ss(Zn,`Example of tool call:
	`),m(te.$$.fragment,Zn),Zn.forEach(l),Bn=o(S),Ql=J(S,"LI",{"data-svelte-h":!0}),U(Ql)!=="svelte-1mp0djq"&&(Ql.innerHTML=xn),Vn=o(S),Wl=J(S,"LI",{"data-svelte-h":!0}),U(Wl)!=="svelte-xj73p6"&&(Wl.innerHTML=Sn),S.forEach(l),Al.forEach(l),kl.forEach(l),Sl=o(e),ne=J(e,"P",{"data-svelte-h":!0}),U(ne)!=="svelte-hdti8c"&&(ne.textContent=On),Ol=o(e),se=J(e,"UL",{"data-svelte-h":!0}),U(se)!=="svelte-e8ufzt"&&(se.innerHTML=Hn),Hl=o(e),m(ae.$$.fragment,e),Ll=o(e),oe=J(e,"P",{"data-svelte-h":!0}),U(oe)!=="svelte-14emhi0"&&(oe.innerHTML=Ln),zl=o(e),ie=J(e,"P",{"data-svelte-h":!0}),U(ie)!=="svelte-j8myns"&&(ie.innerHTML=zn),Yl=o(e),Te=J(e,"P",{"data-svelte-h":!0}),U(Te)!=="svelte-kajc6a"&&(Te.innerHTML=Yn),Dl=o(e),m(Je.$$.fragment,e),Xl=o(e),Me=J(e,"P",{"data-svelte-h":!0}),U(Me)!=="svelte-1gm9mfe"&&(Me.innerHTML=Dn),ql=o(e),m(Y.$$.fragment,e),Pl=o(e),Ue=J(e,"P",{"data-svelte-h":!0}),U(Ue)!=="svelte-1iiqbq7"&&(Ue.textContent=Xn),Kl=o(e),re=J(e,"P",{"data-svelte-h":!0}),U(re)!=="svelte-1kjrzws"&&(re.innerHTML=qn),et=o(e),m(D.$$.fragment,e),lt=o(e),m(pe.$$.fragment,e),tt=o(e),de=J(e,"P",{"data-svelte-h":!0}),U(de)!=="svelte-1fmui99"&&(de.innerHTML=Pn),nt=o(e),ue=J(e,"P",{"data-svelte-h":!0}),U(ue)!=="svelte-6g59dc"&&(ue.innerHTML=Kn),st=o(e),m(ye.$$.fragment,e),at=o(e),m(we.$$.fragment,e),ot=o(e),ce=J(e,"P",{"data-svelte-h":!0}),U(ce)!=="svelte-fbbc6g"&&(ce.textContent=es),it=o(e),me=J(e,"UL",{"data-svelte-h":!0}),U(me)!=="svelte-4vxn4y"&&(me.innerHTML=ls),Tt=o(e),ge=J(e,"P",{"data-svelte-h":!0}),U(ge)!=="svelte-rh57s1"&&(ge.innerHTML=ts),Jt=o(e),he=J(e,"P",{"data-svelte-h":!0}),U(he)!=="svelte-zqae9j"&&(he.innerHTML=ns),Mt=o(e),m(X.$$.fragment,e),Ut=o(e),m(fe.$$.fragment,e),rt=o(e),be=J(e,"P",{"data-svelte-h":!0}),U(be)!=="svelte-pfkmt8"&&(be.textContent=ss),pt=o(e),Ie=J(e,"P",{"data-svelte-h":!0}),U(Ie)!=="svelte-sessxc"&&(Ie.innerHTML=as),dt=o(e),m(Ce.$$.fragment,e),ut=o(e),je=J(e,"P",{"data-svelte-h":!0}),U(je)!=="svelte-1nzhrrw"&&(je.textContent=os),yt=o(e),ke=J(e,"UL",{"data-svelte-h":!0}),U(ke)!=="svelte-1waly9s"&&(ke.innerHTML=is),wt=o(e),m($e.$$.fragment,e),ct=o(e),m(Ae.$$.fragment,e),mt=o(e),Re=J(e,"P",{"data-svelte-h":!0}),U(Re)!=="svelte-1e83m24"&&(Re.innerHTML=Ts),gt=o(e),m(ve.$$.fragment,e),ht=o(e),Be=J(e,"P",{"data-svelte-h":!0}),U(Be)!=="svelte-a39tyc"&&(Be.innerHTML=Js),ft=o(e),Ve=J(e,"UL",{"data-svelte-h":!0}),U(Ve)!=="svelte-1f3fqeb"&&(Ve.innerHTML=Ms),bt=o(e),Ze=J(e,"P",{"data-svelte-h":!0}),U(Ze)!=="svelte-11i007g"&&(Ze.innerHTML=Us),It=o(e),Ne=J(e,"UL",{"data-svelte-h":!0}),U(Ne)!=="svelte-xlpltp"&&(Ne.innerHTML=rs),Ct=o(e),m(Fe.$$.fragment,e),jt=o(e),Ee=J(e,"P",{"data-svelte-h":!0}),U(Ee)!=="svelte-4h2er2"&&(Ee.textContent=ps),kt=o(e),Qe=J(e,"UL",{"data-svelte-h":!0}),U(Qe)!=="svelte-1bxk7ay"&&(Qe.innerHTML=ds),$t=o(e),m(We.$$.fragment,e),At=o(e),Ge=J(e,"P",{"data-svelte-h":!0}),U(Ge)!=="svelte-izglpm"&&(Ge.textContent=us),Rt=o(e),_e=J(e,"UL",{"data-svelte-h":!0}),U(_e)!=="svelte-eja4z2"&&(_e.innerHTML=ys),vt=o(e),xe=J(e,"P",{"data-svelte-h":!0}),U(xe)!=="svelte-12z848a"&&(xe.innerHTML=ws),Bt=o(e),Se=J(e,"P",{"data-svelte-h":!0}),U(Se)!=="svelte-u83m8z"&&(Se.textContent=cs),Vt=o(e),Oe=J(e,"P",{"data-svelte-h":!0}),U(Oe)!=="svelte-130hadi"&&(Oe.innerHTML=ms),Zt=o(e),m(He.$$.fragment,e),Nt=o(e),Le=J(e,"P",{"data-svelte-h":!0}),U(Le)!=="svelte-t7zb7o"&&(Le.innerHTML=gs),Ft=o(e),ze=J(e,"UL",{"data-svelte-h":!0}),U(ze)!=="svelte-1t8zibg"&&(ze.innerHTML=hs),Et=o(e),Ye=J(e,"P",{"data-svelte-h":!0}),U(Ye)!=="svelte-1o4z3y"&&(Ye.textContent=fs),Qt=o(e),m(De.$$.fragment,e),Wt=o(e),m(Xe.$$.fragment,e),Gt=o(e),qe=J(e,"P",{"data-svelte-h":!0}),U(qe)!=="svelte-8dd7rj"&&(qe.textContent=bs),_t=o(e),Pe=J(e,"P",{"data-svelte-h":!0}),U(Pe)!=="svelte-jio97"&&(Pe.textContent=Is),xt=o(e),m(Ke.$$.fragment,e),St=o(e),el=J(e,"P",{"data-svelte-h":!0}),U(el)!=="svelte-1e46wc2"&&(el.innerHTML=Cs),Ot=o(e),ll=J(e,"P",{"data-svelte-h":!0}),U(ll)!=="svelte-x6h8bb"&&(ll.textContent=js),Ht=o(e),m(q.$$.fragment,e),Lt=o(e),tl=J(e,"P",{"data-svelte-h":!0}),U(tl)!=="svelte-1bc8e8e"&&(tl.textContent=ks),zt=o(e),m(nl.$$.fragment,e),Yt=o(e),sl=J(e,"P",{"data-svelte-h":!0}),U(sl)!=="svelte-1rndc0g"&&(sl.textContent=$s),Dt=o(e),m(al.$$.fragment,e),Xt=o(e),m(P.$$.fragment,e),qt=o(e),m(ol.$$.fragment,e),Pt=o(e),il=J(e,"P",{"data-svelte-h":!0}),U(il)!=="svelte-6s34wk"&&(il.innerHTML=As),Kt=o(e),Tl=J(e,"P",{"data-svelte-h":!0}),U(Tl)!=="svelte-1x0er27"&&(Tl.textContent=Rs),en=o(e),Jl=J(e,"P",{"data-svelte-h":!0}),U(Jl)!=="svelte-1n3puco"&&(Jl.innerHTML=vs),ln=o(e),Ml=J(e,"P",{"data-svelte-h":!0}),U(Ml)!=="svelte-1mo0wtw"&&(Ml.innerHTML=Bs),tn=o(e),Ul=J(e,"P",{"data-svelte-h":!0}),U(Ul)!=="svelte-fr8l0z"&&(Ul.innerHTML=Vs),nn=o(e),m(rl.$$.fragment,e),sn=o(e),m(K.$$.fragment,e),an=o(e),m(pl.$$.fragment,e),on=o(e),dl=J(e,"P",{"data-svelte-h":!0}),U(dl)!=="svelte-8ye7ad"&&(dl.innerHTML=Zs),Tn=o(e),m(ul.$$.fragment,e),Jn=o(e),yl=J(e,"P",{"data-svelte-h":!0}),U(yl)!=="svelte-1k7bqf2"&&(yl.innerHTML=Ns),Mn=o(e),wl=J(e,"P",{"data-svelte-h":!0}),U(wl)!=="svelte-130f0gy"&&(wl.innerHTML=Fs),Un=o(e),cl=J(e,"P",{"data-svelte-h":!0}),U(cl)!=="svelte-3zhnpr"&&(cl.innerHTML=Es),rn=o(e),m(ml.$$.fragment,e),pn=o(e),gl=J(e,"P",{"data-svelte-h":!0}),U(gl)!=="svelte-1hjlm82"&&(gl.textContent=Qs),dn=o(e),m(hl.$$.fragment,e),un=o(e),fl=J(e,"P",{"data-svelte-h":!0}),U(fl)!=="svelte-2wlmjx"&&(fl.textContent=Ws),yn=o(e),m(bl.$$.fragment,e),wn=o(e),Il=J(e,"P",{"data-svelte-h":!0}),U(Il)!=="svelte-1emppws"&&(Il.textContent=Gs),cn=o(e),Cl=J(e,"UL",{"data-svelte-h":!0}),U(Cl)!=="svelte-1hcect5"&&(Cl.innerHTML=_s),mn=o(e),m(jl.$$.fragment,e),gn=o(e),_l=J(e,"P",{}),L(_l).forEach(l),this.h()},h(){Os(s,"name","hf:doc:metadata"),Os(s,"content",ya)},m(e,t){v(document.head,s),n(e,d,t),n(e,i,t),n(e,p,t),g(y,e,t),n(e,u,t),g(C,e,t),n(e,$,t),n(e,r,t),n(e,V,t),g(A,e,t),n(e,Z,t),n(e,I,t),n(e,k,t),n(e,j,t),v(j,F),v(F,W),v(F,H),v(F,w),v(w,E),v(w,fn),v(w,Rl),v(w,bn),v(w,vl),v(vl,In),g(ee,vl,null),v(w,Cn),v(w,Bl),v(w,jn),v(w,Vl),v(j,kn),v(j,le),v(le,Zl),v(le,$n),v(le,_),v(_,Nl),v(_,An),v(_,Fl),v(_,Rn),v(_,El),v(El,vn),g(te,El,null),v(_,Bn),v(_,Ql),v(_,Vn),v(_,Wl),n(e,Sl,t),n(e,ne,t),n(e,Ol,t),n(e,se,t),n(e,Hl,t),g(ae,e,t),n(e,Ll,t),n(e,oe,t),n(e,zl,t),n(e,ie,t),n(e,Yl,t),n(e,Te,t),n(e,Dl,t),g(Je,e,t),n(e,Xl,t),n(e,Me,t),n(e,ql,t),g(Y,e,t),n(e,Pl,t),n(e,Ue,t),n(e,Kl,t),n(e,re,t),n(e,et,t),g(D,e,t),n(e,lt,t),g(pe,e,t),n(e,tt,t),n(e,de,t),n(e,nt,t),n(e,ue,t),n(e,st,t),g(ye,e,t),n(e,at,t),g(we,e,t),n(e,ot,t),n(e,ce,t),n(e,it,t),n(e,me,t),n(e,Tt,t),n(e,ge,t),n(e,Jt,t),n(e,he,t),n(e,Mt,t),g(X,e,t),n(e,Ut,t),g(fe,e,t),n(e,rt,t),n(e,be,t),n(e,pt,t),n(e,Ie,t),n(e,dt,t),g(Ce,e,t),n(e,ut,t),n(e,je,t),n(e,yt,t),n(e,ke,t),n(e,wt,t),g($e,e,t),n(e,ct,t),g(Ae,e,t),n(e,mt,t),n(e,Re,t),n(e,gt,t),g(ve,e,t),n(e,ht,t),n(e,Be,t),n(e,ft,t),n(e,Ve,t),n(e,bt,t),n(e,Ze,t),n(e,It,t),n(e,Ne,t),n(e,Ct,t),g(Fe,e,t),n(e,jt,t),n(e,Ee,t),n(e,kt,t),n(e,Qe,t),n(e,$t,t),g(We,e,t),n(e,At,t),n(e,Ge,t),n(e,Rt,t),n(e,_e,t),n(e,vt,t),n(e,xe,t),n(e,Bt,t),n(e,Se,t),n(e,Vt,t),n(e,Oe,t),n(e,Zt,t),g(He,e,t),n(e,Nt,t),n(e,Le,t),n(e,Ft,t),n(e,ze,t),n(e,Et,t),n(e,Ye,t),n(e,Qt,t),g(De,e,t),n(e,Wt,t),g(Xe,e,t),n(e,Gt,t),n(e,qe,t),n(e,_t,t),n(e,Pe,t),n(e,xt,t),g(Ke,e,t),n(e,St,t),n(e,el,t),n(e,Ot,t),n(e,ll,t),n(e,Ht,t),g(q,e,t),n(e,Lt,t),n(e,tl,t),n(e,zt,t),g(nl,e,t),n(e,Yt,t),n(e,sl,t),n(e,Dt,t),g(al,e,t),n(e,Xt,t),g(P,e,t),n(e,qt,t),g(ol,e,t),n(e,Pt,t),n(e,il,t),n(e,Kt,t),n(e,Tl,t),n(e,en,t),n(e,Jl,t),n(e,ln,t),n(e,Ml,t),n(e,tn,t),n(e,Ul,t),n(e,nn,t),g(rl,e,t),n(e,sn,t),g(K,e,t),n(e,an,t),g(pl,e,t),n(e,on,t),n(e,dl,t),n(e,Tn,t),g(ul,e,t),n(e,Jn,t),n(e,yl,t),n(e,Mn,t),n(e,wl,t),n(e,Un,t),n(e,cl,t),n(e,rn,t),g(ml,e,t),n(e,pn,t),n(e,gl,t),n(e,dn,t),g(hl,e,t),n(e,un,t),n(e,fl,t),n(e,yn,t),g(bl,e,t),n(e,wn,t),n(e,Il,t),n(e,cn,t),n(e,Cl,t),n(e,mn,t),g(jl,e,t),n(e,gn,t),n(e,_l,t),hn=!0},p(e,[t]){const kl={};t&2&&(kl.$$scope={dirty:t,ctx:e}),Y.$set(kl);const $l={};t&2&&($l.$$scope={dirty:t,ctx:e}),D.$set($l);const x={};t&2&&(x.$$scope={dirty:t,ctx:e}),X.$set(x);const Gl={};t&2&&(Gl.$$scope={dirty:t,ctx:e}),q.$set(Gl);const Al={};t&2&&(Al.$$scope={dirty:t,ctx:e}),P.$set(Al);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),K.$set(S)},i(e){hn||(h(y.$$.fragment,e),h(C.$$.fragment,e),h(A.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(ae.$$.fragment,e),h(Je.$$.fragment,e),h(Y.$$.fragment,e),h(D.$$.fragment,e),h(pe.$$.fragment,e),h(ye.$$.fragment,e),h(we.$$.fragment,e),h(X.$$.fragment,e),h(fe.$$.fragment,e),h(Ce.$$.fragment,e),h($e.$$.fragment,e),h(Ae.$$.fragment,e),h(ve.$$.fragment,e),h(Fe.$$.fragment,e),h(We.$$.fragment,e),h(He.$$.fragment,e),h(De.$$.fragment,e),h(Xe.$$.fragment,e),h(Ke.$$.fragment,e),h(q.$$.fragment,e),h(nl.$$.fragment,e),h(al.$$.fragment,e),h(P.$$.fragment,e),h(ol.$$.fragment,e),h(rl.$$.fragment,e),h(K.$$.fragment,e),h(pl.$$.fragment,e),h(ul.$$.fragment,e),h(ml.$$.fragment,e),h(hl.$$.fragment,e),h(bl.$$.fragment,e),h(jl.$$.fragment,e),hn=!0)},o(e){f(y.$$.fragment,e),f(C.$$.fragment,e),f(A.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(ae.$$.fragment,e),f(Je.$$.fragment,e),f(Y.$$.fragment,e),f(D.$$.fragment,e),f(pe.$$.fragment,e),f(ye.$$.fragment,e),f(we.$$.fragment,e),f(X.$$.fragment,e),f(fe.$$.fragment,e),f(Ce.$$.fragment,e),f($e.$$.fragment,e),f(Ae.$$.fragment,e),f(ve.$$.fragment,e),f(Fe.$$.fragment,e),f(We.$$.fragment,e),f(He.$$.fragment,e),f(De.$$.fragment,e),f(Xe.$$.fragment,e),f(Ke.$$.fragment,e),f(q.$$.fragment,e),f(nl.$$.fragment,e),f(al.$$.fragment,e),f(P.$$.fragment,e),f(ol.$$.fragment,e),f(rl.$$.fragment,e),f(K.$$.fragment,e),f(pl.$$.fragment,e),f(ul.$$.fragment,e),f(ml.$$.fragment,e),f(hl.$$.fragment,e),f(bl.$$.fragment,e),f(jl.$$.fragment,e),hn=!1},d(e){e&&(l(d),l(i),l(p),l(u),l($),l(r),l(V),l(Z),l(I),l(k),l(j),l(Sl),l(ne),l(Ol),l(se),l(Hl),l(Ll),l(oe),l(zl),l(ie),l(Yl),l(Te),l(Dl),l(Xl),l(Me),l(ql),l(Pl),l(Ue),l(Kl),l(re),l(et),l(lt),l(tt),l(de),l(nt),l(ue),l(st),l(at),l(ot),l(ce),l(it),l(me),l(Tt),l(ge),l(Jt),l(he),l(Mt),l(Ut),l(rt),l(be),l(pt),l(Ie),l(dt),l(ut),l(je),l(yt),l(ke),l(wt),l(ct),l(mt),l(Re),l(gt),l(ht),l(Be),l(ft),l(Ve),l(bt),l(Ze),l(It),l(Ne),l(Ct),l(jt),l(Ee),l(kt),l(Qe),l($t),l(At),l(Ge),l(Rt),l(_e),l(vt),l(xe),l(Bt),l(Se),l(Vt),l(Oe),l(Zt),l(Nt),l(Le),l(Ft),l(ze),l(Et),l(Ye),l(Qt),l(Wt),l(Gt),l(qe),l(_t),l(Pe),l(xt),l(St),l(el),l(Ot),l(ll),l(Ht),l(Lt),l(tl),l(zt),l(Yt),l(sl),l(Dt),l(Xt),l(qt),l(Pt),l(il),l(Kt),l(Tl),l(en),l(Jl),l(ln),l(Ml),l(tn),l(Ul),l(nn),l(sn),l(an),l(on),l(dl),l(Tn),l(Jn),l(yl),l(Mn),l(wl),l(Un),l(cl),l(rn),l(pn),l(gl),l(dn),l(un),l(fl),l(yn),l(wn),l(Il),l(cn),l(Cl),l(mn),l(gn),l(_l)),l(s),b(y,e),b(C,e),b(A,e),b(ee),b(te),b(ae,e),b(Je,e),b(Y,e),b(D,e),b(pe,e),b(ye,e),b(we,e),b(X,e),b(fe,e),b(Ce,e),b($e,e),b(Ae,e),b(ve,e),b(Fe,e),b(We,e),b(He,e),b(De,e),b(Xe,e),b(Ke,e),b(q,e),b(nl,e),b(al,e),b(P,e),b(ol,e),b(rl,e),b(K,e),b(pl,e),b(ul,e),b(ml,e),b(hl,e),b(bl,e),b(jl,e)}}}const ya='{"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 wa(R){return zs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ca extends Ys{constructor(s){super(),Ds(this,s,wa,ua,Ls,{})}}export{Ca as component};
