import{s as hl,o as fl,n as Et}from"../chunks/scheduler.f6319a2a.js";import{S as bl,i as _l,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 g,x as b,k as x,y as t,a as i,v as c,d as p,t as u,w as h}from"../chunks/index.85aa684c.js";import{T as ca}from"../chunks/Tip.3d397a88.js";import{D as w,E as Fo}from"../chunks/ExampleCodeBlock.ac5a24b2.js";import{C as V}from"../chunks/CodeBlock.3400fc53.js";import{H as S,E as Ml}from"../chunks/getInferenceSnippets.743412b2.js";function $l(j){let m,C="Smolagents एक experimental API है जो किसी भी समय बदल सकता है। एजेंट्स द्वारा लौटाए गए परिणाम भिन्न हो सकते हैं क्योंकि APIs या underlying मॉडल बदलने की संभावना रखते हैं।";return{c(){m=l("p"),m.textContent=C},l(_){m=r(_,"P",{"data-svelte-h":!0}),b(m)!=="svelte-1f42n0i"&&(m.textContent=C)},m(_,v){i(_,m,v)},p:Et,d(_){_&&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(_){m=r(_,"P",{"data-svelte-h":!0}),b(m)!=="svelte-fpk7e5"&&(m.textContent=C)},m(_,v){i(_,m,v)},p:Et,d(_){_&&n(m)}}}function xl(j){let m,C="Example:",_,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,_=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),b(m)!=="svelte-11lpom8"&&(m.textContent=C),_=s(f),g(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,_,I),c(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(_)),h(v,f)}}}function wl(j){let m,C="Example:",_,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,_=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),b(m)!=="svelte-11lpom8"&&(m.textContent=C),_=s(f),g(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,_,I),c(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(_)),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 smolagents[transformers]</code> if it’s not the case.";return{c(){m=l("p"),m.innerHTML=C},l(_){m=r(_,"P",{"data-svelte-h":!0}),b(m)!=="svelte-1tclttn"&&(m.innerHTML=C)},m(_,v){i(_,m,v)},p:Et,d(_){_&&n(m)}}}function Cl(j){let m,C="Example:",_,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,_=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),b(m)!=="svelte-11lpom8"&&(m.textContent=C),_=s(f),g(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,_,I),c(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(_)),h(v,f)}}}function Il(j){let m,C="Example:",_,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,_=o(),d(v.$$.fragment)},l(f){m=r(f,"P",{"data-svelte-h":!0}),b(m)!=="svelte-11lpom8"&&(m.textContent=C),_=s(f),g(v.$$.fragment,f)},m(f,I){i(f,m,I),i(f,_,I),c(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(_)),h(v,f)}}}function kl(j){let m,C,_,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/v1.21.1/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/v1.21.1/hi/reference/agents#smolagents.CodeAgent">CodeAgent</a> डिफ़ॉल्ट एजेंट है, यह अपने टूल कॉल्स को Python कोड में लिखता है।</li> <li><a href="/docs/smolagents/v1.21.1/hi/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> अपने टूल कॉल्स को JSON में लिखता है।</li>',Bn,ke,ba="दोनों को इनिशियलाइजेशन पर <code>model</code> और टूल्स की सूची <code>tools</code> आर्गुमेंट्स की आवश्यकता होती है।",Dn,Je,Gn,M,je,Ro,Bt,_a=`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,zt,xa="To be implemented in child classes",rs,ne,Pe,is,Ft,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.",gs,se,Ve,cs,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.",bs,le,_s,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,ge,ze,Us,ln,Pa="Clean up resources used by the agent, such as the remote Python executor.",As,ce,Fe,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,gn,Za="The arguments are replaced with the actual values from the state if they refer to state variables.",Vs,pe,Ye,Ws,cn,Ea="Process tool calls from the model output and update agent memory.",zn,Oe,Fn,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/v1.21.1/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>smolagents[gradio]</code>.`,Ds,ue,Gs,he,nt,Qs,fn,Qa="Launch the Gradio app with the agent interface.",Hs,D,ot,zs,bn,Ha="Upload a file and add it to the list of uploaded files in the session state.",Fs,_n,za=`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,Fa="आप स्वतंत्र रूप से अपने स्वयं के मॉडल बना सकते हैं और उनका उपयोग कर सकते हैं।",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,gt,ao,ct,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,be,mo,ft,go,bt,nl='<code>InferenceClientModel</code> LLM के एक्जीक्यूशन के लिए <a href="https://huggingface.co/docs/api-inference/index" rel="nofollow">HF Inference API</a> क्लाइंट को रैप करता है।',co,_t,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,_e,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> पास करते हैं।`,bo,wt,_o,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,gl="Prompt templates for the agent.",wo,z,At,ma,kn,cl="Prompt templates for the planning step.",To,F,Nt,da,Jn,pl="Prompt templates for the managed agent.",Co,R,Lt,ga,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 ca({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/v1.21.1/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/v1.21.1/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"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L229"}}),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/v1.21.1/src/smolagents/agents.py#L745"}}),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/v1.21.1/src/smolagents/agents.py#L968",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/v1.21.1/src/smolagents/agents.py#L1066"}}),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/v1.21.1/src/smolagents/agents.py#L1012"}}),ee=new ca({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/v1.21.1/src/smolagents/agents.py#L705"}}),Pe=new w({props:{name:"interrupt",anchor:"smolagents.MultiStepAgent.interrupt",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L710"}}),Se=new w({props:{name:"provide_final_answer",anchor:"smolagents.MultiStepAgent.provide_final_answer",parameters:[{name:"task",val:": str"},{name:"images",val:": list['PIL.Image.Image'] | None = None"}],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/v1.21.1/src/smolagents/agents.py#L766",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/v1.21.1/src/smolagents/agents.py#L1098"}}),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/v1.21.1/src/smolagents/agents.py#L817"}}),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"}],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"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L395"}}),le=new Fo({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/v1.21.1/src/smolagents/agents.py#L850"}}),Be=new w({props:{name:"step",anchor:"smolagents.MultiStepAgent.step",parameters:[{name:"memory_step",val:": ActionStep"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L738"}}),De=new w({props:{name:"to_dict",anchor:"smolagents.MultiStepAgent.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L928",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/v1.21.1/src/smolagents/agents.py#L813"}}),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/v1.21.1/src/smolagents/agents.py#L714"}}),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', '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/v1.21.1/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/v1.21.1/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;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/v1.21.1/src/smolagents/agents.py#L1447"}}),ze=new w({props:{name:"cleanup",anchor:"smolagents.CodeAgent.cleanup",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L1535"}}),Fe=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/v1.21.1/src/smolagents/agents.py#L1717",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/v1.21.1/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/v1.21.1/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/v1.21.1/src/smolagents/agents.py#L1153"}}),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/v1.21.1/src/smolagents/agents.py#L1395"}}),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/v1.21.1/src/smolagents/agents.py#L1304",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/v1.21.1/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/v1.21.1/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/v1.21.1/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 Fo({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/v1.21.1/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/v1.21.1/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}}),gt=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:"**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.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to pass to <code>model.generate()</code>, for instance <code>max_new_tokens</code> or <code>device</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/models.py#L738",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 ca({props:{warning:!1,$$slots:{default:[Tl]},$$scope:{ctx:j}}}),be=new Fo({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[Cl]},$$scope:{ctx:j}}}),ft=new S({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),_t=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/v1.21.1/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/v1.21.1/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 pass to the Hugging Face InferenceClient.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/models.py#L1286",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>
`}}),_e=new Fo({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/v1.21.1/src/smolagents/models.py#L1377"}}),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 pass to the OpenAI API.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/models.py#L1049"}}),Ct=new w({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/models.py#L1099"}}),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/v1.21.1/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/v1.21.1/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/v1.21.1/hi/reference/agents#smolagents.FinalAnswerPromptTemplate">FinalAnswerPromptTemplate</a>) &#x2014; Final answer prompt templates.',name:"final_answer"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.1/src/smolagents/agents.py#L169"}}),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/v1.21.1/src/smolagents/agents.py#L128"}}),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/v1.21.1/src/smolagents/agents.py#L143"}}),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/v1.21.1/src/smolagents/agents.py#L156"}}),qt=new Ml({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/hi/reference/agents.md"}}),{c(){m=l("meta"),C=o(),_=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=ba,Dn=o(),d(Je.$$.fragment),Gn=o(),M=l("div"),d(je.$$.fragment),Ro=o(),Bt=l("p"),Bt.textContent=_a,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(),zt=l("p"),zt.textContent=xa,rs=o(),ne=l("div"),d(Pe.$$.fragment),is=o(),Ft=l("p"),Ft.textContent=wa,ms=o(),oe=l("div"),d(Se.$$.fragment),ds=o(),Rt=l("p"),Rt.textContent=Ta,gs=o(),se=l("div"),d(Ve.$$.fragment),cs=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,bs=o(),d(le.$$.fragment),_s=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(),ge=l("div"),d(ze.$$.fragment),Us=o(),ln=l("p"),ln.textContent=Pa,As=o(),ce=l("div"),d(Fe.$$.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(),gn=l("p"),gn.textContent=Za,Vs=o(),pe=l("div"),d(Ye.$$.fragment),Ws=o(),cn=l("p"),cn.textContent=Ea,zn=o(),d(Oe.$$.fragment),Fn=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),zs=o(),bn=l("p"),bn.textContent=Ha,Fs=o(),_n=l("p"),_n.innerHTML=za,Yn=o(),d(st.$$.fragment),On=o(),at=l("p"),at.textContent=Fa,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(gt.$$.fragment),ao=o(),ct=l("p"),ct.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(be.$$.fragment),mo=o(),d(ft.$$.fragment),go=o(),bt=l("p"),bt.innerHTML=nl,co=o(),d(_t.$$.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(_e.$$.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,bo=o(),d(wt.$$.fragment),_o=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=gl,wo=o(),z=l("div"),d(At.$$.fragment),ma=o(),kn=l("p"),kn.textContent=cl,To=o(),F=l("div"),d(Nt.$$.fragment),da=o(),Jn=l("p"),Jn.textContent=pl,Co=o(),R=l("div"),d(Lt.$$.fragment),ga=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),_=r(e,"P",{}),y(_).forEach(n),v=s(e),g(T.$$.fragment,e),f=s(e),g(I.$$.fragment,e),Sn=s(e),xe=r(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-530l0l"&&(xe.innerHTML=pa),Vn=s(e),g(we.$$.fragment,e),Wn=s(e),Te=r(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-1eekz0p"&&(Te.innerHTML=ua),Zn=s(e),Ce=r(e,"P",{"data-svelte-h":!0}),b(Ce)!=="svelte-pwzn35"&&(Ce.innerHTML=ha),En=s(e),Ie=r(e,"UL",{"data-svelte-h":!0}),b(Ie)!=="svelte-3hnt85"&&(Ie.innerHTML=fa),Bn=s(e),ke=r(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-12okbux"&&(ke.innerHTML=ba),Dn=s(e),g(Je.$$.fragment,e),Gn=s(e),M=r(e,"DIV",{class:!0});var $=y(M);g(je.$$.fragment,$),Ro=s($),Bt=r($,"P",{"data-svelte-h":!0}),b(Bt)!=="svelte-d5y990"&&(Bt.textContent=_a),Xo=s($),Y=r($,"DIV",{class:!0});var Pt=y(Y);g(Ue.$$.fragment,Pt),Yo=s(Pt),Dt=r(Pt,"P",{"data-svelte-h":!0}),b(Dt)!=="svelte-104knry"&&(Dt.textContent=va),Pt.forEach(n),Oo=s($),O=r($,"DIV",{class:!0});var St=y(O);g(Ae.$$.fragment,St),Ko=s(St),Gt=r(St,"P",{"data-svelte-h":!0}),b(Gt)!=="svelte-1kbba9r"&&(Gt.textContent=Ma),St.forEach(n),es=s($),K=r($,"DIV",{class:!0});var Vt=y(K);g(Ne.$$.fragment,Vt),ts=s(Vt),Qt=r(Vt,"P",{"data-svelte-h":!0}),b(Qt)!=="svelte-1f5g0y1"&&(Qt.textContent=$a),Vt.forEach(n),ns=s($),W=r($,"DIV",{class:!0});var X=y(W);g(Le.$$.fragment,X),os=s(X),Ht=r(X,"P",{"data-svelte-h":!0}),b(Ht)!=="svelte-px853z"&&(Ht.textContent=ya),ss=s(X),g(ee.$$.fragment,X),X.forEach(n),as=s($),te=r($,"DIV",{class:!0});var Wt=y(te);g(qe.$$.fragment,Wt),ls=s(Wt),zt=r(Wt,"P",{"data-svelte-h":!0}),b(zt)!=="svelte-aqxmk9"&&(zt.textContent=xa),Wt.forEach(n),rs=s($),ne=r($,"DIV",{class:!0});var Zt=y(ne);g(Pe.$$.fragment,Zt),is=s(Zt),Ft=r(Zt,"P",{"data-svelte-h":!0}),b(Ft)!=="svelte-vma7te"&&(Ft.textContent=wa),Zt.forEach(n),ms=s($),oe=r($,"DIV",{class:!0});var jo=y(oe);g(Se.$$.fragment,jo),ds=s(jo),Rt=r(jo,"P",{"data-svelte-h":!0}),b(Rt)!=="svelte-s6zvq5"&&(Rt.textContent=Ta),jo.forEach(n),gs=s($),se=r($,"DIV",{class:!0});var Uo=y(se);g(Ve.$$.fragment,Uo),cs=s(Uo),Xt=r(Uo,"P",{"data-svelte-h":!0}),b(Xt)!=="svelte-3y7cve"&&(Xt.textContent=Ca),Uo.forEach(n),ps=s($),ae=r($,"DIV",{class:!0});var Ao=y(ae);g(We.$$.fragment,Ao),us=s(Ao),Yt=r(Ao,"P",{"data-svelte-h":!0}),b(Yt)!=="svelte-28znqy"&&(Yt.textContent=Ia),Ao.forEach(n),hs=s($),Z=r($,"DIV",{class:!0});var Un=y(Z);g(Ze.$$.fragment,Un),fs=s(Un),Ot=r(Un,"P",{"data-svelte-h":!0}),b(Ot)!=="svelte-1rclfo7"&&(Ot.textContent=ka),bs=s(Un),g(le.$$.fragment,Un),Un.forEach(n),_s=s($),E=r($,"DIV",{class:!0});var An=y(E);g(Ee.$$.fragment,An),vs=s(An),Kt=r(An,"P",{"data-svelte-h":!0}),b(Kt)!=="svelte-1uw6gyw"&&(Kt.innerHTML=Ja),Ms=s(An),en=r(An,"UL",{"data-svelte-h":!0}),b(en)!=="svelte-11tnr4k"&&(en.innerHTML=ja),An.forEach(n),$s=s($),re=r($,"DIV",{class:!0});var No=y(re);g(Be.$$.fragment,No),ys=s(No),tn=r(No,"P",{"data-svelte-h":!0}),b(tn)!=="svelte-1av9fpz"&&(tn.textContent=Ua),No.forEach(n),xs=s($),ie=r($,"DIV",{class:!0});var Lo=y(ie);g(De.$$.fragment,Lo),ws=s(Lo),nn=r(Lo,"P",{"data-svelte-h":!0}),b(nn)!=="svelte-1kyagwa"&&(nn.textContent=Aa),Lo.forEach(n),Ts=s($),me=r($,"DIV",{class:!0});var qo=y(me);g(Ge.$$.fragment,qo),Cs=s(qo),on=r(qo,"P",{"data-svelte-h":!0}),b(on)!=="svelte-em4ik4"&&(on.textContent=Na),qo.forEach(n),Is=s($),de=r($,"DIV",{class:!0});var Po=y(de);g(Qe.$$.fragment,Po),ks=s(Po),sn=r(Po,"P",{"data-svelte-h":!0}),b(sn)!=="svelte-jg60qx"&&(sn.textContent=La),Po.forEach(n),$.forEach(n),Qn=s(e),A=r(e,"DIV",{class:!0});var $e=y(A);g(He.$$.fragment,$e),Js=s($e),an=r($e,"P",{"data-svelte-h":!0}),b(an)!=="svelte-1mxsa12"&&(an.textContent=qa),js=s($e),ge=r($e,"DIV",{class:!0});var So=y(ge);g(ze.$$.fragment,So),Us=s(So),ln=r(So,"P",{"data-svelte-h":!0}),b(ln)!=="svelte-1dq3hsa"&&(ln.textContent=Pa),So.forEach(n),As=s($e),ce=r($e,"DIV",{class:!0});var Vo=y(ce);g(Fe.$$.fragment,Vo),Ns=s(Vo),rn=r(Vo,"P",{"data-svelte-h":!0}),b(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);g(Re.$$.fragment,ye),Ls=s(ye),mn=r(ye,"P",{"data-svelte-h":!0}),b(mn)!=="svelte-71yyi1"&&(mn.innerHTML=Va),qs=s(ye),B=r(ye,"DIV",{class:!0});var Nn=y(B);g(Xe.$$.fragment,Nn),Ps=s(Nn),dn=r(Nn,"P",{"data-svelte-h":!0}),b(dn)!=="svelte-yjyhgb"&&(dn.textContent=Wa),Ss=s(Nn),gn=r(Nn,"P",{"data-svelte-h":!0}),b(gn)!=="svelte-1l33w20"&&(gn.textContent=Za),Nn.forEach(n),Vs=s(ye),pe=r(ye,"DIV",{class:!0});var Wo=y(pe);g(Ye.$$.fragment,Wo),Ws=s(Wo),cn=r(Wo,"P",{"data-svelte-h":!0}),b(cn)!=="svelte-132xt9l"&&(cn.textContent=Ea),Wo.forEach(n),ye.forEach(n),zn=s(e),g(Oe.$$.fragment,e),Fn=s(e),Q=r(e,"DIV",{class:!0});var Zo=y(Q);g(Ke.$$.fragment,Zo),Zs=s(Zo),pn=r(Zo,"P",{"data-svelte-h":!0}),b(pn)!=="svelte-3yyclm"&&(pn.textContent=Ba),Zo.forEach(n),Rn=s(e),g(et.$$.fragment,e),Xn=s(e),k=r(e,"DIV",{class:!0});var L=y(k);g(tt.$$.fragment,L),Es=s(L),un=r(L,"P",{"data-svelte-h":!0}),b(un)!=="svelte-y9r2tn"&&(un.innerHTML=Da),Bs=s(L),hn=r(L,"P",{"data-svelte-h":!0}),b(hn)!=="svelte-jlm60p"&&(hn.innerHTML=Ga),Ds=s(L),g(ue.$$.fragment,L),Gs=s(L),he=r(L,"DIV",{class:!0});var Eo=y(he);g(nt.$$.fragment,Eo),Qs=s(Eo),fn=r(Eo,"P",{"data-svelte-h":!0}),b(fn)!=="svelte-1jjhzc2"&&(fn.textContent=Qa),Eo.forEach(n),Hs=s(L),D=r(L,"DIV",{class:!0});var Ln=y(D);g(ot.$$.fragment,Ln),zs=s(Ln),bn=r(Ln,"P",{"data-svelte-h":!0}),b(bn)!=="svelte-7pw2wo"&&(bn.textContent=Ha),Fs=s(Ln),_n=r(Ln,"P",{"data-svelte-h":!0}),b(_n)!=="svelte-19g2bgi"&&(_n.innerHTML=za),Ln.forEach(n),L.forEach(n),Yn=s(e),g(st.$$.fragment,e),On=s(e),at=r(e,"P",{"data-svelte-h":!0}),b(at)!=="svelte-1hr4phi"&&(at.textContent=Fa),Kn=s(e),lt=r(e,"P",{"data-svelte-h":!0}),b(lt)!=="svelte-13vv5yy"&&(lt.innerHTML=Ra),eo=s(e),rt=r(e,"OL",{"data-svelte-h":!0}),b(rt)!=="svelte-btvrd5"&&(rt.innerHTML=Xa),to=s(e),it=r(e,"P",{"data-svelte-h":!0}),b(it)!=="svelte-m6zjmh"&&(it.innerHTML=Ya),no=s(e),g(mt.$$.fragment,e),oo=s(e),dt=r(e,"P",{"data-svelte-h":!0}),b(dt)!=="svelte-15khdi2"&&(dt.innerHTML=Oa),so=s(e),g(gt.$$.fragment,e),ao=s(e),ct=r(e,"P",{"data-svelte-h":!0}),b(ct)!=="svelte-bqff4p"&&(ct.innerHTML=Ka),lo=s(e),g(pt.$$.fragment,e),ro=s(e),g(ut.$$.fragment,e),io=s(e),U=r(e,"DIV",{class:!0});var G=y(U);g(ht.$$.fragment,G),Rs=s(G),vn=r(G,"P",{"data-svelte-h":!0}),b(vn)!=="svelte-1ex1ahr"&&(vn.textContent=el),Xs=s(G),Mn=r(G,"P",{"data-svelte-h":!0}),b(Mn)!=="svelte-1140acn"&&(Mn.textContent=tl),Ys=s(G),g(fe.$$.fragment,G),Os=s(G),g(be.$$.fragment,G),G.forEach(n),mo=s(e),g(ft.$$.fragment,e),go=s(e),bt=r(e,"P",{"data-svelte-h":!0}),b(bt)!=="svelte-21wzws"&&(bt.innerHTML=nl),co=s(e),g(_t.$$.fragment,e),po=s(e),g(vt.$$.fragment,e),uo=s(e),J=r(e,"DIV",{class:!0});var q=y(J);g(Mt.$$.fragment,q),Ks=s(q),$n=r(q,"P",{"data-svelte-h":!0}),b($n)!=="svelte-axkcn3"&&($n.textContent=ol),ea=s(q),yn=r(q,"P",{"data-svelte-h":!0}),b(yn)!=="svelte-bducrc"&&(yn.textContent=sl),ta=s(q),xn=r(q,"P",{"data-svelte-h":!0}),b(xn)!=="svelte-12eu297"&&(xn.textContent=al),na=s(q),g(_e.$$.fragment,q),oa=s(q),ve=r(q,"DIV",{class:!0});var Bo=y(ve);g($t.$$.fragment,Bo),sa=s(Bo),wn=r(Bo,"P",{"data-svelte-h":!0}),b(wn)!=="svelte-ym2f5u"&&(wn.textContent=ll),Bo.forEach(n),q.forEach(n),ho=s(e),g(yt.$$.fragment,e),fo=s(e),xt=r(e,"P",{"data-svelte-h":!0}),b(xt)!=="svelte-1ufdi39"&&(xt.innerHTML=rl),bo=s(e),g(wt.$$.fragment,e),_o=s(e),P=r(e,"DIV",{class:!0});var qn=y(P);g(Tt.$$.fragment,qn),aa=s(qn),Tn=r(qn,"P",{"data-svelte-h":!0}),b(Tn)!=="svelte-5g97zk"&&(Tn.innerHTML=il),la=s(qn),Me=r(qn,"DIV",{class:!0});var Do=y(Me);g(Ct.$$.fragment,Do),ra=s(Do),Cn=r(Do,"P",{"data-svelte-h":!0}),b(Cn)!=="svelte-12r14rd"&&(Cn.textContent=ml),Do.forEach(n),qn.forEach(n),vo=s(e),g(It.$$.fragment,e),Mo=s(e),kt=r(e,"P",{"data-svelte-h":!0}),b(kt)!=="svelte-15ywemq"&&(kt.innerHTML=dl),$o=s(e),g(Jt.$$.fragment,e),yo=s(e),g(jt.$$.fragment,e),xo=s(e),H=r(e,"DIV",{class:!0});var Go=y(H);g(Ut.$$.fragment,Go),ia=s(Go),In=r(Go,"P",{"data-svelte-h":!0}),b(In)!=="svelte-1qudq9i"&&(In.textContent=gl),Go.forEach(n),wo=s(e),z=r(e,"DIV",{class:!0});var Qo=y(z);g(At.$$.fragment,Qo),ma=s(Qo),kn=r(Qo,"P",{"data-svelte-h":!0}),b(kn)!=="svelte-139nrra"&&(kn.textContent=cl),Qo.forEach(n),To=s(e),F=r(e,"DIV",{class:!0});var Ho=y(F);g(Nt.$$.fragment,Ho),da=s(Ho),Jn=r(Ho,"P",{"data-svelte-h":!0}),b(Jn)!=="svelte-uxob75"&&(Jn.textContent=pl),Ho.forEach(n),Co=s(e),R=r(e,"DIV",{class:!0});var zo=y(R);g(Lt.$$.fragment,zo),ga=s(zo),jn=r(zo,"P",{"data-svelte-h":!0}),b(jn)!=="svelte-52nyxb"&&(jn.textContent=ul),zo.forEach(n),Io=s(e),g(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(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(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(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(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(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(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,_,a),i(e,v,a),c(T,e,a),i(e,f,a),c(I,e,a),i(e,Sn,a),i(e,xe,a),i(e,Vn,a),c(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),c(Je,e,a),i(e,Gn,a),i(e,M,a),c(je,M,null),t(M,Ro),t(M,Bt),t(M,Xo),t(M,Y),c(Ue,Y,null),t(Y,Yo),t(Y,Dt),t(M,Oo),t(M,O),c(Ae,O,null),t(O,Ko),t(O,Gt),t(M,es),t(M,K),c(Ne,K,null),t(K,ts),t(K,Qt),t(M,ns),t(M,W),c(Le,W,null),t(W,os),t(W,Ht),t(W,ss),c(ee,W,null),t(M,as),t(M,te),c(qe,te,null),t(te,ls),t(te,zt),t(M,rs),t(M,ne),c(Pe,ne,null),t(ne,is),t(ne,Ft),t(M,ms),t(M,oe),c(Se,oe,null),t(oe,ds),t(oe,Rt),t(M,gs),t(M,se),c(Ve,se,null),t(se,cs),t(se,Xt),t(M,ps),t(M,ae),c(We,ae,null),t(ae,us),t(ae,Yt),t(M,hs),t(M,Z),c(Ze,Z,null),t(Z,fs),t(Z,Ot),t(Z,bs),c(le,Z,null),t(M,_s),t(M,E),c(Ee,E,null),t(E,vs),t(E,Kt),t(E,Ms),t(E,en),t(M,$s),t(M,re),c(Be,re,null),t(re,ys),t(re,tn),t(M,xs),t(M,ie),c(De,ie,null),t(ie,ws),t(ie,nn),t(M,Ts),t(M,me),c(Ge,me,null),t(me,Cs),t(me,on),t(M,Is),t(M,de),c(Qe,de,null),t(de,ks),t(de,sn),i(e,Qn,a),i(e,A,a),c(He,A,null),t(A,Js),t(A,an),t(A,js),t(A,ge),c(ze,ge,null),t(ge,Us),t(ge,ln),t(A,As),t(A,ce),c(Fe,ce,null),t(ce,Ns),t(ce,rn),i(e,Hn,a),i(e,N,a),c(Re,N,null),t(N,Ls),t(N,mn),t(N,qs),t(N,B),c(Xe,B,null),t(B,Ps),t(B,dn),t(B,Ss),t(B,gn),t(N,Vs),t(N,pe),c(Ye,pe,null),t(pe,Ws),t(pe,cn),i(e,zn,a),c(Oe,e,a),i(e,Fn,a),i(e,Q,a),c(Ke,Q,null),t(Q,Zs),t(Q,pn),i(e,Rn,a),c(et,e,a),i(e,Xn,a),i(e,k,a),c(tt,k,null),t(k,Es),t(k,un),t(k,Bs),t(k,hn),t(k,Ds),c(ue,k,null),t(k,Gs),t(k,he),c(nt,he,null),t(he,Qs),t(he,fn),t(k,Hs),t(k,D),c(ot,D,null),t(D,zs),t(D,bn),t(D,Fs),t(D,_n),i(e,Yn,a),c(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),c(mt,e,a),i(e,oo,a),i(e,dt,a),i(e,so,a),c(gt,e,a),i(e,ao,a),i(e,ct,a),i(e,lo,a),c(pt,e,a),i(e,ro,a),c(ut,e,a),i(e,io,a),i(e,U,a),c(ht,U,null),t(U,Rs),t(U,vn),t(U,Xs),t(U,Mn),t(U,Ys),c(fe,U,null),t(U,Os),c(be,U,null),i(e,mo,a),c(ft,e,a),i(e,go,a),i(e,bt,a),i(e,co,a),c(_t,e,a),i(e,po,a),c(vt,e,a),i(e,uo,a),i(e,J,a),c(Mt,J,null),t(J,Ks),t(J,$n),t(J,ea),t(J,yn),t(J,ta),t(J,xn),t(J,na),c(_e,J,null),t(J,oa),t(J,ve),c($t,ve,null),t(ve,sa),t(ve,wn),i(e,ho,a),c(yt,e,a),i(e,fo,a),i(e,xt,a),i(e,bo,a),c(wt,e,a),i(e,_o,a),i(e,P,a),c(Tt,P,null),t(P,aa),t(P,Tn),t(P,la),t(P,Me),c(Ct,Me,null),t(Me,ra),t(Me,Cn),i(e,vo,a),c(It,e,a),i(e,Mo,a),i(e,kt,a),i(e,$o,a),c(Jt,e,a),i(e,yo,a),c(jt,e,a),i(e,xo,a),i(e,H,a),c(Ut,H,null),t(H,ia),t(H,In),i(e,wo,a),i(e,z,a),c(At,z,null),t(z,ma),t(z,kn),i(e,To,a),i(e,F,a),c(Nt,F,null),t(F,da),t(F,Jn),i(e,Co,a),i(e,R,a),c(Lt,R,null),t(R,ga),t(R,jn),i(e,Io,a),c(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}),be.$set(Wt);const Zt={};a&2&&(Zt.$$scope={dirty:a,ctx:e}),_e.$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(ze.$$.fragment,e),p(Fe.$$.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(gt.$$.fragment,e),p(pt.$$.fragment,e),p(ut.$$.fragment,e),p(ht.$$.fragment,e),p(fe.$$.fragment,e),p(be.$$.fragment,e),p(ft.$$.fragment,e),p(_t.$$.fragment,e),p(vt.$$.fragment,e),p(Mt.$$.fragment,e),p(_e.$$.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(ze.$$.fragment,e),u(Fe.$$.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(gt.$$.fragment,e),u(pt.$$.fragment,e),u(ut.$$.fragment,e),u(ht.$$.fragment,e),u(fe.$$.fragment,e),u(be.$$.fragment,e),u(ft.$$.fragment,e),u(_t.$$.fragment,e),u(vt.$$.fragment,e),u(Mt.$$.fragment,e),u(_e.$$.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(_),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(zn),n(Fn),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(ct),n(lo),n(ro),n(io),n(U),n(mo),n(go),n(bt),n(co),n(po),n(uo),n(J),n(ho),n(fo),n(xt),n(bo),n(_o),n(P),n(vo),n(Mo),n(kt),n($o),n(yo),n(xo),n(H),n(wo),n(z),n(To),n(F),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(ze),h(Fe),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(gt,e),h(pt,e),h(ut,e),h(ht),h(fe),h(be),h(ft,e),h(_t,e),h(vt,e),h(Mt),h(_e),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 bl{constructor(m){super(),_l(this,m,jl,kl,hl,{})}}export{Sl as component};
