import{s as hl,o as fl,n as Et}from"../chunks/scheduler.f6319a2a.js";import{S as _l,i as bl,g as l,s as o,r as d,A as vl,h as r,f as n,c as s,j as y,u as c,x as _,k as x,y as t,a as i,v as g,d as p,t as u,w as h}from"../chunks/index.85aa684c.js";import{T as ga}from"../chunks/Tip.3d397a88.js";import{D as w,E as zo}from"../chunks/ExampleCodeBlock.3d8cc3b7.js";import{C as V}from"../chunks/CodeBlock.3400fc53.js";import{H as S,E as Ml}from"../chunks/getInferenceSnippets.55a93fbe.js";function $l(j){let m,C="Smolagents एक experimental API है जो किसी भी समय बदल सकता है। एजेंट्स द्वारा लौटाए गए परिणाम भिन्न हो सकते हैं क्योंकि APIs या underlying मॉडल बदलने की संभावना रखते हैं।";return{c(){m=l("p"),m.textContent=C},l(b){m=r(b,"P",{"data-svelte-h":!0}),_(m)!=="svelte-1f42n0i"&&(m.textContent=C)},m(b,v){i(b,m,v)},p:Et,d(b){b&&n(m)}}}function yl(j){let m,C=`Loading a tool from the Hub means that you’ll download the tool and execute it locally.
ALWAYS inspect the tool you’re downloading before loading it within your runtime, as you would do when
installing a package using pip/npm/apt.`;return{c(){m=l("p"),m.textContent=C},l(b){m=r(b,"P",{"data-svelte-h":!0}),_(m)!=="svelte-fpk7e5"&&(m.textContent=C)},m(b,v){i(b,m,v)},p:Et,d(b){b&&n(m)}}}function xl(j){let m,C="Example:",b,v,T;return v=new V({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCklMEFhZ2VudC5ydW4oJTIyV2hhdCUyMGlzJTIwdGhlJTIwcmVzdWx0JTIwb2YlMjAyJTIwcG93ZXIlMjAzLjczODQlM0YlMjIp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent
agent = CodeAgent(tools=[])
agent.run(<span class="hljs-string">&quot;What is the result of 2 power 3.7384?&quot;</span>)`,wrap:!1}}),{c(){m=l("p"),m.textContent=C,b=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),_(m)!=="svelte-11lpom8"&&(m.textContent=C),b=s(f),c(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,b,I),g(v,f,I),T=!0},p:Et,i(f){T||(p(v.$$.fragment,f),T=!0)},o(f){u(v.$$.fragment,f),T=!1},d(f){f&&(n(m),n(b)),h(v,f)}}}function wl(j){let m,C="Example:",b,v,T;return v=new V({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBHcmFkaW9VSSUyQyUyMEluZmVyZW5jZUNsaWVudE1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbChtb2RlbF9pZCUzRCUyMm1ldGEtbGxhbWElMkZNZXRhLUxsYW1hLTMuMS04Qi1JbnN0cnVjdCUyMiklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBZ3JhZGlvX3VpJTIwJTNEJTIwR3JhZGlvVUkoYWdlbnQlMkMlMjBmaWxlX3VwbG9hZF9mb2xkZXIlM0QlMjJ1cGxvYWRzJTIyJTJDJTIwcmVzZXRfYWdlbnRfbWVtb3J5JTNEVHJ1ZSklMEFncmFkaW9fdWkubGF1bmNoKCk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, GradioUI, InferenceClientModel

model = InferenceClientModel(model_id=<span class="hljs-string">&quot;meta-llama/Meta-Llama-3.1-8B-Instruct&quot;</span>)
agent = CodeAgent(tools=[], model=model)
gradio_ui = GradioUI(agent, file_upload_folder=<span class="hljs-string">&quot;uploads&quot;</span>, reset_agent_memory=<span class="hljs-literal">True</span>)
gradio_ui.launch()`,wrap:!1}}),{c(){m=l("p"),m.textContent=C,b=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),_(m)!=="svelte-11lpom8"&&(m.textContent=C),b=s(f),c(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,b,I),g(v,f,I),T=!0},p:Et,i(f){T||(p(v.$$.fragment,f),T=!0)},o(f){u(v.$$.fragment,f),T=!1},d(f){f&&(n(m),n(b)),h(v,f)}}}function Tl(j){let m,C="You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install &#39;smolagents[transformers]&#39;</code> if it’s not the case.";return{c(){m=l("p"),m.innerHTML=C},l(b){m=r(b,"P",{"data-svelte-h":!0}),_(m)!=="svelte-2avciv"&&(m.innerHTML=C)},m(b,v){i(b,m,v)},p:Et,d(b){b&&n(m)}}}function Cl(j){let m,C="Example:",b,v,T;return v=new V({props:{code:"ZW5naW5lJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2UlM0QlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0Q1MDAwJTJDJTBBKSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyRXhwbGFpbiUyMHF1YW50dW0lMjBtZWNoYW5pY3MlMjBpbiUyMHNpbXBsZSUyMHRlcm1zLiUyMiU3RCU1RCUwQXJlc3BvbnNlJTIwJTNEJTIwZW5naW5lKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJFTkQlMjIlNUQpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = TransformersModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    device=<span class="hljs-string">&quot;cuda&quot;</span>,
<span class="hljs-meta">... </span>    max_new_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){m=l("p"),m.textContent=C,b=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),_(m)!=="svelte-11lpom8"&&(m.textContent=C),b=s(f),c(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,b,I),g(v,f,I),T=!0},p:Et,i(f){T||(p(v.$$.fragment,f),T=!0)},o(f){u(v.$$.fragment,f),T=!1},d(f){f&&(n(m),n(b)),h(v,f)}}}function Il(j){let m,C="Example:",b,v,T;return v=new V({props:{code:"ZW5naW5lJTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBwcm92aWRlciUzRCUyMm5lYml1cyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRva2VuJTNEJTIyeW91cl9oZl90b2tlbl9oZXJlJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDUwMDAlMkMlMEEpJTBBbWVzc2FnZXMlMjAlM0QlMjAlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJFeHBsYWluJTIwcXVhbnR1bSUyMG1lY2hhbmljcyUyMGluJTIwc2ltcGxlJTIwdGVybXMuJTIyJTdEJTVEJTBBcmVzcG9uc2UlMjAlM0QlMjBlbmdpbmUobWVzc2FnZXMlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMkVORCUyMiU1RCklMEFwcmludChyZXNwb25zZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = InferenceClientModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    provider=<span class="hljs-string">&quot;nebius&quot;</span>,
<span class="hljs-meta">... </span>    token=<span class="hljs-string">&quot;your_hf_token_here&quot;</span>,
<span class="hljs-meta">... </span>    max_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){m=l("p"),m.textContent=C,b=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),_(m)!=="svelte-11lpom8"&&(m.textContent=C),b=s(f),c(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,b,I),g(v,f,I),T=!0},p:Et,i(f){T||(p(v.$$.fragment,f),T=!0)},o(f){u(v.$$.fragment,f),T=!1},d(f){f&&(n(m),n(b)),h(v,f)}}}function kl(j){let m,C,b,v,T,f,I,Sn,xe,pa=`Agents और tools के बारे में अधिक जानने के लिए <a href="../index">introductory guide</a> पढ़ना सुनिश्चित करें।
यह पेज underlying क्लासेज के लिए API docs को शामिल करता है।`,Vn,we,Wn,Te,ua='हमारे एजेंट्स <a href="/docs/smolagents/main/hi/reference/agents#smolagents.MultiStepAgent">MultiStepAgent</a> से इनहेरिट करते हैं, जिसका अर्थ है कि वे कई चरणों में कार्य कर सकते हैं, प्रत्येक चरण में एक विचार, फिर एक टूल कॉल और एक्जीक्यूशन शामिल होता है। <a href="../conceptual_guides/react">इस कॉन्सेप्चुअल गाइड</a> में अधिक पढ़ें।',Zn,Ce,ha="हम मुख्य <code>Agent</code> क्लास पर आधारित दो प्रकार के एजेंट्स प्रदान करते हैं।",En,Ie,fa='<li><a href="/docs/smolagents/main/hi/reference/agents#smolagents.CodeAgent">CodeAgent</a> डिफ़ॉल्ट एजेंट है, यह अपने टूल कॉल्स को Python कोड में लिखता है।</li> <li><a href="/docs/smolagents/main/hi/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> अपने टूल कॉल्स को JSON में लिखता है।</li>',Bn,ke,_a="दोनों को इनिशियलाइजेशन पर <code>model</code> और टूल्स की सूची <code>tools</code> आर्गुमेंट्स की आवश्यकता होती है।",Dn,Je,Gn,M,je,Ro,Bt,ba=`Agent class that solves the given task step by step, using the ReAct framework:
While the objective is not reached, the agent will perform a cycle of action (given by the LLM) and observation (obtained from the environment).`,Xo,Y,Ue,Yo,Dt,va="Parse action from the LLM output",Oo,O,Ae,Ko,Gt,Ma="Create agent from a dictionary representation.",es,K,Ne,ts,Qt,$a="Loads an agent from a local folder.",ns,W,Le,os,Ht,ya="Loads an agent defined on the Hub.",ss,ee,as,te,qe,ls,Ft,xa="To be implemented in child classes",rs,ne,Pe,is,zt,wa="Interrupts the agent execution.",ms,oe,Se,ds,Rt,Ta="Provide the final answer to the task, based on the logs of the agent’s interactions.",cs,se,Ve,gs,Xt,Ca="Upload the agent to the Hub.",ps,ae,We,us,Yt,Ia="Prints a pretty replay of the agent’s steps.",hs,Z,Ze,fs,Ot,ka="Run the agent for the given task.",_s,le,bs,E,Ee,vs,Kt,Ja="Saves the relevant code files for your agent. This will copy the code of your agent in <code>output_dir</code> as well as autogenerate:",Ms,en,ja=`<li>a <code>tools</code> folder containing the logic for each of the tools under <code>tools/{tool_name}.py</code>.</li> <li>a <code>managed_agents</code> folder containing the logic for each of the managed agents.</li> <li>an <code>agent.json</code> file containing a dictionary representing your agent.</li> <li>a <code>prompt.yaml</code> file containing the prompt templates used by your agent.</li> <li>an <code>app.py</code> file providing a UI for your agent when it is exported to a Space with <code>agent.push_to_hub()</code></li> <li>a <code>requirements.txt</code> containing the names of the modules used by your tool (as detected when inspecting its
code)</li>`,$s,re,Be,ys,tn,Ua=`Perform one step in the ReAct framework: the agent thinks, acts, and observes the result.
Returns either None if the step is not final, or the final answer.`,xs,ie,De,ws,nn,Aa="Convert the agent to a dictionary representation.",Ts,me,Ge,Cs,on,Na="Creates a rich tree visualization of the agent’s structure.",Is,de,Qe,ks,sn,La=`Reads past llm_outputs, actions, and observations or errors from the memory into a series of messages
that can be used as input to the LLM. Adds a number of keywords (such as PLAN, error, etc) to help
the LLM.`,Qn,A,He,Js,an,qa="In this agent, the tool calls will be formulated by the LLM in code format, then parsed and executed.",js,ce,Fe,Us,ln,Pa="Clean up resources used by the agent, such as the remote Python executor.",As,ge,ze,Ns,rn,Sa="Create CodeAgent from a dictionary representation.",Hn,N,Re,Ls,mn,Va="This agent uses JSON-like tool calls, using method <code>model.get_tool_call</code> to leverage the LLM engine’s tool calling capabilities.",qs,B,Xe,Ps,dn,Wa="Execute a tool or managed agent with the provided arguments.",Ss,cn,Za="The arguments are replaced with the actual values from the state if they refer to state variables.",Vs,pe,Ye,Ws,gn,Ea="Process tool calls from the model output and update agent memory.",Fn,Oe,zn,Q,Ke,Zs,pn,Ba="Runs an agent with the given task and streams the messages from the agent as gradio ChatMessages.",Rn,et,Xn,k,tt,Es,un,Da='Gradio interface for interacting with a <a href="/docs/smolagents/main/hi/reference/agents#smolagents.MultiStepAgent">MultiStepAgent</a>.',Bs,hn,Ga=`This class provides a web interface to interact with the agent in real-time, allowing users to submit prompts, upload files, and receive responses in a chat-like format.
It  can reset the agent’s memory at the start of each interaction if desired.
It supports file uploads, which are saved to a specified folder.
It uses the <code>gradio.Chatbot</code> component to display the conversation history.
This class requires the <code>gradio</code> extra to be installed: <code>pip install &#39;smolagents[gradio]&#39;</code>.`,Ds,ue,Gs,he,nt,Qs,fn,Qa="Launch the Gradio app with the agent interface.",Hs,D,ot,Fs,_n,Ha="Upload a file and add it to the list of uploaded files in the session state.",zs,bn,Fa=`The file is saved to the <code>self.file_upload_folder</code> folder.
If the file type is not allowed, it returns a message indicating the disallowed file type.`,Yn,st,On,at,za="आप स्वतंत्र रूप से अपने स्वयं के मॉडल बना सकते हैं और उनका उपयोग कर सकते हैं।",Kn,lt,Ra="आप अपने एजेंट के लिए कोई भी <code>model</code> कॉल करने योग्य उपयोग कर सकते हैं, जब तक कि:",eo,rt,Xa='<li>यह अपने इनपुट <code>messages</code> के लिए <a href="./chat_templating">messages format</a> (<code>List[Dict[str, str]]</code>) का पालन करता है, और यह एक <code>str</code> लौटाता है।</li> <li>यह आर्गुमेंट <code>stop_sequences</code> में पास किए गए सीक्वेंस से <em>पहले</em> आउटपुट जनरेट करना बंद कर देता है।</li>',to,it,Ya='अपने LLM को परिभाषित करने के लिए, आप एक <code>custom_model</code> मेथड बना सकते हैं जो <a href="./chat_templating">messages</a> की एक सूची स्वीकार करता है और टेक्स्ट युक्त .content विशेषता वाला एक ऑब्जेक्ट लौटाता है। इस कॉलेबल को एक <code>stop_sequences</code> आर्गुमेंट भी स्वीकार करने की आवश्यकता होती है जो बताता है कि कब जनरेट करना और बंद करना है।',no,mt,oo,dt,Oa='इसके अतिरिक्त, <code>custom_model</code> एक <code>grammar</code> आर्गुमेंट भी ले सकता है। जिस स्थिति में आप एजेंट इनिशियलाइजेशन पर एक <code>grammar</code> निर्दिष्ट करते हैं, यह आर्गुमेंट मॉडल के कॉल्स को आपके द्वारा इनिशियलाइजेशन पर परिभाषित <code>grammar</code> के साथ पास किया जाएगा, ताकि <a href="https://huggingface.co/docs/text-generation-inference/conceptual/guidance" rel="nofollow">constrained generation</a> की अनुमति मिल सके जिससे उचित-फॉर्मेटेड एजेंट आउटपुट को फोर्स किया जा सके।',so,ct,ao,gt,Ka="सुविधा के लिए, हमने एक <code>TransformersModel</code> जोड़ा है जो इनिशियलाइजेशन पर दिए गए model_id के लिए एक लोकल <code>transformers</code> पाइपलाइन बनाकर ऊपर के बिंदुओं को लागू करता है।",lo,pt,ro,ut,io,U,ht,Rs,vn,el="A class that uses Hugging Face’s Transformers library for language model interaction.",Xs,Mn,tl="This model allows you to load and use Hugging Face’s models locally using the Transformers library. It supports features like stop sequences and grammar customization.",Ys,fe,Os,_e,mo,ft,co,_t,nl='<code>InferenceClientModel</code> LLM के एक्जीक्यूशन के लिए <a href="https://huggingface.co/docs/api-inference/index" rel="nofollow">HF Inference API</a> क्लाइंट को रैप करता है।',go,bt,po,vt,uo,J,Mt,Ks,$n,ol="A class to interact with Hugging Face’s Inference Providers for language model interaction.",ea,yn,sl="This model allows you to communicate with Hugging Face’s models using Inference Providers. It can be used in both serverless mode, with a dedicated endpoint, or even with a local URL, supporting features like stop sequences and grammar customization.",ta,xn,al="Providers include Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.",na,be,oa,ve,$t,sa,wn,ll="Create the Hugging Face client.",ho,yt,fo,xt,rl=`<code>LiteLLMModel</code> विभिन्न प्रदाताओं से 100+ LLMs को सपोर्ट करने के लिए <a href="https://www.litellm.ai/" rel="nofollow">LiteLLM</a> का लाभ उठाता है।
आप मॉडल इनिशियलाइजेशन पर kwargs पास कर सकते हैं जो तब मॉडल का उपयोग करते समय प्रयोग किए जाएंगे, उदाहरण के लिए नीचे हम <code>temperature</code> पास करते हैं।`,_o,wt,bo,P,Tt,aa,Tn,il='Model to use <a href="https://docs.litellm.ai/docs/#litellm-python-sdk" rel="nofollow">LiteLLM Python SDK</a> to access hundreds of LLMs.',la,Me,Ct,ra,Cn,ml="Create the LiteLLM client.",vo,It,Mo,kt,dl=`यह क्लास आपको किसी भी OpenAIServer कम्पैटिबल मॉडल को कॉल करने देती है।
यहाँ बताया गया है कि आप इसे कैसे सेट कर सकते हैं (आप दूसरे सर्वर को पॉइंट करने के लिए <code>api_base</code> url को कस्टमाइज़ कर सकते हैं):`,$o,Jt,yo,jt,xo,H,Ut,ia,In,cl="Prompt templates for the agent.",wo,F,At,ma,kn,gl="Prompt templates for the planning step.",To,z,Nt,da,Jn,pl="Prompt templates for the managed agent.",Co,R,Lt,ca,jn,ul="Prompt templates for the final answer.",Io,qt,ko,Pn,Jo;return T=new S({props:{title:"Agents",local:"agents",headingTag:"h1"}}),I=new ga({props:{warning:!0,$$slots:{default:[$l]},$$scope:{ctx:j}}}),we=new S({props:{title:"Agents",local:"agents",headingTag:"h2"}}),Je=new S({props:{title:"Agents की क्लासेज",local:"smolagents.MultiStepAgent",headingTag:"h3"}}),je=new w({props:{name:"class smolagents.MultiStepAgent",anchor:"smolagents.MultiStepAgent",parameters:[{name:"tools",val:": list"},{name:"model",val:": Model"},{name:"prompt_templates",val:": smolagents.agents.PromptTemplates | None = None"},{name:"instructions",val:": str | None = None"},{name:"max_steps",val:": int = 20"},{name:"add_base_tools",val:": bool = False"},{name:"verbosity_level",val:": LogLevel = <LogLevel.INFO: 1>"},{name:"managed_agents",val:": list | None = None"},{name:"step_callbacks",val:": list[collections.abc.Callable] | dict[typing.Type[smolagents.memory.MemoryStep], collections.abc.Callable | list[collections.abc.Callable]] | None = None"},{name:"planning_interval",val:": int | None = None"},{name:"name",val:": str | None = None"},{name:"description",val:": str | None = None"},{name:"provide_run_summary",val:": bool = False"},{name:"final_answer_checks",val:": list[collections.abc.Callable] | None = None"},{name:"return_full_result",val:": bool = False"},{name:"logger",val:": smolagents.monitoring.AgentLogger | None = None"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.tools",description:'<strong>tools</strong> (<code>list[Tool]</code>) &#x2014; <a href="/docs/smolagents/main/hi/reference/tools#smolagents.Tool">Tool</a>s that the agent can use.',name:"tools"},{anchor:"smolagents.MultiStepAgent.model",description:"<strong>model</strong> (<code>Callable[[list[dict[str, str]]], ChatMessage]</code>) &#x2014; Model that will generate the agent&#x2019;s actions.",name:"model"},{anchor:"smolagents.MultiStepAgent.prompt_templates",description:'<strong>prompt_templates</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.PromptTemplates">PromptTemplates</a>, <em>optional</em>) &#x2014; Prompt templates.',name:"prompt_templates"},{anchor:"smolagents.MultiStepAgent.instructions",description:"<strong>instructions</strong> (<code>str</code>, <em>optional</em>) &#x2014; Custom instructions for the agent, will be inserted in the system prompt.",name:"instructions"},{anchor:"smolagents.MultiStepAgent.max_steps",description:"<strong>max_steps</strong> (<code>int</code>, default <code>20</code>) &#x2014; Maximum number of steps the agent can take to solve the task.",name:"max_steps"},{anchor:"smolagents.MultiStepAgent.add_base_tools",description:"<strong>add_base_tools</strong> (<code>bool</code>, default <code>False</code>) &#x2014; Whether to add the base tools to the agent&#x2019;s tools.",name:"add_base_tools"},{anchor:"smolagents.MultiStepAgent.verbosity_level",description:"<strong>verbosity_level</strong> (<code>LogLevel</code>, default <code>LogLevel.INFO</code>) &#x2014; Level of verbosity of the agent&#x2019;s logs.",name:"verbosity_level"},{anchor:"smolagents.MultiStepAgent.managed_agents",description:"<strong>managed_agents</strong> (<code>list</code>, <em>optional</em>) &#x2014; Managed agents that the agent can call.",name:"managed_agents"},{anchor:"smolagents.MultiStepAgent.step_callbacks",description:"<strong>step_callbacks</strong> (<code>list[Callable]</code> | <code>dict[Type[MemoryStep], Callable | list[Callable]]</code>, <em>optional</em>) &#x2014; Callbacks that will be called at each step.",name:"step_callbacks"},{anchor:"smolagents.MultiStepAgent.planning_interval",description:"<strong>planning_interval</strong> (<code>int</code>, <em>optional</em>) &#x2014; Interval at which the agent will run a planning step.",name:"planning_interval"},{anchor:"smolagents.MultiStepAgent.name",description:"<strong>name</strong> (<code>str</code>, <em>optional</em>) &#x2014; Necessary for a managed agent only - the name by which this agent can be called.",name:"name"},{anchor:"smolagents.MultiStepAgent.description",description:"<strong>description</strong> (<code>str</code>, <em>optional</em>) &#x2014; Necessary for a managed agent only - the description of this agent.",name:"description"},{anchor:"smolagents.MultiStepAgent.provide_run_summary",description:"<strong>provide_run_summary</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to provide a run summary when called as a managed agent.",name:"provide_run_summary"},{anchor:"smolagents.MultiStepAgent.final_answer_checks",description:`<strong>final_answer_checks</strong> (<code>list[Callable]</code>, <em>optional</em>) &#x2014; List of validation functions to run before accepting a final answer.
Each function should:<ul>
<li>Take the final answer and the agent&#x2019;s memory as arguments.</li>
<li>Return a boolean indicating whether the final answer is valid.</li>
</ul>`,name:"final_answer_checks"},{anchor:"smolagents.MultiStepAgent.return_full_result",description:"<strong>return_full_result</strong> (<code>bool</code>, default <code>False</code>) &#x2014; Whether to return the full <code>RunResult</code> object or just the final answer output from the agent run.",name:"return_full_result"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L272"}}),Ue=new w({props:{name:"extract_action",anchor:"smolagents.MultiStepAgent.extract_action",parameters:[{name:"model_output",val:": str"},{name:"split_token",val:": str"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.extract_action.model_output",description:"<strong>model_output</strong> (<code>str</code>) &#x2014; Output of the LLM",name:"model_output"},{anchor:"smolagents.MultiStepAgent.extract_action.split_token",description:"<strong>split_token</strong> (<code>str</code>) &#x2014; Separator for the action. Should match the example in the system prompt.",name:"split_token"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L789"}}),Ae=new w({props:{name:"from_dict",anchor:"smolagents.MultiStepAgent.from_dict",parameters:[{name:"agent_dict",val:": dict"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.from_dict.agent_dict",description:"<strong>agent_dict</strong> (<code>dict[str, Any]</code>) &#x2014; Dictionary representation of the agent.",name:"agent_dict"},{anchor:"smolagents.MultiStepAgent.from_dict.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments that will override agent_dict values.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1010",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Instance of the agent class.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>MultiStepAgent</code></p>
`}}),Ne=new w({props:{name:"from_folder",anchor:"smolagents.MultiStepAgent.from_folder",parameters:[{name:"folder",val:": str | pathlib.Path"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.from_folder.folder",description:"<strong>folder</strong> (<code>str</code> or <code>Path</code>) &#x2014; The folder where the agent is saved.",name:"folder"},{anchor:"smolagents.MultiStepAgent.from_folder.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments that will be passed to the agent&#x2019;s init.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1108"}}),Le=new w({props:{name:"from_hub",anchor:"smolagents.MultiStepAgent.from_hub",parameters:[{name:"repo_id",val:": str"},{name:"token",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.from_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repo on the Hub where your tool is defined.`,name:"repo_id"},{anchor:"smolagents.MultiStepAgent.from_hub.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The token to identify you on hf.co. If unset, will use the token generated when running
<code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"smolagents.MultiStepAgent.from_hub.trust_remote_code(bool,",description:`<strong>trust_remote_code(<code>bool</code>,</strong> <em>optional</em>, defaults to False) &#x2014;
This flags marks that you understand the risk of running remote code and that you trust this tool.
If not setting this to True, loading the tool from Hub will fail.`,name:"trust_remote_code(bool,"},{anchor:"smolagents.MultiStepAgent.from_hub.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Additional keyword arguments that will be split in two: all arguments relevant to the Hub (such as
<code>cache_dir</code>, <code>revision</code>, <code>subfolder</code>) will be used when downloading the files for your agent, and the
others will be passed along to its init.`,name:"kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1054"}}),ee=new ga({props:{warning:!0,$$slots:{default:[yl]},$$scope:{ctx:j}}}),qe=new w({props:{name:"initialize_system_prompt",anchor:"smolagents.MultiStepAgent.initialize_system_prompt",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L749"}}),Pe=new w({props:{name:"interrupt",anchor:"smolagents.MultiStepAgent.interrupt",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L754"}}),Se=new w({props:{name:"provide_final_answer",anchor:"smolagents.MultiStepAgent.provide_final_answer",parameters:[{name:"task",val:": str"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.provide_final_answer.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; Task to perform.",name:"task"},{anchor:"smolagents.MultiStepAgent.provide_final_answer.images",description:"<strong>images</strong> (<code>list[PIL.Image.Image]</code>, <em>optional</em>) &#x2014; Image(s) objects.",name:"images"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L810",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Final answer to the task.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>str</code></p>
`}}),Ve=new w({props:{name:"push_to_hub",anchor:"smolagents.MultiStepAgent.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"commit_message",val:": str = 'Upload agent'"},{name:"private",val:": bool | None = None"},{name:"token",val:": bool | str | None = None"},{name:"create_pr",val:": bool = False"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push to. It should contain your organization name when
pushing to a given organization.`,name:"repo_id"},{anchor:"smolagents.MultiStepAgent.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;Upload agent&quot;</code>) &#x2014;
Message to commit while pushing.`,name:"commit_message"},{anchor:"smolagents.MultiStepAgent.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014;
Whether to make the repo private. If <code>None</code>, the repo will be public unless the organization&#x2019;s default is private. This value is ignored if the repo already exists.`,name:"private"},{anchor:"smolagents.MultiStepAgent.push_to_hub.token",description:`<strong>token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If unset, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>).`,name:"token"},{anchor:"smolagents.MultiStepAgent.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1140"}}),We=new w({props:{name:"replay",anchor:"smolagents.MultiStepAgent.replay",parameters:[{name:"detailed",val:": bool = False"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.replay.detailed",description:`<strong>detailed</strong> (bool, optional) &#x2014; If True, also displays the memory at each step. Defaults to False.
Careful: will increase log length exponentially. Use only for debugging.`,name:"detailed"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L859"}}),Ze=new w({props:{name:"run",anchor:"smolagents.MultiStepAgent.run",parameters:[{name:"task",val:": str"},{name:"stream",val:": bool = False"},{name:"reset",val:": bool = True"},{name:"images",val:": list['PIL.Image.Image'] | None = None"},{name:"additional_args",val:": dict | None = None"},{name:"max_steps",val:": int | None = None"},{name:"return_full_result",val:": bool | None = None"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.run.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; Task to perform.",name:"task"},{anchor:"smolagents.MultiStepAgent.run.stream",description:`<strong>stream</strong> (<code>bool</code>) &#x2014; Whether to run in streaming mode.
If <code>True</code>, returns a generator that yields each step as it is executed. You must iterate over this generator to process the individual steps (e.g., using a for loop or <code>next()</code>).
If <code>False</code>, executes all steps internally and returns only the final answer after completion.`,name:"stream"},{anchor:"smolagents.MultiStepAgent.run.reset",description:"<strong>reset</strong> (<code>bool</code>) &#x2014; Whether to reset the conversation or keep it going from previous run.",name:"reset"},{anchor:"smolagents.MultiStepAgent.run.images",description:"<strong>images</strong> (<code>list[PIL.Image.Image]</code>, <em>optional</em>) &#x2014; Image(s) objects.",name:"images"},{anchor:"smolagents.MultiStepAgent.run.additional_args",description:"<strong>additional_args</strong> (<code>dict</code>, <em>optional</em>) &#x2014; Any other variables that you want to pass to the agent run, for instance images or dataframes. Give them clear names!",name:"additional_args"},{anchor:"smolagents.MultiStepAgent.run.max_steps",description:"<strong>max_steps</strong> (<code>int</code>, <em>optional</em>) &#x2014; Maximum number of steps the agent can take to solve the task. if not provided, will use the agent&#x2019;s default value.",name:"max_steps"},{anchor:"smolagents.MultiStepAgent.run.return_full_result",description:`<strong>return_full_result</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to return the full <code>RunResult</code> object or just the final answer output.
If <code>None</code> (default), the agent&#x2019;s <code>self.return_full_result</code> setting is used.`,name:"return_full_result"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L439"}}),le=new zo({props:{anchor:"smolagents.MultiStepAgent.run.example",$$slots:{default:[xl]},$$scope:{ctx:j}}}),Ee=new w({props:{name:"save",anchor:"smolagents.MultiStepAgent.save",parameters:[{name:"output_dir",val:": str | pathlib.Path"},{name:"relative_path",val:": str | None = None"}],parametersDescription:[{anchor:"smolagents.MultiStepAgent.save.output_dir",description:"<strong>output_dir</strong> (<code>str</code> or <code>Path</code>) &#x2014; The folder in which you want to save your agent.",name:"output_dir"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L892"}}),Be=new w({props:{name:"step",anchor:"smolagents.MultiStepAgent.step",parameters:[{name:"memory_step",val:": ActionStep"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L782"}}),De=new w({props:{name:"to_dict",anchor:"smolagents.MultiStepAgent.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L970",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Dictionary representation of the agent.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>dict</code></p>
`}}),Ge=new w({props:{name:"visualize",anchor:"smolagents.MultiStepAgent.visualize",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L855"}}),Qe=new w({props:{name:"write_memory_to_messages",anchor:"smolagents.MultiStepAgent.write_memory_to_messages",parameters:[{name:"summary_mode",val:": bool = False"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L758"}}),He=new w({props:{name:"class smolagents.CodeAgent",anchor:"smolagents.CodeAgent",parameters:[{name:"tools",val:": list"},{name:"model",val:": Model"},{name:"prompt_templates",val:": smolagents.agents.PromptTemplates | None = None"},{name:"additional_authorized_imports",val:": list[str] | None = None"},{name:"planning_interval",val:": int | None = None"},{name:"executor_type",val:": typing.Literal['local', 'e2b', 'modal', 'docker', 'wasm'] = 'local'"},{name:"executor_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"max_print_outputs_length",val:": int | None = None"},{name:"stream_outputs",val:": bool = False"},{name:"use_structured_outputs_internally",val:": bool = False"},{name:"code_block_tags",val:": str | tuple[str, str] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.CodeAgent.tools",description:'<strong>tools</strong> (<code>list[Tool]</code>) &#x2014; <a href="/docs/smolagents/main/hi/reference/tools#smolagents.Tool">Tool</a>s that the agent can use.',name:"tools"},{anchor:"smolagents.CodeAgent.model",description:"<strong>model</strong> (<code>Model</code>) &#x2014; Model that will generate the agent&#x2019;s actions.",name:"model"},{anchor:"smolagents.CodeAgent.prompt_templates",description:'<strong>prompt_templates</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.PromptTemplates">PromptTemplates</a>, <em>optional</em>) &#x2014; Prompt templates.',name:"prompt_templates"},{anchor:"smolagents.CodeAgent.additional_authorized_imports",description:"<strong>additional_authorized_imports</strong> (<code>list[str]</code>, <em>optional</em>) &#x2014; Additional authorized imports for the agent.",name:"additional_authorized_imports"},{anchor:"smolagents.CodeAgent.planning_interval",description:"<strong>planning_interval</strong> (<code>int</code>, <em>optional</em>) &#x2014; Interval at which the agent will run a planning step.",name:"planning_interval"},{anchor:"smolagents.CodeAgent.executor_type",description:"<strong>executor_type</strong> (<code>Literal[&quot;local&quot;, &quot;e2b&quot;, &quot;modal&quot;, &quot;docker&quot;, &quot;wasm&quot;]</code>, default <code>&quot;local&quot;</code>) &#x2014; Type of code executor.",name:"executor_type"},{anchor:"smolagents.CodeAgent.executor_kwargs",description:"<strong>executor_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014; Additional arguments to pass to initialize the executor.",name:"executor_kwargs"},{anchor:"smolagents.CodeAgent.max_print_outputs_length",description:"<strong>max_print_outputs_length</strong> (<code>int</code>, <em>optional</em>) &#x2014; Maximum length of the print outputs.",name:"max_print_outputs_length"},{anchor:"smolagents.CodeAgent.stream_outputs",description:"<strong>stream_outputs</strong> (<code>bool</code>, <em>optional</em>, default <code>False</code>) &#x2014; Whether to stream outputs during execution.",name:"stream_outputs"},{anchor:"smolagents.CodeAgent.use_structured_outputs_internally",description:`<strong>use_structured_outputs_internally</strong> (<code>bool</code>, default <code>False</code>) &#x2014; Whether to use structured generation at each action step: improves performance for many models.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						<p class="font-medium">Added in 1.17.0</p>
						
					</div>`,name:"use_structured_outputs_internally"},{anchor:"smolagents.CodeAgent.code_block_tags",description:"<strong>code_block_tags</strong> (<code>tuple[str, str]</code> | <code>Literal[&quot;markdown&quot;]</code>, <em>optional</em>) &#x2014; Opening and closing tags for code blocks (regex strings). Pass a custom tuple, or pass &#x2018;markdown&#x2019; to use (&#x201D;<code>(?:python|py)&quot;, &quot;\\n</code>&#x201D;), leave empty to use (&#x201D;<code>&#x201D;, &#x201D;</code>&#x201D;).",name:"code_block_tags"},{anchor:"smolagents.CodeAgent.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1489"}}),Fe=new w({props:{name:"cleanup",anchor:"smolagents.CodeAgent.cleanup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1577"}}),ze=new w({props:{name:"from_dict",anchor:"smolagents.CodeAgent.from_dict",parameters:[{name:"agent_dict",val:": dict"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.CodeAgent.from_dict.agent_dict",description:"<strong>agent_dict</strong> (<code>dict[str, Any]</code>) &#x2014; Dictionary representation of the agent.",name:"agent_dict"},{anchor:"smolagents.CodeAgent.from_dict.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments that will override agent_dict values.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1760",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>Instance of the CodeAgent class.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>CodeAgent</code></p>
`}}),Re=new w({props:{name:"class smolagents.ToolCallingAgent",anchor:"smolagents.ToolCallingAgent",parameters:[{name:"tools",val:": list"},{name:"model",val:": Model"},{name:"prompt_templates",val:": smolagents.agents.PromptTemplates | None = None"},{name:"planning_interval",val:": int | None = None"},{name:"stream_outputs",val:": bool = False"},{name:"max_tool_threads",val:": int | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.ToolCallingAgent.tools",description:'<strong>tools</strong> (<code>list[Tool]</code>) &#x2014; <a href="/docs/smolagents/main/hi/reference/tools#smolagents.Tool">Tool</a>s that the agent can use.',name:"tools"},{anchor:"smolagents.ToolCallingAgent.model",description:"<strong>model</strong> (<code>Model</code>) &#x2014; Model that will generate the agent&#x2019;s actions.",name:"model"},{anchor:"smolagents.ToolCallingAgent.prompt_templates",description:'<strong>prompt_templates</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.PromptTemplates">PromptTemplates</a>, <em>optional</em>) &#x2014; Prompt templates.',name:"prompt_templates"},{anchor:"smolagents.ToolCallingAgent.planning_interval",description:"<strong>planning_interval</strong> (<code>int</code>, <em>optional</em>) &#x2014; Interval at which the agent will run a planning step.",name:"planning_interval"},{anchor:"smolagents.ToolCallingAgent.stream_outputs",description:"<strong>stream_outputs</strong> (<code>bool</code>, <em>optional</em>, default <code>False</code>) &#x2014; Whether to stream outputs during execution.",name:"stream_outputs"},{anchor:"smolagents.ToolCallingAgent.max_tool_threads",description:`<strong>max_tool_threads</strong> (<code>int</code>, <em>optional</em>) &#x2014; Maximum number of threads for parallel tool calls.
Higher values increase concurrency but resource usage as well.
Defaults to <code>ThreadPoolExecutor</code>&#x2019;s default.`,name:"max_tool_threads"},{anchor:"smolagents.ToolCallingAgent.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1195"}}),Xe=new w({props:{name:"execute_tool_call",anchor:"smolagents.ToolCallingAgent.execute_tool_call",parameters:[{name:"tool_name",val:": str"},{name:"arguments",val:": dict[str, str] | str"}],parametersDescription:[{anchor:"smolagents.ToolCallingAgent.execute_tool_call.tool_name",description:"<strong>tool_name</strong> (<code>str</code>) &#x2014; Name of the tool or managed agent to execute.",name:"tool_name"},{anchor:"smolagents.ToolCallingAgent.execute_tool_call.arguments",description:"<strong>arguments</strong> (dict[str, str] | str) &#x2014; Arguments passed to the tool call.",name:"arguments"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1437"}}),Ye=new w({props:{name:"process_tool_calls",anchor:"smolagents.ToolCallingAgent.process_tool_calls",parameters:[{name:"chat_message",val:": ChatMessage"},{name:"memory_step",val:": ActionStep"}],parametersDescription:[{anchor:"smolagents.ToolCallingAgent.process_tool_calls.chat_message",description:"<strong>chat_message</strong> (<code>ChatMessage</code>) &#x2014; Chat message containing tool calls from the model.",name:"chat_message"},{anchor:"smolagents.ToolCallingAgent.process_tool_calls.memory_step",description:"<strong>memory_step</strong> (<code>ActionStep)</code> &#x2014; Memory ActionStep to update with results.",name:"memory_step"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L1346",returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ToolCall | ToolOutput</code></p>
`,isYield:!0}}),Oe=new S({props:{title:"stream_to_gradio",local:"smolagents.stream_to_gradio",headingTag:"h3"}}),Ke=new w({props:{name:"smolagents.stream_to_gradio",anchor:"smolagents.stream_to_gradio",parameters:[{name:"agent",val:""},{name:"task",val:": str"},{name:"task_images",val:": list | None = None"},{name:"reset_agent_memory",val:": bool = False"},{name:"additional_args",val:": dict | None = None"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/gradio_ui.py#L248"}}),et=new S({props:{title:"GradioUI",local:"smolagents.GradioUI",headingTag:"h3"}}),tt=new w({props:{name:"class smolagents.GradioUI",anchor:"smolagents.GradioUI",parameters:[{name:"agent",val:": MultiStepAgent"},{name:"file_upload_folder",val:": str | None = None"},{name:"reset_agent_memory",val:": bool = False"}],parametersDescription:[{anchor:"smolagents.GradioUI.agent",description:'<strong>agent</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.MultiStepAgent">MultiStepAgent</a>) &#x2014; The agent to interact with.',name:"agent"},{anchor:"smolagents.GradioUI.file_upload_folder",description:`<strong>file_upload_folder</strong> (<code>str</code>, <em>optional</em>) &#x2014; The folder where uploaded files will be saved.
If not provided, file uploads are disabled.`,name:"file_upload_folder"},{anchor:"smolagents.GradioUI.reset_agent_memory",description:`<strong>reset_agent_memory</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014; Whether to reset the agent&#x2019;s memory at the start of each interaction.
If <code>True</code>, the agent will not remember previous interactions.`,name:"reset_agent_memory"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/gradio_ui.py#L279",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ModuleNotFoundError</code> — If the <code>gradio</code> extra is not installed.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ModuleNotFoundError</code></p>
`}}),ue=new zo({props:{anchor:"smolagents.GradioUI.example",$$slots:{default:[wl]},$$scope:{ctx:j}}}),nt=new w({props:{name:"launch",anchor:"smolagents.GradioUI.launch",parameters:[{name:"share",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.GradioUI.launch.share",description:"<strong>share</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014; Whether to share the app publicly.",name:"share"},{anchor:"smolagents.GradioUI.launch.*kwargs",description:"*<strong>*kwargs</strong> &#x2014; Additional keyword arguments to pass to the Gradio launch method.",name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/gradio_ui.py#L406"}}),ot=new w({props:{name:"upload_file",anchor:"smolagents.GradioUI.upload_file",parameters:[{name:"file",val:""},{name:"file_uploads_log",val:""},{name:"allowed_file_types",val:" = None"}],parametersDescription:[{anchor:"smolagents.GradioUI.upload_file.file",description:"<strong>file</strong> (<code>gradio.File</code>) &#x2014; The uploaded file.",name:"file"},{anchor:"smolagents.GradioUI.upload_file.file_uploads_log",description:"<strong>file_uploads_log</strong> (<code>list</code>) &#x2014; A list to log uploaded files.",name:"file_uploads_log"},{anchor:"smolagents.GradioUI.upload_file.allowed_file_types",description:"<strong>allowed_file_types</strong> (<code>list</code>, <em>optional</em>) &#x2014; List of allowed file extensions. Defaults to [&#x201C;.pdf&#x201D;, &#x201C;.docx&#x201D;, &#x201C;.txt&#x201D;].",name:"allowed_file_types"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/gradio_ui.py#L356"}}),st=new S({props:{title:"मॉडल्स",local:"मडलस",headingTag:"h2"}}),mt=new V({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTJDJTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBbG9naW4oJTIyJTNDWU9VUl9IVUdHSU5HRkFDRUhVQl9BUElfVE9LRU4lM0UlMjIpJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4zLTcwQi1JbnN0cnVjdCUyMiUwQSUwQWNsaWVudCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudChtb2RlbCUzRG1vZGVsX2lkKSUwQSUwQWRlZiUyMGN1c3RvbV9tb2RlbChtZXNzYWdlcyUyQyUyMHN0b3Bfc2VxdWVuY2VzJTNEJTVCJTIyVGFzayUyMiU1RCklM0ElMEElMjAlMjAlMjAlMjByZXNwb25zZSUyMCUzRCUyMGNsaWVudC5jaGF0X2NvbXBsZXRpb24obWVzc2FnZXMlMkMlMjBzdG9wJTNEc3RvcF9zZXF1ZW5jZXMlMkMlMjBtYXhfdG9rZW5zJTNEMTAwMCklMEElMjAlMjAlMjAlMjBhbnN3ZXIlMjAlM0QlMjByZXNwb25zZS5jaG9pY2VzJTVCMCU1RC5tZXNzYWdlJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYW5zd2Vy",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login, InferenceClient

login(<span class="hljs-string">&quot;&lt;YOUR_HUGGINGFACEHUB_API_TOKEN&gt;&quot;</span>)

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

client = InferenceClient(model=model_id)

<span class="hljs-keyword">def</span> <span class="hljs-title function_">custom_model</span>(<span class="hljs-params">messages, stop_sequences=[<span class="hljs-string">&quot;Task&quot;</span>]</span>):
    response = client.chat_completion(messages, stop=stop_sequences, max_tokens=<span class="hljs-number">1000</span>)
    answer = response.choices[<span class="hljs-number">0</span>].message
    <span class="hljs-keyword">return</span> answer`,wrap:!1}}),ct=new S({props:{title:"TransformersModel",local:"smolagents.TransformersModel",headingTag:"h3"}}),pt=new V({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUcmFuc2Zvcm1lcnNNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwobW9kZWxfaWQlM0QlMjJIdWdnaW5nRmFjZVRCJTJGU21vbExNLTEzNU0tSW5zdHJ1Y3QlMjIpJTBBJTBBcHJpbnQobW9kZWwoJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyT2shJTIyJTdEJTVEJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJncmVhdCUyMiU1RCkp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> TransformersModel

model = TransformersModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),ut=new V({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),ht=new w({props:{name:"class smolagents.TransformersModel",anchor:"smolagents.TransformersModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"device_map",val:": str | None = None"},{name:"torch_dtype",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"model_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"max_new_tokens",val:": int = 4096"},{name:"max_tokens",val:": int | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.TransformersModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The Hugging Face model ID to be used for inference. This can be a path or model identifier from the Hugging Face model hub.
For example, <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>.`,name:"model_id"},{anchor:"smolagents.TransformersModel.device_map",description:`<strong>device_map</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The device_map to initialize your model with.`,name:"device_map"},{anchor:"smolagents.TransformersModel.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The torch_dtype to initialize your model with.`,name:"torch_dtype"},{anchor:"smolagents.TransformersModel.trust_remote_code",description:`<strong>trust_remote_code</strong> (bool, default <code>False</code>) &#x2014;
Some models on the Hub require running remote code: for this model, you would have to set this flag to True.`,name:"trust_remote_code"},{anchor:"smolagents.TransformersModel.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to <code>AutoModel.from_pretrained</code> (like revision, model_args, config, etc.).`,name:"model_kwargs"},{anchor:"smolagents.TransformersModel.max_new_tokens",description:`<strong>max_new_tokens</strong> (<code>int</code>, default <code>4096</code>) &#x2014;
Maximum number of new tokens to generate, ignoring the number of tokens in the prompt.`,name:"max_new_tokens"},{anchor:"smolagents.TransformersModel.max_tokens",description:`<strong>max_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Alias for <code>max_new_tokens</code>. If provided, this value takes precedence.`,name:"max_tokens"},{anchor:"smolagents.TransformersModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Transformers model generate call, such as <code>device</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L782",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),fe=new ga({props:{warning:!1,$$slots:{default:[Tl]},$$scope:{ctx:j}}}),_e=new zo({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[Cl]},$$scope:{ctx:j}}}),ft=new S({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),bt=new V({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIySGVsbG8lMkMlMjBob3clMjBhcmUlMjB5b3UlM0YlMjIlN0QlMkMlMEElMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIyYXNzaXN0YW50JTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkknbSUyMGRvaW5nJTIwZ3JlYXQuJTIwSG93JTIwY2FuJTIwSSUyMGhlbHAlMjB5b3UlMjB0b2RheSUzRiUyMiU3RCUyQyUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMk5vJTIwbmVlZCUyMHRvJTIwaGVscCUyQyUyMHRha2UlMjBpdCUyMGVhc3kuJTIyJTdEJTJDJTBBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBcHJpbnQobW9kZWwobWVzc2FnZXMpKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> InferenceClientModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>},
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;I&#x27;m doing great. How can I help you today?&quot;</span>},
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;No need to help, take it easy.&quot;</span>},
]

model = InferenceClientModel()
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),vt=new V({props:{code:"T2YlMjBjb3Vyc2UhJTIwSWYlMjB5b3UlMjBjaGFuZ2UlMjB5b3VyJTIwbWluZCUyQyUyMGZlZWwlMjBmcmVlJTIwdG8lMjByZWFjaCUyMG91dC4lMjBUYWtlJTIwY2FyZSE=",highlighted:"&gt;&gt;&gt; Of course! If you change your mind, feel free to reach out. Take care!",wrap:!1}}),Mt=new w({props:{name:"class smolagents.InferenceClientModel",anchor:"smolagents.InferenceClientModel",parameters:[{name:"model_id",val:": str = 'Qwen/Qwen2.5-Coder-32B-Instruct'"},{name:"provider",val:": str | None = None"},{name:"token",val:": str | None = None"},{name:"timeout",val:": int = 120"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"api_key",val:": str | None = None"},{name:"bill_to",val:": str | None = None"},{name:"base_url",val:": str | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.InferenceClientModel.model_id",description:`<strong>model_id</strong> (<code>str</code>, <em>optional</em>, default <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>) &#x2014;
The Hugging Face model ID to be used for inference.
This can be a model identifier from the Hugging Face model hub or a URL to a deployed Inference Endpoint.
Currently, it defaults to <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>, but this may change in the future.`,name:"model_id"},{anchor:"smolagents.InferenceClientModel.provider",description:`<strong>provider</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the provider to use for inference. A list of supported providers can be found in the <a href="https://huggingface.co/docs/inference-providers/index#partners" rel="nofollow">Inference Providers documentation</a>.
Defaults to &#x201C;auto&#x201D; i.e. the first of the providers available for the model, sorted by the user&#x2019;s order <a href="https://hf.co/settings/inference-providers" rel="nofollow">here</a>.
If <code>base_url</code> is passed, then <code>provider</code> is not used.`,name:"provider"},{anchor:"smolagents.InferenceClientModel.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token used by the Hugging Face API for authentication. This token need to be authorized &#x2018;Make calls to the serverless Inference Providers&#x2019;.
If the model is gated (like Llama-3 models), the token also needs &#x2018;Read access to contents of all public gated repos you can access&#x2019;.
If not provided, the class will try to use environment variable &#x2018;HF_TOKEN&#x2019;, else use the token stored in the Hugging Face CLI configuration.`,name:"token"},{anchor:"smolagents.InferenceClientModel.timeout",description:`<strong>timeout</strong> (<code>int</code>, <em>optional</em>, defaults to 120) &#x2014;
Timeout for the API request, in seconds.`,name:"timeout"},{anchor:"smolagents.InferenceClientModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the Hugging Face InferenceClient.`,name:"client_kwargs"},{anchor:"smolagents.InferenceClientModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.InferenceClientModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token to use for authentication. This is a duplicated argument from <code>token</code> to make <a href="/docs/smolagents/main/hi/reference/agents#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>token</code> is set. Defaults to None.`,name:"api_key"},{anchor:"smolagents.InferenceClientModel.bill_to",description:`<strong>bill_to</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The billing account to use for the requests. By default the requests are billed on the user&#x2019;s account. Requests can only be billed to
an organization the user is a member of, and which has subscribed to Enterprise Hub.`,name:"bill_to"},{anchor:"smolagents.InferenceClientModel.base_url",description:`<strong>base_url</strong> (<code>str</code>, <code>optional</code>) &#x2014;
Base URL to run inference. This is a duplicated argument from <code>model</code> to make <a href="/docs/smolagents/main/hi/reference/agents#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>model</code> is set. Defaults to None.`,name:"base_url"},{anchor:"smolagents.InferenceClientModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Hugging Face InferenceClient completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1339",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),be=new zo({props:{anchor:"smolagents.InferenceClientModel.example",$$slots:{default:[Il]},$$scope:{ctx:j}}}),$t=new w({props:{name:"create_client",anchor:"smolagents.InferenceClientModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1430"}}),yt=new S({props:{title:"LiteLLMModel",local:"smolagents.LiteLLMModel",headingTag:"h3"}}),wt=new V({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNTW9kZWwlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyJTdEJTJDJTBBJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMmFzc2lzdGFudCUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJJJ20lMjBkb2luZyUyMGdyZWF0LiUyMEhvdyUyMGNhbiUyMEklMjBoZWxwJTIweW91JTIwdG9kYXklM0YlMjIlN0QlMkMlMEElMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJObyUyMG5lZWQlMjB0byUyMGhlbHAlMkMlMjB0YWtlJTIwaXQlMjBlYXN5LiUyMiU3RCUyQyUwQSU1RCUwQSUwQW1vZGVsJTIwJTNEJTIwTGl0ZUxMTU1vZGVsKG1vZGVsX2lkJTNEJTIyYW50aHJvcGljJTJGY2xhdWRlLTMtNS1zb25uZXQtbGF0ZXN0JTIyJTJDJTIwdGVtcGVyYXR1cmUlM0QwLjIlMkMlMjBtYXhfdG9rZW5zJTNEMTApJTBBcHJpbnQobW9kZWwobWVzc2FnZXMpKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>},
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;assistant&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;I&#x27;m doing great. How can I help you today?&quot;</span>},
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;No need to help, take it easy.&quot;</span>},
]

model = LiteLLMModel(model_id=<span class="hljs-string">&quot;anthropic/claude-3-5-sonnet-latest&quot;</span>, temperature=<span class="hljs-number">0.2</span>, max_tokens=<span class="hljs-number">10</span>)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),Tt=new w({props:{name:"class smolagents.LiteLLMModel",anchor:"smolagents.LiteLLMModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"api_base",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.LiteLLMModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on the server (e.g. &#x201C;gpt-3.5-turbo&#x201D;).`,name:"model_id"},{anchor:"smolagents.LiteLLMModel.api_base",description:`<strong>api_base</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The base URL of the provider API to call the model.`,name:"api_base"},{anchor:"smolagents.LiteLLMModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication.`,name:"api_key"},{anchor:"smolagents.LiteLLMModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.LiteLLMModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to flatten messages as text.
Defaults to <code>True</code> for models that start with &#x201C;ollama&#x201D;, &#x201C;groq&#x201D;, &#x201C;cerebras&#x201D;.`,name:"flatten_messages_as_text"},{anchor:"smolagents.LiteLLMModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying LiteLLM completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1096"}}),Ct=new w({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1146"}}),It=new S({props:{title:"OpenAiServerModel",local:"openaiservermodel",headingTag:"h3"}}),Jt=new V({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyME9wZW5BSVNlcnZlck1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC00byUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9iYXNlJTNEJTIyaHR0cHMlM0ElMkYlMkZhcGkub3BlbmFpLmNvbSUyRnYxJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> OpenAIServerModel

model = OpenAIServerModel(
    model_id=<span class="hljs-string">&quot;gpt-4o&quot;</span>,
    api_base=<span class="hljs-string">&quot;https://api.openai.com/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>],
)`,wrap:!1}}),jt=new S({props:{title:"Prompts",local:"smolagents.PromptTemplates",headingTag:"h2"}}),Ut=new w({props:{name:"class smolagents.PromptTemplates",anchor:"smolagents.PromptTemplates",parameters:"",parametersDescription:[{anchor:"smolagents.PromptTemplates.system_prompt",description:"<strong>system_prompt</strong> (<code>str</code>) &#x2014; System prompt.",name:"system_prompt"},{anchor:"smolagents.PromptTemplates.planning",description:'<strong>planning</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.PlanningPromptTemplate">PlanningPromptTemplate</a>) &#x2014; Planning prompt templates.',name:"planning"},{anchor:"smolagents.PromptTemplates.managed_agent",description:'<strong>managed_agent</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.ManagedAgentPromptTemplate">ManagedAgentPromptTemplate</a>) &#x2014; Managed agent prompt templates.',name:"managed_agent"},{anchor:"smolagents.PromptTemplates.final_answer",description:'<strong>final_answer</strong> (<a href="/docs/smolagents/main/hi/reference/agents#smolagents.FinalAnswerPromptTemplate">FinalAnswerPromptTemplate</a>) &#x2014; Final answer prompt templates.',name:"final_answer"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L170"}}),At=new w({props:{name:"class smolagents.PlanningPromptTemplate",anchor:"smolagents.PlanningPromptTemplate",parameters:"",parametersDescription:[{anchor:"smolagents.PlanningPromptTemplate.plan",description:"<strong>plan</strong> (<code>str</code>) &#x2014; Initial plan prompt.",name:"plan"},{anchor:"smolagents.PlanningPromptTemplate.update_plan_pre_messages",description:"<strong>update_plan_pre_messages</strong> (<code>str</code>) &#x2014; Update plan pre-messages prompt.",name:"update_plan_pre_messages"},{anchor:"smolagents.PlanningPromptTemplate.update_plan_post_messages",description:"<strong>update_plan_post_messages</strong> (<code>str</code>) &#x2014; Update plan post-messages prompt.",name:"update_plan_post_messages"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L129"}}),Nt=new w({props:{name:"class smolagents.ManagedAgentPromptTemplate",anchor:"smolagents.ManagedAgentPromptTemplate",parameters:"",parametersDescription:[{anchor:"smolagents.ManagedAgentPromptTemplate.task",description:"<strong>task</strong> (<code>str</code>) &#x2014; Task prompt.",name:"task"},{anchor:"smolagents.ManagedAgentPromptTemplate.report",description:"<strong>report</strong> (<code>str</code>) &#x2014; Report prompt.",name:"report"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L144"}}),Lt=new w({props:{name:"class smolagents.FinalAnswerPromptTemplate",anchor:"smolagents.FinalAnswerPromptTemplate",parameters:"",parametersDescription:[{anchor:"smolagents.FinalAnswerPromptTemplate.pre_messages",description:"<strong>pre_messages</strong> (<code>str</code>) &#x2014; Pre-messages prompt.",name:"pre_messages"},{anchor:"smolagents.FinalAnswerPromptTemplate.post_messages",description:"<strong>post_messages</strong> (<code>str</code>) &#x2014; Post-messages prompt.",name:"post_messages"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/agents.py#L157"}}),qt=new Ml({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/hi/reference/agents.md"}}),{c(){m=l("meta"),C=o(),b=l("p"),v=o(),d(T.$$.fragment),f=o(),d(I.$$.fragment),Sn=o(),xe=l("p"),xe.innerHTML=pa,Vn=o(),d(we.$$.fragment),Wn=o(),Te=l("p"),Te.innerHTML=ua,Zn=o(),Ce=l("p"),Ce.innerHTML=ha,En=o(),Ie=l("ul"),Ie.innerHTML=fa,Bn=o(),ke=l("p"),ke.innerHTML=_a,Dn=o(),d(Je.$$.fragment),Gn=o(),M=l("div"),d(je.$$.fragment),Ro=o(),Bt=l("p"),Bt.textContent=ba,Xo=o(),Y=l("div"),d(Ue.$$.fragment),Yo=o(),Dt=l("p"),Dt.textContent=va,Oo=o(),O=l("div"),d(Ae.$$.fragment),Ko=o(),Gt=l("p"),Gt.textContent=Ma,es=o(),K=l("div"),d(Ne.$$.fragment),ts=o(),Qt=l("p"),Qt.textContent=$a,ns=o(),W=l("div"),d(Le.$$.fragment),os=o(),Ht=l("p"),Ht.textContent=ya,ss=o(),d(ee.$$.fragment),as=o(),te=l("div"),d(qe.$$.fragment),ls=o(),Ft=l("p"),Ft.textContent=xa,rs=o(),ne=l("div"),d(Pe.$$.fragment),is=o(),zt=l("p"),zt.textContent=wa,ms=o(),oe=l("div"),d(Se.$$.fragment),ds=o(),Rt=l("p"),Rt.textContent=Ta,cs=o(),se=l("div"),d(Ve.$$.fragment),gs=o(),Xt=l("p"),Xt.textContent=Ca,ps=o(),ae=l("div"),d(We.$$.fragment),us=o(),Yt=l("p"),Yt.textContent=Ia,hs=o(),Z=l("div"),d(Ze.$$.fragment),fs=o(),Ot=l("p"),Ot.textContent=ka,_s=o(),d(le.$$.fragment),bs=o(),E=l("div"),d(Ee.$$.fragment),vs=o(),Kt=l("p"),Kt.innerHTML=Ja,Ms=o(),en=l("ul"),en.innerHTML=ja,$s=o(),re=l("div"),d(Be.$$.fragment),ys=o(),tn=l("p"),tn.textContent=Ua,xs=o(),ie=l("div"),d(De.$$.fragment),ws=o(),nn=l("p"),nn.textContent=Aa,Ts=o(),me=l("div"),d(Ge.$$.fragment),Cs=o(),on=l("p"),on.textContent=Na,Is=o(),de=l("div"),d(Qe.$$.fragment),ks=o(),sn=l("p"),sn.textContent=La,Qn=o(),A=l("div"),d(He.$$.fragment),Js=o(),an=l("p"),an.textContent=qa,js=o(),ce=l("div"),d(Fe.$$.fragment),Us=o(),ln=l("p"),ln.textContent=Pa,As=o(),ge=l("div"),d(ze.$$.fragment),Ns=o(),rn=l("p"),rn.textContent=Sa,Hn=o(),N=l("div"),d(Re.$$.fragment),Ls=o(),mn=l("p"),mn.innerHTML=Va,qs=o(),B=l("div"),d(Xe.$$.fragment),Ps=o(),dn=l("p"),dn.textContent=Wa,Ss=o(),cn=l("p"),cn.textContent=Za,Vs=o(),pe=l("div"),d(Ye.$$.fragment),Ws=o(),gn=l("p"),gn.textContent=Ea,Fn=o(),d(Oe.$$.fragment),zn=o(),Q=l("div"),d(Ke.$$.fragment),Zs=o(),pn=l("p"),pn.textContent=Ba,Rn=o(),d(et.$$.fragment),Xn=o(),k=l("div"),d(tt.$$.fragment),Es=o(),un=l("p"),un.innerHTML=Da,Bs=o(),hn=l("p"),hn.innerHTML=Ga,Ds=o(),d(ue.$$.fragment),Gs=o(),he=l("div"),d(nt.$$.fragment),Qs=o(),fn=l("p"),fn.textContent=Qa,Hs=o(),D=l("div"),d(ot.$$.fragment),Fs=o(),_n=l("p"),_n.textContent=Ha,zs=o(),bn=l("p"),bn.innerHTML=Fa,Yn=o(),d(st.$$.fragment),On=o(),at=l("p"),at.textContent=za,Kn=o(),lt=l("p"),lt.innerHTML=Ra,eo=o(),rt=l("ol"),rt.innerHTML=Xa,to=o(),it=l("p"),it.innerHTML=Ya,no=o(),d(mt.$$.fragment),oo=o(),dt=l("p"),dt.innerHTML=Oa,so=o(),d(ct.$$.fragment),ao=o(),gt=l("p"),gt.innerHTML=Ka,lo=o(),d(pt.$$.fragment),ro=o(),d(ut.$$.fragment),io=o(),U=l("div"),d(ht.$$.fragment),Rs=o(),vn=l("p"),vn.textContent=el,Xs=o(),Mn=l("p"),Mn.textContent=tl,Ys=o(),d(fe.$$.fragment),Os=o(),d(_e.$$.fragment),mo=o(),d(ft.$$.fragment),co=o(),_t=l("p"),_t.innerHTML=nl,go=o(),d(bt.$$.fragment),po=o(),d(vt.$$.fragment),uo=o(),J=l("div"),d(Mt.$$.fragment),Ks=o(),$n=l("p"),$n.textContent=ol,ea=o(),yn=l("p"),yn.textContent=sl,ta=o(),xn=l("p"),xn.textContent=al,na=o(),d(be.$$.fragment),oa=o(),ve=l("div"),d($t.$$.fragment),sa=o(),wn=l("p"),wn.textContent=ll,ho=o(),d(yt.$$.fragment),fo=o(),xt=l("p"),xt.innerHTML=rl,_o=o(),d(wt.$$.fragment),bo=o(),P=l("div"),d(Tt.$$.fragment),aa=o(),Tn=l("p"),Tn.innerHTML=il,la=o(),Me=l("div"),d(Ct.$$.fragment),ra=o(),Cn=l("p"),Cn.textContent=ml,vo=o(),d(It.$$.fragment),Mo=o(),kt=l("p"),kt.innerHTML=dl,$o=o(),d(Jt.$$.fragment),yo=o(),d(jt.$$.fragment),xo=o(),H=l("div"),d(Ut.$$.fragment),ia=o(),In=l("p"),In.textContent=cl,wo=o(),F=l("div"),d(At.$$.fragment),ma=o(),kn=l("p"),kn.textContent=gl,To=o(),z=l("div"),d(Nt.$$.fragment),da=o(),Jn=l("p"),Jn.textContent=pl,Co=o(),R=l("div"),d(Lt.$$.fragment),ca=o(),jn=l("p"),jn.textContent=ul,Io=o(),d(qt.$$.fragment),ko=o(),Pn=l("p"),this.h()},l(e){const a=vl("svelte-u9bgzb",document.head);m=r(a,"META",{name:!0,content:!0}),a.forEach(n),C=s(e),b=r(e,"P",{}),y(b).forEach(n),v=s(e),c(T.$$.fragment,e),f=s(e),c(I.$$.fragment,e),Sn=s(e),xe=r(e,"P",{"data-svelte-h":!0}),_(xe)!=="svelte-530l0l"&&(xe.innerHTML=pa),Vn=s(e),c(we.$$.fragment,e),Wn=s(e),Te=r(e,"P",{"data-svelte-h":!0}),_(Te)!=="svelte-n5s19j"&&(Te.innerHTML=ua),Zn=s(e),Ce=r(e,"P",{"data-svelte-h":!0}),_(Ce)!=="svelte-pwzn35"&&(Ce.innerHTML=ha),En=s(e),Ie=r(e,"UL",{"data-svelte-h":!0}),_(Ie)!=="svelte-12o9kc3"&&(Ie.innerHTML=fa),Bn=s(e),ke=r(e,"P",{"data-svelte-h":!0}),_(ke)!=="svelte-12okbux"&&(ke.innerHTML=_a),Dn=s(e),c(Je.$$.fragment,e),Gn=s(e),M=r(e,"DIV",{class:!0});var $=y(M);c(je.$$.fragment,$),Ro=s($),Bt=r($,"P",{"data-svelte-h":!0}),_(Bt)!=="svelte-d5y990"&&(Bt.textContent=ba),Xo=s($),Y=r($,"DIV",{class:!0});var Pt=y(Y);c(Ue.$$.fragment,Pt),Yo=s(Pt),Dt=r(Pt,"P",{"data-svelte-h":!0}),_(Dt)!=="svelte-104knry"&&(Dt.textContent=va),Pt.forEach(n),Oo=s($),O=r($,"DIV",{class:!0});var St=y(O);c(Ae.$$.fragment,St),Ko=s(St),Gt=r(St,"P",{"data-svelte-h":!0}),_(Gt)!=="svelte-1kbba9r"&&(Gt.textContent=Ma),St.forEach(n),es=s($),K=r($,"DIV",{class:!0});var Vt=y(K);c(Ne.$$.fragment,Vt),ts=s(Vt),Qt=r(Vt,"P",{"data-svelte-h":!0}),_(Qt)!=="svelte-1f5g0y1"&&(Qt.textContent=$a),Vt.forEach(n),ns=s($),W=r($,"DIV",{class:!0});var X=y(W);c(Le.$$.fragment,X),os=s(X),Ht=r(X,"P",{"data-svelte-h":!0}),_(Ht)!=="svelte-px853z"&&(Ht.textContent=ya),ss=s(X),c(ee.$$.fragment,X),X.forEach(n),as=s($),te=r($,"DIV",{class:!0});var Wt=y(te);c(qe.$$.fragment,Wt),ls=s(Wt),Ft=r(Wt,"P",{"data-svelte-h":!0}),_(Ft)!=="svelte-aqxmk9"&&(Ft.textContent=xa),Wt.forEach(n),rs=s($),ne=r($,"DIV",{class:!0});var Zt=y(ne);c(Pe.$$.fragment,Zt),is=s(Zt),zt=r(Zt,"P",{"data-svelte-h":!0}),_(zt)!=="svelte-vma7te"&&(zt.textContent=wa),Zt.forEach(n),ms=s($),oe=r($,"DIV",{class:!0});var jo=y(oe);c(Se.$$.fragment,jo),ds=s(jo),Rt=r(jo,"P",{"data-svelte-h":!0}),_(Rt)!=="svelte-s6zvq5"&&(Rt.textContent=Ta),jo.forEach(n),cs=s($),se=r($,"DIV",{class:!0});var Uo=y(se);c(Ve.$$.fragment,Uo),gs=s(Uo),Xt=r(Uo,"P",{"data-svelte-h":!0}),_(Xt)!=="svelte-3y7cve"&&(Xt.textContent=Ca),Uo.forEach(n),ps=s($),ae=r($,"DIV",{class:!0});var Ao=y(ae);c(We.$$.fragment,Ao),us=s(Ao),Yt=r(Ao,"P",{"data-svelte-h":!0}),_(Yt)!=="svelte-28znqy"&&(Yt.textContent=Ia),Ao.forEach(n),hs=s($),Z=r($,"DIV",{class:!0});var Un=y(Z);c(Ze.$$.fragment,Un),fs=s(Un),Ot=r(Un,"P",{"data-svelte-h":!0}),_(Ot)!=="svelte-1rclfo7"&&(Ot.textContent=ka),_s=s(Un),c(le.$$.fragment,Un),Un.forEach(n),bs=s($),E=r($,"DIV",{class:!0});var An=y(E);c(Ee.$$.fragment,An),vs=s(An),Kt=r(An,"P",{"data-svelte-h":!0}),_(Kt)!=="svelte-1uw6gyw"&&(Kt.innerHTML=Ja),Ms=s(An),en=r(An,"UL",{"data-svelte-h":!0}),_(en)!=="svelte-11tnr4k"&&(en.innerHTML=ja),An.forEach(n),$s=s($),re=r($,"DIV",{class:!0});var No=y(re);c(Be.$$.fragment,No),ys=s(No),tn=r(No,"P",{"data-svelte-h":!0}),_(tn)!=="svelte-1av9fpz"&&(tn.textContent=Ua),No.forEach(n),xs=s($),ie=r($,"DIV",{class:!0});var Lo=y(ie);c(De.$$.fragment,Lo),ws=s(Lo),nn=r(Lo,"P",{"data-svelte-h":!0}),_(nn)!=="svelte-1kyagwa"&&(nn.textContent=Aa),Lo.forEach(n),Ts=s($),me=r($,"DIV",{class:!0});var qo=y(me);c(Ge.$$.fragment,qo),Cs=s(qo),on=r(qo,"P",{"data-svelte-h":!0}),_(on)!=="svelte-em4ik4"&&(on.textContent=Na),qo.forEach(n),Is=s($),de=r($,"DIV",{class:!0});var Po=y(de);c(Qe.$$.fragment,Po),ks=s(Po),sn=r(Po,"P",{"data-svelte-h":!0}),_(sn)!=="svelte-jg60qx"&&(sn.textContent=La),Po.forEach(n),$.forEach(n),Qn=s(e),A=r(e,"DIV",{class:!0});var $e=y(A);c(He.$$.fragment,$e),Js=s($e),an=r($e,"P",{"data-svelte-h":!0}),_(an)!=="svelte-1mxsa12"&&(an.textContent=qa),js=s($e),ce=r($e,"DIV",{class:!0});var So=y(ce);c(Fe.$$.fragment,So),Us=s(So),ln=r(So,"P",{"data-svelte-h":!0}),_(ln)!=="svelte-1dq3hsa"&&(ln.textContent=Pa),So.forEach(n),As=s($e),ge=r($e,"DIV",{class:!0});var Vo=y(ge);c(ze.$$.fragment,Vo),Ns=s(Vo),rn=r(Vo,"P",{"data-svelte-h":!0}),_(rn)!=="svelte-1bap6qm"&&(rn.textContent=Sa),Vo.forEach(n),$e.forEach(n),Hn=s(e),N=r(e,"DIV",{class:!0});var ye=y(N);c(Re.$$.fragment,ye),Ls=s(ye),mn=r(ye,"P",{"data-svelte-h":!0}),_(mn)!=="svelte-71yyi1"&&(mn.innerHTML=Va),qs=s(ye),B=r(ye,"DIV",{class:!0});var Nn=y(B);c(Xe.$$.fragment,Nn),Ps=s(Nn),dn=r(Nn,"P",{"data-svelte-h":!0}),_(dn)!=="svelte-yjyhgb"&&(dn.textContent=Wa),Ss=s(Nn),cn=r(Nn,"P",{"data-svelte-h":!0}),_(cn)!=="svelte-1l33w20"&&(cn.textContent=Za),Nn.forEach(n),Vs=s(ye),pe=r(ye,"DIV",{class:!0});var Wo=y(pe);c(Ye.$$.fragment,Wo),Ws=s(Wo),gn=r(Wo,"P",{"data-svelte-h":!0}),_(gn)!=="svelte-132xt9l"&&(gn.textContent=Ea),Wo.forEach(n),ye.forEach(n),Fn=s(e),c(Oe.$$.fragment,e),zn=s(e),Q=r(e,"DIV",{class:!0});var Zo=y(Q);c(Ke.$$.fragment,Zo),Zs=s(Zo),pn=r(Zo,"P",{"data-svelte-h":!0}),_(pn)!=="svelte-3yyclm"&&(pn.textContent=Ba),Zo.forEach(n),Rn=s(e),c(et.$$.fragment,e),Xn=s(e),k=r(e,"DIV",{class:!0});var L=y(k);c(tt.$$.fragment,L),Es=s(L),un=r(L,"P",{"data-svelte-h":!0}),_(un)!=="svelte-1l1remn"&&(un.innerHTML=Da),Bs=s(L),hn=r(L,"P",{"data-svelte-h":!0}),_(hn)!=="svelte-i76913"&&(hn.innerHTML=Ga),Ds=s(L),c(ue.$$.fragment,L),Gs=s(L),he=r(L,"DIV",{class:!0});var Eo=y(he);c(nt.$$.fragment,Eo),Qs=s(Eo),fn=r(Eo,"P",{"data-svelte-h":!0}),_(fn)!=="svelte-1jjhzc2"&&(fn.textContent=Qa),Eo.forEach(n),Hs=s(L),D=r(L,"DIV",{class:!0});var Ln=y(D);c(ot.$$.fragment,Ln),Fs=s(Ln),_n=r(Ln,"P",{"data-svelte-h":!0}),_(_n)!=="svelte-7pw2wo"&&(_n.textContent=Ha),zs=s(Ln),bn=r(Ln,"P",{"data-svelte-h":!0}),_(bn)!=="svelte-19g2bgi"&&(bn.innerHTML=Fa),Ln.forEach(n),L.forEach(n),Yn=s(e),c(st.$$.fragment,e),On=s(e),at=r(e,"P",{"data-svelte-h":!0}),_(at)!=="svelte-1hr4phi"&&(at.textContent=za),Kn=s(e),lt=r(e,"P",{"data-svelte-h":!0}),_(lt)!=="svelte-13vv5yy"&&(lt.innerHTML=Ra),eo=s(e),rt=r(e,"OL",{"data-svelte-h":!0}),_(rt)!=="svelte-btvrd5"&&(rt.innerHTML=Xa),to=s(e),it=r(e,"P",{"data-svelte-h":!0}),_(it)!=="svelte-m6zjmh"&&(it.innerHTML=Ya),no=s(e),c(mt.$$.fragment,e),oo=s(e),dt=r(e,"P",{"data-svelte-h":!0}),_(dt)!=="svelte-15khdi2"&&(dt.innerHTML=Oa),so=s(e),c(ct.$$.fragment,e),ao=s(e),gt=r(e,"P",{"data-svelte-h":!0}),_(gt)!=="svelte-bqff4p"&&(gt.innerHTML=Ka),lo=s(e),c(pt.$$.fragment,e),ro=s(e),c(ut.$$.fragment,e),io=s(e),U=r(e,"DIV",{class:!0});var G=y(U);c(ht.$$.fragment,G),Rs=s(G),vn=r(G,"P",{"data-svelte-h":!0}),_(vn)!=="svelte-1ex1ahr"&&(vn.textContent=el),Xs=s(G),Mn=r(G,"P",{"data-svelte-h":!0}),_(Mn)!=="svelte-1140acn"&&(Mn.textContent=tl),Ys=s(G),c(fe.$$.fragment,G),Os=s(G),c(_e.$$.fragment,G),G.forEach(n),mo=s(e),c(ft.$$.fragment,e),co=s(e),_t=r(e,"P",{"data-svelte-h":!0}),_(_t)!=="svelte-21wzws"&&(_t.innerHTML=nl),go=s(e),c(bt.$$.fragment,e),po=s(e),c(vt.$$.fragment,e),uo=s(e),J=r(e,"DIV",{class:!0});var q=y(J);c(Mt.$$.fragment,q),Ks=s(q),$n=r(q,"P",{"data-svelte-h":!0}),_($n)!=="svelte-axkcn3"&&($n.textContent=ol),ea=s(q),yn=r(q,"P",{"data-svelte-h":!0}),_(yn)!=="svelte-bducrc"&&(yn.textContent=sl),ta=s(q),xn=r(q,"P",{"data-svelte-h":!0}),_(xn)!=="svelte-12eu297"&&(xn.textContent=al),na=s(q),c(be.$$.fragment,q),oa=s(q),ve=r(q,"DIV",{class:!0});var Bo=y(ve);c($t.$$.fragment,Bo),sa=s(Bo),wn=r(Bo,"P",{"data-svelte-h":!0}),_(wn)!=="svelte-ym2f5u"&&(wn.textContent=ll),Bo.forEach(n),q.forEach(n),ho=s(e),c(yt.$$.fragment,e),fo=s(e),xt=r(e,"P",{"data-svelte-h":!0}),_(xt)!=="svelte-1ufdi39"&&(xt.innerHTML=rl),_o=s(e),c(wt.$$.fragment,e),bo=s(e),P=r(e,"DIV",{class:!0});var qn=y(P);c(Tt.$$.fragment,qn),aa=s(qn),Tn=r(qn,"P",{"data-svelte-h":!0}),_(Tn)!=="svelte-5g97zk"&&(Tn.innerHTML=il),la=s(qn),Me=r(qn,"DIV",{class:!0});var Do=y(Me);c(Ct.$$.fragment,Do),ra=s(Do),Cn=r(Do,"P",{"data-svelte-h":!0}),_(Cn)!=="svelte-12r14rd"&&(Cn.textContent=ml),Do.forEach(n),qn.forEach(n),vo=s(e),c(It.$$.fragment,e),Mo=s(e),kt=r(e,"P",{"data-svelte-h":!0}),_(kt)!=="svelte-15ywemq"&&(kt.innerHTML=dl),$o=s(e),c(Jt.$$.fragment,e),yo=s(e),c(jt.$$.fragment,e),xo=s(e),H=r(e,"DIV",{class:!0});var Go=y(H);c(Ut.$$.fragment,Go),ia=s(Go),In=r(Go,"P",{"data-svelte-h":!0}),_(In)!=="svelte-1qudq9i"&&(In.textContent=cl),Go.forEach(n),wo=s(e),F=r(e,"DIV",{class:!0});var Qo=y(F);c(At.$$.fragment,Qo),ma=s(Qo),kn=r(Qo,"P",{"data-svelte-h":!0}),_(kn)!=="svelte-139nrra"&&(kn.textContent=gl),Qo.forEach(n),To=s(e),z=r(e,"DIV",{class:!0});var Ho=y(z);c(Nt.$$.fragment,Ho),da=s(Ho),Jn=r(Ho,"P",{"data-svelte-h":!0}),_(Jn)!=="svelte-uxob75"&&(Jn.textContent=pl),Ho.forEach(n),Co=s(e),R=r(e,"DIV",{class:!0});var Fo=y(R);c(Lt.$$.fragment,Fo),ca=s(Fo),jn=r(Fo,"P",{"data-svelte-h":!0}),_(jn)!=="svelte-52nyxb"&&(jn.textContent=ul),Fo.forEach(n),Io=s(e),c(qt.$$.fragment,e),ko=s(e),Pn=r(e,"P",{}),y(Pn).forEach(n),this.h()},h(){x(m,"name","hf:doc:metadata"),x(m,"content",Jl),x(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ie,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(de,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),x(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){t(document.head,m),i(e,C,a),i(e,b,a),i(e,v,a),g(T,e,a),i(e,f,a),g(I,e,a),i(e,Sn,a),i(e,xe,a),i(e,Vn,a),g(we,e,a),i(e,Wn,a),i(e,Te,a),i(e,Zn,a),i(e,Ce,a),i(e,En,a),i(e,Ie,a),i(e,Bn,a),i(e,ke,a),i(e,Dn,a),g(Je,e,a),i(e,Gn,a),i(e,M,a),g(je,M,null),t(M,Ro),t(M,Bt),t(M,Xo),t(M,Y),g(Ue,Y,null),t(Y,Yo),t(Y,Dt),t(M,Oo),t(M,O),g(Ae,O,null),t(O,Ko),t(O,Gt),t(M,es),t(M,K),g(Ne,K,null),t(K,ts),t(K,Qt),t(M,ns),t(M,W),g(Le,W,null),t(W,os),t(W,Ht),t(W,ss),g(ee,W,null),t(M,as),t(M,te),g(qe,te,null),t(te,ls),t(te,Ft),t(M,rs),t(M,ne),g(Pe,ne,null),t(ne,is),t(ne,zt),t(M,ms),t(M,oe),g(Se,oe,null),t(oe,ds),t(oe,Rt),t(M,cs),t(M,se),g(Ve,se,null),t(se,gs),t(se,Xt),t(M,ps),t(M,ae),g(We,ae,null),t(ae,us),t(ae,Yt),t(M,hs),t(M,Z),g(Ze,Z,null),t(Z,fs),t(Z,Ot),t(Z,_s),g(le,Z,null),t(M,bs),t(M,E),g(Ee,E,null),t(E,vs),t(E,Kt),t(E,Ms),t(E,en),t(M,$s),t(M,re),g(Be,re,null),t(re,ys),t(re,tn),t(M,xs),t(M,ie),g(De,ie,null),t(ie,ws),t(ie,nn),t(M,Ts),t(M,me),g(Ge,me,null),t(me,Cs),t(me,on),t(M,Is),t(M,de),g(Qe,de,null),t(de,ks),t(de,sn),i(e,Qn,a),i(e,A,a),g(He,A,null),t(A,Js),t(A,an),t(A,js),t(A,ce),g(Fe,ce,null),t(ce,Us),t(ce,ln),t(A,As),t(A,ge),g(ze,ge,null),t(ge,Ns),t(ge,rn),i(e,Hn,a),i(e,N,a),g(Re,N,null),t(N,Ls),t(N,mn),t(N,qs),t(N,B),g(Xe,B,null),t(B,Ps),t(B,dn),t(B,Ss),t(B,cn),t(N,Vs),t(N,pe),g(Ye,pe,null),t(pe,Ws),t(pe,gn),i(e,Fn,a),g(Oe,e,a),i(e,zn,a),i(e,Q,a),g(Ke,Q,null),t(Q,Zs),t(Q,pn),i(e,Rn,a),g(et,e,a),i(e,Xn,a),i(e,k,a),g(tt,k,null),t(k,Es),t(k,un),t(k,Bs),t(k,hn),t(k,Ds),g(ue,k,null),t(k,Gs),t(k,he),g(nt,he,null),t(he,Qs),t(he,fn),t(k,Hs),t(k,D),g(ot,D,null),t(D,Fs),t(D,_n),t(D,zs),t(D,bn),i(e,Yn,a),g(st,e,a),i(e,On,a),i(e,at,a),i(e,Kn,a),i(e,lt,a),i(e,eo,a),i(e,rt,a),i(e,to,a),i(e,it,a),i(e,no,a),g(mt,e,a),i(e,oo,a),i(e,dt,a),i(e,so,a),g(ct,e,a),i(e,ao,a),i(e,gt,a),i(e,lo,a),g(pt,e,a),i(e,ro,a),g(ut,e,a),i(e,io,a),i(e,U,a),g(ht,U,null),t(U,Rs),t(U,vn),t(U,Xs),t(U,Mn),t(U,Ys),g(fe,U,null),t(U,Os),g(_e,U,null),i(e,mo,a),g(ft,e,a),i(e,co,a),i(e,_t,a),i(e,go,a),g(bt,e,a),i(e,po,a),g(vt,e,a),i(e,uo,a),i(e,J,a),g(Mt,J,null),t(J,Ks),t(J,$n),t(J,ea),t(J,yn),t(J,ta),t(J,xn),t(J,na),g(be,J,null),t(J,oa),t(J,ve),g($t,ve,null),t(ve,sa),t(ve,wn),i(e,ho,a),g(yt,e,a),i(e,fo,a),i(e,xt,a),i(e,_o,a),g(wt,e,a),i(e,bo,a),i(e,P,a),g(Tt,P,null),t(P,aa),t(P,Tn),t(P,la),t(P,Me),g(Ct,Me,null),t(Me,ra),t(Me,Cn),i(e,vo,a),g(It,e,a),i(e,Mo,a),i(e,kt,a),i(e,$o,a),g(Jt,e,a),i(e,yo,a),g(jt,e,a),i(e,xo,a),i(e,H,a),g(Ut,H,null),t(H,ia),t(H,In),i(e,wo,a),i(e,F,a),g(At,F,null),t(F,ma),t(F,kn),i(e,To,a),i(e,z,a),g(Nt,z,null),t(z,da),t(z,Jn),i(e,Co,a),i(e,R,a),g(Lt,R,null),t(R,ca),t(R,jn),i(e,Io,a),g(qt,e,a),i(e,ko,a),i(e,Pn,a),Jo=!0},p(e,[a]){const $={};a&2&&($.$$scope={dirty:a,ctx:e}),I.$set($);const Pt={};a&2&&(Pt.$$scope={dirty:a,ctx:e}),ee.$set(Pt);const St={};a&2&&(St.$$scope={dirty:a,ctx:e}),le.$set(St);const Vt={};a&2&&(Vt.$$scope={dirty:a,ctx:e}),ue.$set(Vt);const X={};a&2&&(X.$$scope={dirty:a,ctx:e}),fe.$set(X);const Wt={};a&2&&(Wt.$$scope={dirty:a,ctx:e}),_e.$set(Wt);const Zt={};a&2&&(Zt.$$scope={dirty:a,ctx:e}),be.$set(Zt)},i(e){Jo||(p(T.$$.fragment,e),p(I.$$.fragment,e),p(we.$$.fragment,e),p(Je.$$.fragment,e),p(je.$$.fragment,e),p(Ue.$$.fragment,e),p(Ae.$$.fragment,e),p(Ne.$$.fragment,e),p(Le.$$.fragment,e),p(ee.$$.fragment,e),p(qe.$$.fragment,e),p(Pe.$$.fragment,e),p(Se.$$.fragment,e),p(Ve.$$.fragment,e),p(We.$$.fragment,e),p(Ze.$$.fragment,e),p(le.$$.fragment,e),p(Ee.$$.fragment,e),p(Be.$$.fragment,e),p(De.$$.fragment,e),p(Ge.$$.fragment,e),p(Qe.$$.fragment,e),p(He.$$.fragment,e),p(Fe.$$.fragment,e),p(ze.$$.fragment,e),p(Re.$$.fragment,e),p(Xe.$$.fragment,e),p(Ye.$$.fragment,e),p(Oe.$$.fragment,e),p(Ke.$$.fragment,e),p(et.$$.fragment,e),p(tt.$$.fragment,e),p(ue.$$.fragment,e),p(nt.$$.fragment,e),p(ot.$$.fragment,e),p(st.$$.fragment,e),p(mt.$$.fragment,e),p(ct.$$.fragment,e),p(pt.$$.fragment,e),p(ut.$$.fragment,e),p(ht.$$.fragment,e),p(fe.$$.fragment,e),p(_e.$$.fragment,e),p(ft.$$.fragment,e),p(bt.$$.fragment,e),p(vt.$$.fragment,e),p(Mt.$$.fragment,e),p(be.$$.fragment,e),p($t.$$.fragment,e),p(yt.$$.fragment,e),p(wt.$$.fragment,e),p(Tt.$$.fragment,e),p(Ct.$$.fragment,e),p(It.$$.fragment,e),p(Jt.$$.fragment,e),p(jt.$$.fragment,e),p(Ut.$$.fragment,e),p(At.$$.fragment,e),p(Nt.$$.fragment,e),p(Lt.$$.fragment,e),p(qt.$$.fragment,e),Jo=!0)},o(e){u(T.$$.fragment,e),u(I.$$.fragment,e),u(we.$$.fragment,e),u(Je.$$.fragment,e),u(je.$$.fragment,e),u(Ue.$$.fragment,e),u(Ae.$$.fragment,e),u(Ne.$$.fragment,e),u(Le.$$.fragment,e),u(ee.$$.fragment,e),u(qe.$$.fragment,e),u(Pe.$$.fragment,e),u(Se.$$.fragment,e),u(Ve.$$.fragment,e),u(We.$$.fragment,e),u(Ze.$$.fragment,e),u(le.$$.fragment,e),u(Ee.$$.fragment,e),u(Be.$$.fragment,e),u(De.$$.fragment,e),u(Ge.$$.fragment,e),u(Qe.$$.fragment,e),u(He.$$.fragment,e),u(Fe.$$.fragment,e),u(ze.$$.fragment,e),u(Re.$$.fragment,e),u(Xe.$$.fragment,e),u(Ye.$$.fragment,e),u(Oe.$$.fragment,e),u(Ke.$$.fragment,e),u(et.$$.fragment,e),u(tt.$$.fragment,e),u(ue.$$.fragment,e),u(nt.$$.fragment,e),u(ot.$$.fragment,e),u(st.$$.fragment,e),u(mt.$$.fragment,e),u(ct.$$.fragment,e),u(pt.$$.fragment,e),u(ut.$$.fragment,e),u(ht.$$.fragment,e),u(fe.$$.fragment,e),u(_e.$$.fragment,e),u(ft.$$.fragment,e),u(bt.$$.fragment,e),u(vt.$$.fragment,e),u(Mt.$$.fragment,e),u(be.$$.fragment,e),u($t.$$.fragment,e),u(yt.$$.fragment,e),u(wt.$$.fragment,e),u(Tt.$$.fragment,e),u(Ct.$$.fragment,e),u(It.$$.fragment,e),u(Jt.$$.fragment,e),u(jt.$$.fragment,e),u(Ut.$$.fragment,e),u(At.$$.fragment,e),u(Nt.$$.fragment,e),u(Lt.$$.fragment,e),u(qt.$$.fragment,e),Jo=!1},d(e){e&&(n(C),n(b),n(v),n(f),n(Sn),n(xe),n(Vn),n(Wn),n(Te),n(Zn),n(Ce),n(En),n(Ie),n(Bn),n(ke),n(Dn),n(Gn),n(M),n(Qn),n(A),n(Hn),n(N),n(Fn),n(zn),n(Q),n(Rn),n(Xn),n(k),n(Yn),n(On),n(at),n(Kn),n(lt),n(eo),n(rt),n(to),n(it),n(no),n(oo),n(dt),n(so),n(ao),n(gt),n(lo),n(ro),n(io),n(U),n(mo),n(co),n(_t),n(go),n(po),n(uo),n(J),n(ho),n(fo),n(xt),n(_o),n(bo),n(P),n(vo),n(Mo),n(kt),n($o),n(yo),n(xo),n(H),n(wo),n(F),n(To),n(z),n(Co),n(R),n(Io),n(ko),n(Pn)),n(m),h(T,e),h(I,e),h(we,e),h(Je,e),h(je),h(Ue),h(Ae),h(Ne),h(Le),h(ee),h(qe),h(Pe),h(Se),h(Ve),h(We),h(Ze),h(le),h(Ee),h(Be),h(De),h(Ge),h(Qe),h(He),h(Fe),h(ze),h(Re),h(Xe),h(Ye),h(Oe,e),h(Ke),h(et,e),h(tt),h(ue),h(nt),h(ot),h(st,e),h(mt,e),h(ct,e),h(pt,e),h(ut,e),h(ht),h(fe),h(_e),h(ft,e),h(bt,e),h(vt,e),h(Mt),h(be),h($t),h(yt,e),h(wt,e),h(Tt),h(Ct),h(It,e),h(Jt,e),h(jt,e),h(Ut),h(At),h(Nt),h(Lt),h(qt,e)}}}const Jl='{"title":"Agents","local":"agents","sections":[{"title":"Agents","local":"agents","sections":[{"title":"Agents की क्लासेज","local":"smolagents.MultiStepAgent","sections":[],"depth":3},{"title":"stream_to_gradio","local":"smolagents.stream_to_gradio","sections":[],"depth":3},{"title":"GradioUI","local":"smolagents.GradioUI","sections":[],"depth":3}],"depth":2},{"title":"मॉडल्स","local":"मडलस","sections":[{"title":"TransformersModel","local":"smolagents.TransformersModel","sections":[],"depth":3},{"title":"InferenceClientModel","local":"smolagents.InferenceClientModel","sections":[],"depth":3},{"title":"LiteLLMModel","local":"smolagents.LiteLLMModel","sections":[],"depth":3},{"title":"OpenAiServerModel","local":"openaiservermodel","sections":[],"depth":3}],"depth":2},{"title":"Prompts","local":"smolagents.PromptTemplates","sections":[],"depth":2}],"depth":1}';function jl(j){return fl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Sl extends _l{constructor(m){super(),bl(this,m,jl,kl,hl,{})}}export{Sl as component};
