import{s as Zs,o as Rs,n as D}from"../chunks/scheduler.f9cad8c1.js";import{S as $s,i as As,e as U,s,c,q as hs,h as Ns,a,d as e,b as T,f as L,g as r,j as i,r as Bs,k as Ce,l as A,m as t,n as I,t as g,o as C,p as b}from"../chunks/index.6e06ef99.js";import{C as Ws,H as _,E as Qs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c4302a62.js";import{C as F}from"../chunks/CodeBlock.72594161.js";import{D as Fs}from"../chunks/DocNotebookDropdown.77f2c2c1.js";import{H as Vs,a as z}from"../chunks/HfOption.e4f513ba.js";function vs(v){let J,k="추론 제공자는 인증을 위해 <code>HF_TOKEN</code>이 필요하지만, 무료 HF 계정에는 이미 포함된 크레딧이 제공됩니다. PRO로 업그레이드하여 포함된 크레딧을 늘리세요.",o,m,y='제한된 모델에 접근하거나 PRO 계정으로 속도 제한을 높이려면 환경 변수 <code>HF_TOKEN</code>을 설정하거나 <code>InferenceClientModel</code> 초기화 시 <code>token</code> 변수를 전달해야 합니다. <a href="https://huggingface.co/settings/tokens" rel="nofollow">설정 페이지</a>에서 토큰을 얻을 수 있습니다.',p,j,Z;return j=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMy03MEItSW5zdHJ1Y3QlMjIlMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKG1vZGVsX2lkJTNEbW9kZWxfaWQlMkMlMjB0b2tlbiUzRCUyMiUzQ1lPVVJfSFVHR0lOR0ZBQ0VIVUJfQVBJX1RPS0VOJTNFJTIyKSUyMCUyMyUyMFlvdSUyMGNhbiUyMGNob29zZSUyMHRvJTIwbm90JTIwcGFzcyUyMGFueSUyMG1vZGVsX2lkJTIwdG8lMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUyMHRvJTIwdXNlJTIwYSUyMGRlZmF1bHQlMjBtb2RlbCUwQSUyMyUyMHlvdSUyMGNhbiUyMGFsc28lMjBzcGVjaWZ5JTIwYSUyMHBhcnRpY3VsYXIlMjBwcm92aWRlciUyMGUuZy4lMjBwcm92aWRlciUzRCUyMnRvZ2V0aGVyJTIyJTIwb3IlMjBwcm92aWRlciUzRCUyMnNhbWJhbm92YSUyMiUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCJTVEJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ291bGQlMjB5b3UlMjBnaXZlJTIwbWUlMjB0aGUlMjAxMTh0aCUyMG51bWJlciUyMGluJTIwdGhlJTIwRmlib25hY2NpJTIwc2VxdWVuY2UlM0YlMjIlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

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

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

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){J=U("p"),J.innerHTML=k,o=s(),m=U("p"),m.innerHTML=y,p=s(),c(j.$$.fragment)},l(w){J=a(w,"P",{"data-svelte-h":!0}),i(J)!=="svelte-2i29sm"&&(J.innerHTML=k),o=T(w),m=a(w,"P",{"data-svelte-h":!0}),i(m)!=="svelte-1750ji2"&&(m.innerHTML=y),p=T(w),r(j.$$.fragment,w)},m(w,Q){t(w,J,Q),t(w,o,Q),t(w,m,Q),t(w,p,Q),I(j,w,Q),Z=!0},p:D,i(w){Z||(g(j.$$.fragment,w),Z=!0)},o(w){C(j.$$.fragment,w),Z=!1},d(w){w&&(e(J),e(o),e(m),e(p)),b(j,w)}}}function Gs(v){let J,k;return J=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCdHJhbnNmb3JtZXJzJTVEJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBUcmFuc2Zvcm1lcnNNb2RlbCUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMi0zQi1JbnN0cnVjdCUyMiUwQSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwobW9kZWxfaWQlM0Rtb2RlbF9pZCklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># !pip install smolagents[transformers]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, TransformersModel

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

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

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){c(J.$$.fragment)},l(o){r(J.$$.fragment,o)},m(o,m){I(J,o,m),k=!0},p:D,i(o){k||(g(J.$$.fragment,o),k=!0)},o(o){C(J.$$.fragment,o),k=!1},d(o){b(J,o)}}}function Es(v){let J,k="<code>LiteLLMModel</code>을 사용하려면 환경 변수 <code>ANTHROPIC_API_KEY</code> 또는 <code>OPENAI_API_KEY</code>를 설정하거나 초기화 시 <code>api_key</code> 변수를 전달해야 합니다.",o,m,y;return m=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCbGl0ZWxsbSU1RCUwQWZyb20lMjBzbW9sYWdlbnRzJTIwaW1wb3J0JTIwQ29kZUFnZW50JTJDJTIwTGl0ZUxMTU1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNTW9kZWwobW9kZWxfaWQlM0QlMjJhbnRocm9waWMlMkZjbGF1ZGUtMy01LXNvbm5ldC1sYXRlc3QlMjIlMkMlMjBhcGlfa2V5JTNEJTIyWU9VUl9BTlRIUk9QSUNfQVBJX0tFWSUyMiklMjAlMjMlMjBDb3VsZCUyMHVzZSUyMCdncHQtNG8nJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlKSUwQSUwQWFnZW50LnJ1biglMEElMjAlMjAlMjAlMjAlMjJDb3VsZCUyMHlvdSUyMGdpdmUlMjBtZSUyMHRoZSUyMDExOHRoJTIwbnVtYmVyJTIwaW4lMjB0aGUlMjBGaWJvbmFjY2klMjBzZXF1ZW5jZSUzRiUyMiUyQyUwQSk=",highlighted:`<span class="hljs-comment"># !pip install smolagents[litellm]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, LiteLLMModel

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

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){J=U("p"),J.innerHTML=k,o=s(),c(m.$$.fragment)},l(p){J=a(p,"P",{"data-svelte-h":!0}),i(J)!=="svelte-gp11mo"&&(J.innerHTML=k),o=T(p),r(m.$$.fragment,p)},m(p,j){t(p,J,j),t(p,o,j),I(m,p,j),y=!0},p:D,i(p){y||(g(m.$$.fragment,p),y=!0)},o(p){C(m.$$.fragment,p),y=!1},d(p){p&&(e(J),e(o)),b(m,p)}}}function _s(v){let J,k;return J=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCbGl0ZWxsbSU1RCUwQWZyb20lMjBzbW9sYWdlbnRzJTIwaW1wb3J0JTIwQ29kZUFnZW50JTJDJTIwTGl0ZUxMTU1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJvbGxhbWFfY2hhdCUyRmxsYW1hMy4yJTIyJTJDJTIwJTIzJTIwVGhpcyUyMG1vZGVsJTIwaXMlMjBhJTIwYml0JTIwd2VhayUyMGZvciUyMGFnZW50aWMlMjBiZWhhdmlvdXJzJTIwdGhvdWdoJTBBJTIwJTIwJTIwJTIwYXBpX2Jhc2UlM0QlMjJodHRwJTNBJTJGJTJGbG9jYWxob3N0JTNBMTE0MzQlMjIlMkMlMjAlMjMlMjByZXBsYWNlJTIwd2l0aCUyMDEyNy4wLjAuMSUzQTExNDM0JTIwb3IlMjByZW1vdGUlMjBvcGVuLWFpJTIwY29tcGF0aWJsZSUyMHNlcnZlciUyMGlmJTIwbmVjZXNzYXJ5JTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRCUyMllPVVJfQVBJX0tFWSUyMiUyQyUyMCUyMyUyMHJlcGxhY2UlMjB3aXRoJTIwQVBJJTIwa2V5JTIwaWYlMjBuZWNlc3NhcnklMEElMjAlMjAlMjAlMjBudW1fY3R4JTNEODE5MiUyQyUyMCUyMyUyMG9sbGFtYSUyMGRlZmF1bHQlMjBpcyUyMDIwNDglMjB3aGljaCUyMHdpbGwlMjBmYWlsJTIwaG9ycmlibHkuJTIwODE5MiUyMHdvcmtzJTIwZm9yJTIwZWFzeSUyMHRhc2tzJTJDJTIwbW9yZSUyMGlzJTIwYmV0dGVyLiUyMENoZWNrJTIwaHR0cHMlM0ElMkYlMkZodWdnaW5nZmFjZS5jbyUyRnNwYWNlcyUyRk55eEtyYWdlJTJGTExNLU1vZGVsLVZSQU0tQ2FsY3VsYXRvciUyMHRvJTIwY2FsY3VsYXRlJTIwaG93JTIwbXVjaCUyMFZSQU0lMjB0aGlzJTIwd2lsbCUyMG5lZWQlMjBmb3IlMjB0aGUlMjBzZWxlY3RlZCUyMG1vZGVsLiUwQSklMEElMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># !pip install smolagents[litellm]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, LiteLLMModel

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

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

agent.run(
    <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){c(J.$$.fragment)},l(o){r(J.$$.fragment,o)},m(o,m){I(J,o,m),k=!0},p:D,i(o){k||(g(J.$$.fragment,o),k=!0)},o(o){C(J.$$.fragment,o),k=!1},d(o){b(J,o)}}}function xs(v){let J,k="Azure OpenAI에 연결하려면 <code>AzureOpenAIModel</code>을 직접 사용하거나 <code>LiteLLMModel</code>을 사용하여 적절히 구성할 수 있습니다.",o,m,y="<code>AzureOpenAIModel</code>의 인스턴스를 초기화하려면 모델 배포 이름을 전달한 다음 <code>azure_endpoint</code>, <code>api_key</code>, <code>api_version</code> 인수를 전달하거나 환경 변수 <code>AZURE_OPENAI_ENDPOINT</code>, <code>AZURE_OPENAI_API_KEY</code>, <code>OPENAI_API_VERSION</code>을 설정해야 합니다.",p,j,Z,w,Q="마찬가지로 다음과 같이 <code>LiteLLMModel</code>을 구성하여 Azure OpenAI에 연결할 수 있습니다:",R,V,N="<li>모델 배포 이름을 <code>model_id</code>로 전달하고, 앞에 <code>azure/</code>를 붙여야 합니다.</li> <li>환경 변수 <code>AZURE_API_VERSION</code>을 설정해야 합니다.</li> <li><code>api_base</code>와 <code>api_key</code> 인수를 전달하거나 환경 변수 <code>AZURE_API_KEY</code>, <code>AZURE_API_BASE</code>를 설정합니다.</li>",d,M,B;return j=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCb3BlbmFpJTVEJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBBenVyZU9wZW5BSU1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBenVyZU9wZW5BSU1vZGVsKG1vZGVsX2lkJTNEJTIyZ3B0LTRvLW1pbmklMjIpJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkX2Jhc2VfdG9vbHMlM0RUcnVlKSUwQSUwQWFnZW50LnJ1biglMEElMjAlMjAlMjAlMjAlMjJDb3VsZCUyMHlvdSUyMGdpdmUlMjBtZSUyMHRoZSUyMDExOHRoJTIwbnVtYmVyJTIwaW4lMjB0aGUlMjBGaWJvbmFjY2klMjBzZXF1ZW5jZSUzRiUyMiUyQyUwQSk=",highlighted:`<span class="hljs-comment"># !pip install smolagents[openai]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, AzureOpenAIModel

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

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

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

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

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

agent.run(
   <span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>,
)`,wrap:!1}}),{c(){J=U("p"),J.innerHTML=k,o=s(),m=U("p"),m.innerHTML=y,p=s(),c(j.$$.fragment),Z=s(),w=U("p"),w.innerHTML=Q,R=s(),V=U("ul"),V.innerHTML=N,d=s(),c(M.$$.fragment)},l(f){J=a(f,"P",{"data-svelte-h":!0}),i(J)!=="svelte-1e81f26"&&(J.innerHTML=k),o=T(f),m=a(f,"P",{"data-svelte-h":!0}),i(m)!=="svelte-2wxrqv"&&(m.innerHTML=y),p=T(f),r(j.$$.fragment,f),Z=T(f),w=a(f,"P",{"data-svelte-h":!0}),i(w)!=="svelte-mtttrv"&&(w.innerHTML=Q),R=T(f),V=a(f,"UL",{"data-svelte-h":!0}),i(V)!=="svelte-mt7ev2"&&(V.innerHTML=N),d=T(f),r(M.$$.fragment,f)},m(f,$){t(f,J,$),t(f,o,$),t(f,m,$),t(f,p,$),I(j,f,$),t(f,Z,$),t(f,w,$),t(f,R,$),t(f,V,$),t(f,d,$),I(M,f,$),B=!0},p:D,i(f){B||(g(j.$$.fragment,f),g(M.$$.fragment,f),B=!0)},o(f){C(j.$$.fragment,f),C(M.$$.fragment,f),B=!1},d(f){f&&(e(J),e(o),e(m),e(p),e(Z),e(w),e(R),e(V),e(d)),b(j,f),b(M,f)}}}function Os(v){let J,k="<code>AmazonBedrockModel</code> 클래스는 Amazon Bedrock과 직접 연동되어 API 호출과 세부 구성을 지원합니다.",o,m,y="기본 사용법:",p,j,Z,w,Q="고급 구성:",R,V,N,d,M="LiteLLMModel 사용:",B,f,$="또는 Bedrock 모델과 함께 <code>LiteLLMModel</code>을 사용할 수 있습니다:",E,u,W;return j=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCYXdzX3NkayU1RCUwQWZyb20lMjBzbW9sYWdlbnRzJTIwaW1wb3J0JTIwQ29kZUFnZW50JTJDJTIwQW1hem9uQmVkcm9ja01vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrTW9kZWwobW9kZWxfaWQlM0QlMjJhbnRocm9waWMuY2xhdWRlLTMtc29ubmV0LTIwMjQwMjI5LXYxJTNBMCUyMiklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QiU1RCUyQyUyMG1vZGVsJTNEbW9kZWwlMkMlMjBhZGRfYmFzZV90b29scyUzRFRydWUpJTBBJTBBYWdlbnQucnVuKCUwQSUyMCUyMCUyMCUyMCUyMkNvdWxkJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwMTE4dGglMjBudW1iZXIlMjBpbiUyMHRoZSUyMEZpYm9uYWNjaSUyMHNlcXVlbmNlJTNGJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-comment"># !pip install smolagents[aws_sdk]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, AmazonBedrockModel

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

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

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

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

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

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

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

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

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

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

agent.run(<span class="hljs-string">&quot;Could you give me the 118th number in the Fibonacci sequence?&quot;</span>)`,wrap:!1}}),{c(){c(J.$$.fragment)},l(o){r(J.$$.fragment,o)},m(o,m){I(J,o,m),k=!0},p:D,i(o){k||(g(J.$$.fragment,o),k=!0)},o(o){C(J.$$.fragment,o),k=!1},d(o){b(J,o)}}}function Hs(v){let J,k,o,m,y,p,j,Z,w,Q,R,V,N,d;return J=new z({props:{id:"Pick a LLM",option:"Inference Providers",$$slots:{default:[vs]},$$scope:{ctx:v}}}),o=new z({props:{id:"Pick a LLM",option:"Local Transformers Model",$$slots:{default:[Gs]},$$scope:{ctx:v}}}),y=new z({props:{id:"Pick a LLM",option:"OpenAI or Anthropic API",$$slots:{default:[Es]},$$scope:{ctx:v}}}),j=new z({props:{id:"Pick a LLM",option:"Ollama",$$slots:{default:[_s]},$$scope:{ctx:v}}}),w=new z({props:{id:"Pick a LLM",option:"Azure OpenAI",$$slots:{default:[xs]},$$scope:{ctx:v}}}),R=new z({props:{id:"Pick a LLM",option:"Amazon Bedrock",$$slots:{default:[Os]},$$scope:{ctx:v}}}),N=new z({props:{id:"Pick a LLM",option:"mlx-lm",$$slots:{default:[Ss]},$$scope:{ctx:v}}}),{c(){c(J.$$.fragment),k=s(),c(o.$$.fragment),m=s(),c(y.$$.fragment),p=s(),c(j.$$.fragment),Z=s(),c(w.$$.fragment),Q=s(),c(R.$$.fragment),V=s(),c(N.$$.fragment)},l(M){r(J.$$.fragment,M),k=T(M),r(o.$$.fragment,M),m=T(M),r(y.$$.fragment,M),p=T(M),r(j.$$.fragment,M),Z=T(M),r(w.$$.fragment,M),Q=T(M),r(R.$$.fragment,M),V=T(M),r(N.$$.fragment,M)},m(M,B){I(J,M,B),t(M,k,B),I(o,M,B),t(M,m,B),I(y,M,B),t(M,p,B),I(j,M,B),t(M,Z,B),I(w,M,B),t(M,Q,B),I(R,M,B),t(M,V,B),I(N,M,B),d=!0},p(M,B){const f={};B&2&&(f.$$scope={dirty:B,ctx:M}),J.$set(f);const $={};B&2&&($.$$scope={dirty:B,ctx:M}),o.$set($);const E={};B&2&&(E.$$scope={dirty:B,ctx:M}),y.$set(E);const u={};B&2&&(u.$$scope={dirty:B,ctx:M}),j.$set(u);const W={};B&2&&(W.$$scope={dirty:B,ctx:M}),w.$set(W);const h={};B&2&&(h.$$scope={dirty:B,ctx:M}),R.$set(h);const G={};B&2&&(G.$$scope={dirty:B,ctx:M}),N.$set(G)},i(M){d||(g(J.$$.fragment,M),g(o.$$.fragment,M),g(y.$$.fragment,M),g(j.$$.fragment,M),g(w.$$.fragment,M),g(R.$$.fragment,M),g(N.$$.fragment,M),d=!0)},o(M){C(J.$$.fragment,M),C(o.$$.fragment,M),C(y.$$.fragment,M),C(j.$$.fragment,M),C(w.$$.fragment,M),C(R.$$.fragment,M),C(N.$$.fragment,M),d=!1},d(M){M&&(e(k),e(m),e(p),e(Z),e(Q),e(V)),b(J,M),b(o,M),b(y,M),b(j,M),b(w,M),b(R,M),b(N,M)}}}function Ls(v){let J,k,o,m="함수에는 다음이 필요합니다:",y,p,j="<li>명확한 이름. 이름은 에이전트를 구동하는 LLM이 이해할 수 있도록 이 도구가 무엇을 하는지 충분히 설명적이어야 합니다. 이 도구는 작업에 대해 가장 많이 다운로드된 모델을 반환하므로 <code>model_download_tool</code>이라고 명명하겠습니다.</li> <li>입력과 출력 모두에 대한 타입 힌트</li> <li>각 인수가 설명되는 ‘Args:’ 부분을 포함하는 설명(이번에는 타입 표시 없이, 타입 힌트에서 가져옵니다). 도구 이름과 마찬가지로, 이 설명은 에이전트를 구동하는 LLM을 위한 설명서이므로 소홀히 하지 마세요.</li>",Z,w,Q="이 모든 요소는 초기화 시 에이전트의 시스템 프롬프트에 자동으로 포함됩니다: 따라서 최대한 명확하게 만들도록 노력하세요!",R,V,N='<p>이 정의 형식은 <code>apply_chat_template</code>에서 사용되는 도구 스키마와 동일하며, 유일한 차이점은 추가된 <code>tool</code> 데코레이터입니다: 도구 사용 API에 대해 더 자세히 알아보려면 <a href="https://huggingface.co/blog/unified-tool-use#passing-tools-to-a-chat-template" rel="nofollow">여기</a>를 읽어보세요.</p>',d,M,B="그런 다음 에이전트를 직접 초기화할 수 있습니다:",f,$,E;return J=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjB0b29sJTBBJTBBJTQwdG9vbCUwQWRlZiUyMG1vZGVsX2Rvd25sb2FkX3Rvb2wodGFzayUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwJTIwJTIwVGhpcyUyMGlzJTIwYSUyMHRvb2wlMjB0aGF0JTIwcmV0dXJucyUyMHRoZSUyMG1vc3QlMjBkb3dubG9hZGVkJTIwbW9kZWwlMjBvZiUyMGElMjBnaXZlbiUyMHRhc2slMjBvbiUyMHRoZSUyMEh1Z2dpbmclMjBGYWNlJTIwSHViLiUwQSUyMCUyMCUyMCUyMEl0JTIwcmV0dXJucyUyMHRoZSUyMG5hbWUlMjBvZiUyMHRoZSUyMGNoZWNrcG9pbnQuJTBBJTBBJTIwJTIwJTIwJTIwQXJncyUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHRhc2slM0ElMjBUaGUlMjB0YXNrJTIwZm9yJTIwd2hpY2glMjB0byUyMGdldCUyMHRoZSUyMGRvd25sb2FkJTIwY291bnQuJTBBJTIwJTIwJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwJTIwJTIwbW9zdF9kb3dubG9hZGVkX21vZGVsJTIwJTNEJTIwbmV4dChpdGVyKGxpc3RfbW9kZWxzKGZpbHRlciUzRHRhc2slMkMlMjBzb3J0JTNEJTIyZG93bmxvYWRzJTIyJTJDJTIwZGlyZWN0aW9uJTNELTEpKSklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBtb3N0X2Rvd25sb2FkZWRfbW9kZWwuaWQ=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> tool

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

    Args:
        task: The task for which to get the download count.
    &quot;&quot;&quot;</span>
    most_downloaded_model = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(list_models(<span class="hljs-built_in">filter</span>=task, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>)))
    <span class="hljs-keyword">return</span> most_downloaded_model.<span class="hljs-built_in">id</span>`,wrap:!1}}),$=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCbW9kZWxfZG93bmxvYWRfdG9vbCU1RCUyQyUyMG1vZGVsJTNESW5mZXJlbmNlQ2xpZW50TW9kZWwoKSklMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ2FuJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwbW9kZWwlMjB0aGF0JTIwaGFzJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkcyUyMGluJTIwdGhlJTIwJ3RleHQtdG8tdmlkZW8nJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlM0YlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel
agent = CodeAgent(tools=[model_download_tool], model=InferenceClientModel())
agent.run(
    <span class="hljs-string">&quot;Can you give me the name of the model that has the most downloads in the &#x27;text-to-video&#x27; task on the Hugging Face Hub?&quot;</span>
)`,wrap:!1}}),{c(){c(J.$$.fragment),k=s(),o=U("p"),o.textContent=m,y=s(),p=U("ul"),p.innerHTML=j,Z=s(),w=U("p"),w.textContent=Q,R=s(),V=U("blockquote"),V.innerHTML=N,d=s(),M=U("p"),M.textContent=B,f=s(),c($.$$.fragment),this.h()},l(u){r(J.$$.fragment,u),k=T(u),o=a(u,"P",{"data-svelte-h":!0}),i(o)!=="svelte-p8y8sb"&&(o.textContent=m),y=T(u),p=a(u,"UL",{"data-svelte-h":!0}),i(p)!=="svelte-1b9cebw"&&(p.innerHTML=j),Z=T(u),w=a(u,"P",{"data-svelte-h":!0}),i(w)!=="svelte-18wyxrd"&&(w.textContent=Q),R=T(u),V=a(u,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),i(V)!=="svelte-1hyy8mg"&&(V.innerHTML=N),d=T(u),M=a(u,"P",{"data-svelte-h":!0}),i(M)!=="svelte-1fsfnk9"&&(M.textContent=B),f=T(u),r($.$$.fragment,u),this.h()},h(){Ce(V,"class","tip")},m(u,W){I(J,u,W),t(u,k,W),t(u,o,W),t(u,y,W),t(u,p,W),t(u,Z,W),t(u,w,W),t(u,R,W),t(u,V,W),t(u,d,W),t(u,M,W),t(u,f,W),I($,u,W),E=!0},p:D,i(u){E||(g(J.$$.fragment,u),g($.$$.fragment,u),E=!0)},o(u){C(J.$$.fragment,u),C($.$$.fragment,u),E=!1},d(u){u&&(e(k),e(o),e(y),e(p),e(Z),e(w),e(R),e(V),e(d),e(M),e(f)),b(J,u),b($,u)}}}function zs(v){let J,k,o,m="하위 클래스에는 다음 속성이 필요합니다:",y,p,j=`<li>명확한 <code>name</code> (이름). 에이전트를 구동하는 LLM이 도구의 기능을 이해할 수 있도록 이름에 대해 충분히 설명해야 합니다. 이 도구는 작업에 대해 가장 많이 다운로드된 모델을 반환하므로 <code>model_download_tool</code>이라고 명명하겠습니다.</li> <li><code>description</code>. <code>name</code>과 마찬가지로, 이 설명은 에이전트를 구동하는 LLM을 위한 설명서이므로 소홀히 하지 마세요.</li> <li>입력 타입과 설명</li> <li>출력 타입
이 모든 속성은 초기화 시 에이전트의 시스템 프롬프트에 자동으로 포함됩니다: 따라서 최대한 명확하게 만들도록 노력하세요!</li>`,Z,w,Q="그런 다음 에이전트를 직접 초기화할 수 있습니다:",R,V,N;return J=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sJTBBJTBBY2xhc3MlMjBNb2RlbERvd25sb2FkVG9vbChUb29sKSUzQSUwQSUyMCUyMCUyMCUyMG5hbWUlMjAlM0QlMjAlMjJtb2RlbF9kb3dubG9hZF90b29sJTIyJTBBJTIwJTIwJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJUaGlzJTIwaXMlMjBhJTIwdG9vbCUyMHRoYXQlMjByZXR1cm5zJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkZWQlMjBtb2RlbCUyMG9mJTIwYSUyMGdpdmVuJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIuJTIwSXQlMjByZXR1cm5zJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwY2hlY2twb2ludC4lMjIlMEElMjAlMjAlMjAlMjBpbnB1dHMlMjAlM0QlMjAlN0IlMjJ0YXNrJTIyJTNBJTIwJTdCJTIydHlwZSUyMiUzQSUyMCUyMnN0cmluZyUyMiUyQyUyMCUyMmRlc2NyaXB0aW9uJTIyJTNBJTIwJTIyVGhlJTIwdGFzayUyMGZvciUyMHdoaWNoJTIwdG8lMjBnZXQlMjB0aGUlMjBkb3dubG9hZCUyMGNvdW50LiUyMiU3RCU3RCUwQSUyMCUyMCUyMCUyMG91dHB1dF90eXBlJTIwJTNEJTIwJTIyc3RyaW5nJTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIwdGFzayUzQSUyMHN0ciklMjAtJTNFJTIwc3RyJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbW9zdF9kb3dubG9hZGVkX21vZGVsJTIwJTNEJTIwbmV4dChpdGVyKGxpc3RfbW9kZWxzKGZpbHRlciUzRHRhc2slMkMlMjBzb3J0JTNEJTIyZG93bmxvYWRzJTIyJTJDJTIwZGlyZWN0aW9uJTNELTEpKSklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBtb3N0X2Rvd25sb2FkZWRfbW9kZWwuaWQ=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Tool

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

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, task: <span class="hljs-built_in">str</span></span>) -&gt; <span class="hljs-built_in">str</span>:
        most_downloaded_model = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(list_models(<span class="hljs-built_in">filter</span>=task, sort=<span class="hljs-string">&quot;downloads&quot;</span>, direction=-<span class="hljs-number">1</span>)))
        <span class="hljs-keyword">return</span> most_downloaded_model.<span class="hljs-built_in">id</span>`,wrap:!1}}),V=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KHRvb2xzJTNEJTVCTW9kZWxEb3dubG9hZFRvb2woKSU1RCUyQyUyMG1vZGVsJTNESW5mZXJlbmNlQ2xpZW50TW9kZWwoKSklMEFhZ2VudC5ydW4oJTBBJTIwJTIwJTIwJTIwJTIyQ2FuJTIweW91JTIwZ2l2ZSUyMG1lJTIwdGhlJTIwbmFtZSUyMG9mJTIwdGhlJTIwbW9kZWwlMjB0aGF0JTIwaGFzJTIwdGhlJTIwbW9zdCUyMGRvd25sb2FkcyUyMGluJTIwdGhlJTIwJ3RleHQtdG8tdmlkZW8nJTIwdGFzayUyMG9uJTIwdGhlJTIwSHVnZ2luZyUyMEZhY2UlMjBIdWIlM0YlMjIlMEEp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel
agent = CodeAgent(tools=[ModelDownloadTool()], model=InferenceClientModel())
agent.run(
    <span class="hljs-string">&quot;Can you give me the name of the model that has the most downloads in the &#x27;text-to-video&#x27; task on the Hugging Face Hub?&quot;</span>
)`,wrap:!1}}),{c(){c(J.$$.fragment),k=s(),o=U("p"),o.textContent=m,y=s(),p=U("ul"),p.innerHTML=j,Z=s(),w=U("p"),w.textContent=Q,R=s(),c(V.$$.fragment)},l(d){r(J.$$.fragment,d),k=T(d),o=a(d,"P",{"data-svelte-h":!0}),i(o)!=="svelte-1kj00kf"&&(o.textContent=m),y=T(d),p=a(d,"UL",{"data-svelte-h":!0}),i(p)!=="svelte-1sr3obe"&&(p.innerHTML=j),Z=T(d),w=a(d,"P",{"data-svelte-h":!0}),i(w)!=="svelte-1fsfnk9"&&(w.textContent=Q),R=T(d),r(V.$$.fragment,d)},m(d,M){I(J,d,M),t(d,k,M),t(d,o,M),t(d,y,M),t(d,p,M),t(d,Z,M),t(d,w,M),t(d,R,M),I(V,d,M),N=!0},p:D,i(d){N||(g(J.$$.fragment,d),g(V.$$.fragment,d),N=!0)},o(d){C(J.$$.fragment,d),C(V.$$.fragment,d),N=!1},d(d){d&&(e(k),e(o),e(y),e(p),e(Z),e(w),e(R)),b(J,d),b(V,d)}}}function Ds(v){let J,k,o,m;return J=new z({props:{id:"build-a-tool",option:"Decorate a function with @tool",$$slots:{default:[Ls]},$$scope:{ctx:v}}}),o=new z({props:{id:"build-a-tool",option:"Subclass Tool",$$slots:{default:[zs]},$$scope:{ctx:v}}}),{c(){c(J.$$.fragment),k=s(),c(o.$$.fragment)},l(y){r(J.$$.fragment,y),k=T(y),r(o.$$.fragment,y)},m(y,p){I(J,y,p),t(y,k,p),I(o,y,p),m=!0},p(y,p){const j={};p&2&&(j.$$scope={dirty:p,ctx:y}),J.$set(j);const Z={};p&2&&(Z.$$scope={dirty:p,ctx:y}),o.$set(Z)},i(y){m||(g(J.$$.fragment,y),g(o.$$.fragment,y),m=!0)},o(y){C(J.$$.fragment,y),C(o.$$.fragment,y),m=!1},d(y){y&&e(k),b(J,y),b(o,y)}}}function Ys(v){let J,k,o,m,y,p,j,Z,w,Q,R,V="이 안내서에서는 에이전트를 구축하는 방법, 실행하는 방법, 그리고 사용 사례에 맞게 더 잘 작동하도록 맞춤 설정하는 방법을 학습합니다.",N,d,M,B,f=`<code>smolagents</code>는 <a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>와 <a href="/docs/smolagents/main/ko/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a> 두 가지 에이전트 클래스를 제공하는데, 이 두 클래스는 각각 에이전트가 도구와 상호작용하는 방법이 다릅니다.
두 방식의 핵심 차이점은 ‘액션을 지정하고 실행’하는 방식에 있습니다: 코드 생성 vs 구조화된 도구 호출.`,$,E,u,W,h='<a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>는 도구 호출을 Python 코드 스니펫으로 생성합니다.',G,x,be,gn="코드는 로컬에서 실행되거나(잠재적으로 불안전) 보안 샌드박스에서 실행됩니다.",Jn,je,Cn="도구는 Python 함수로 노출됩니다(바인딩을 통해).",Mn,fe,Un,el,an,ke,bn=`장점:
<ul><li>높은 표현력: 복잡한 로직과 제어 흐름을 허용하고 도구를 결합하고, 반복하고, 변환하고, 추론할 수 있습니다.</li> <li>유연성: 모든 가능한 액션을 미리 정의할 필요가 없으며, 동적으로 새로운 액션/도구를 생성할 수 있습니다.</li> <li>창발적 추론: 다단계 문제나 동적 로직에 이상적입니다.</li></ul>`,on,he,jn=`제한사항
<ul><li>오류 위험: 구문 오류, 예외를 처리해야 합니다.</li> <li>예측성 부족: 예상치 못한 또는 안전하지 않은 출력에 더 취약합니다.</li> <li>보안 실행 환경이 필요합니다.</li></ul>`,wn,tl,Be,fn='<a href="/docs/smolagents/main/ko/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a>는 도구 호출을 구조화된 JSON으로 작성합니다.',pn,O,Ve,kn="이는 많은 프레임워크(OpenAI API)에서 사용되는 일반적인 형식으로, 코드 실행 없이 구조화된 도구 상호작용을 가능하게 합니다.",yn,Ze,hn="도구는 JSON 스키마로 정의됩니다: 이름, 설명, 매개변수 타입 등.",dn,Re,mn,nl,un,$e,Bn=`장점:
<ul><li>안정성: 환각이 적고, 출력이 구조화되고 검증됩니다.</li> <li>안전성: 인수가 엄격하게 검증되고, 임의의 코드가 실행될 위험이 없습니다.</li> <li>상호 운용성: 외부 API나 서비스에 쉽게 매핑됩니다.</li></ul>`,cn,Ae,Vn=`제한사항:
<ul><li>낮은 표현력: 결과를 동적으로 쉽게 결합하거나 변환할 수 없고, 복잡한 로직이나 제어 흐름을 수행할 수 없습니다.</li> <li>유연성 부족: 모든 가능한 액션을 미리 정의해야 하고, 사전 정의된 도구로 제한됩니다.</li> <li>코드 합성 없음: 도구 기능으로 제한됩니다.</li></ul>`,We,sl,Zn="어떤 에이전트 유형을 사용할지:",Qe,Tl,Rn='<li><p><a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>를 사용하는 경우:</p> <ul><li>추론, 연결 또는 동적 구성이 필요한 경우.</li> <li>도구가 결합할 수 있는 함수인 경우(예: 구문 분석 + 수학 + 쿼리).</li> <li>에이전트가 문제 해결자 또는 프로그래머인 경우.</li></ul></li> <li><p><a href="/docs/smolagents/main/ko/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a>를 사용하는 경우:</p> <ul><li>단순하고 독립적인 도구가 있는 경우(예: API 호출, 문서 가져오기).</li> <li>높은 안정성과 명확한 검증을 원하는 경우.</li> <li>에이전트가 디스패처나 컨트롤러 같은 역할인 경우.</li></ul></li>',Fe,Jl,ve,Ml,$n='<a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>는 액션을 수행하고 작업을 해결하기 위해 Python 코드 스니펫을 생성합니다.',Ge,Ul,An=`기본적으로 Python 코드 실행은 로컬 환경에서 수행됩니다.
사용자가 제공한 도구들(특히 Hugging Face 도구만 있는 경우)과 <code>print</code>나 <code>math</code> 모듈 함수 같은 사전 정의된 안전한 함수들만 호출할 수 있도록 제한되어 있어 안전합니다.`,Ee,al,Nn=`Python 인터프리터는 기본적으로 안전 목록에 포함된 모듈만 import를 허용하므로, 대부분의 명백한 보안 공격을 방지할 수 있습니다.
<a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>를 초기화할 때 <code>additional_authorized_imports</code> 인수에 문자열 목록으로 승인된 모듈을 전달하여 추가 import를 승인할 수 있습니다:`,_e,ol,xe,il,Wn=`또한 추가 보안 계층으로, import 목록에서 명시적으로 승인되지 않는 한 서브모듈에 대한 접근은 기본적으로 금지됩니다.
예를 들어, <code>numpy.random</code> 서브모듈에 접근하려면 <code>additional_authorized_imports</code> 목록에 <code>&#39;numpy.random&#39;</code>을 추가해야 합니다.
이는 <code>numpy</code>와 <code>numpy.random</code> 같은 모든 서브패키지 및 자체 서브패키지를 허용하는 <code>numpy.*</code>를 사용하여 승인할 수도 있습니다.`,Oe,Y,Qn="<p>LLM은 실행될 임의의 코드를 생성할 수 있습니다: 안전하지 않은 import는 추가하지 마세요!</p>",Se,wl,Fn="불법적인 작업을 수행하려고 시도하는 코드나 에이전트가 생성한 코드에 일반적인 Python 오류가 있는 경우 실행이 중단됩니다.",He,pl,vn='로컬 Python 인터프리터 대신 <a href="https://e2b.dev/docs#what-is-e2-b" rel="nofollow">E2B code executor</a>나 Docker를 사용할 수도 있습니다. E2B의 경우, 먼저 <a href="https://e2b.dev/dashboard?tab=keys" rel="nofollow"><code>E2B_API_KEY</code> 환경 변수를 설정</a>한 다음 에이전트 초기화 시 <code>executor_type=&quot;e2b&quot;</code>를 전달하세요. Docker의 경우, 초기화 중에 <code>executor_type=&quot;docker&quot;</code>를 전달하세요.',Le,X,Gn='<p>코드 실행에 대해 더 자세히 알아보려면 <a href="tutorials/secure_code_execution">이 튜토리얼</a>을 확인하세요.</p>',ze,yl,De,dl,En='<a href="/docs/smolagents/main/ko/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a>는 많은 프레임워크(OpenAI API)에서 사용되는 일반적인 형식인 JSON 도구 호출을 출력하여, 코드 실행 없이 구조화된 도구 상호작용을 가능하게 합니다.',Ye,ml,_n='코드를 실행하지 않으므로 <code>additional_authorized_imports</code> 없이도 <a href="/docs/smolagents/main/ko/reference/agents#smolagents.CodeAgent">CodeAgent</a>와 거의 동일한 방식으로 작동합니다:',Xe,ul,qe,cl,Pe,rl,xn="최소한의 에이전트를 초기화하려면 최소한 다음 두 인수가 필요합니다:",Ke,Il,On='<li><p><code>model</code>, 에이전트를 구동하는 텍스트 생성 모델 - 에이전트는 단순한 LLM과 다르며, LLM을 엔진으로 사용하는 시스템입니다. 다음 옵션 중 하나를 사용할 수 있습니다:</p> <ul><li><a href="/docs/smolagents/main/ko/reference/models#smolagents.TransformersModel">TransformersModel</a>은 사전 초기화된 <code>transformers</code> 파이프라인을 가져와 <code>transformers</code>를 사용하여 로컬 머신에서 추론을 실행합니다.</li> <li><a href="/docs/smolagents/main/ko/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a>은 내부적으로 <code>huggingface_hub.InferenceClient</code>를 활용하며 Hub의 모든 추론 제공자를 지원합니다: Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together 등.</li> <li><a href="/docs/smolagents/main/ko/reference/models#smolagents.LiteLLMModel">LiteLLMModel</a>은 마찬가지로 <a href="https://docs.litellm.ai/" rel="nofollow">LiteLLM</a>을 통해 100개 이상의 다양한 모델과 제공자를 호출할 수 있습니다!</li> <li><a href="/docs/smolagents/main/ko/reference/models#smolagents.AzureOpenAIModel">AzureOpenAIModel</a>은 <a href="https://azure.microsoft.com/en-us/products/ai-services/openai-service" rel="nofollow">Azure</a>에 배포된 OpenAI 모델을 사용할 수 있게 해줍니다.</li> <li><a href="/docs/smolagents/main/ko/reference/models#smolagents.AmazonBedrockModel">AmazonBedrockModel</a>은 <a href="https://aws.amazon.com/bedrock/?nc1=h_ls" rel="nofollow">AWS</a>의 Amazon Bedrock을 사용할 수 있게 해줍니다.</li> <li><a href="/docs/smolagents/main/ko/reference/models#smolagents.MLXModel">MLXModel</a>은 로컬 머신에서 추론을 실행하기 위한 <a href="https://pypi.org/project/mlx-lm/" rel="nofollow">mlx-lm</a> 파이프라인을 생성합니다.</li></ul></li> <li><p><code>tools</code>, 에이전트가 작업 해결에 사용할 수 있는 도구 목록입니다. 빈 목록으로 설정할 수도 있습니다. add_base_tools=True 옵션을 사용하면 기본 제공되는 도구들(웹 검색, 코드 실행, 음성 인식 등)을 <code>tools</code> 목록에 추가할 수 있습니다.</p></li>',lt,gl,Sn='<code>tools</code>와 <code>model</code> 두 인수를 설정하면 에이전트를 생성하고 실행할 수 있습니다. <a href="https://huggingface.co/blog/inference-providers" rel="nofollow">추론 제공자</a>, <a href="https://github.com/huggingface/transformers/" rel="nofollow">transformers</a>, <a href="https://ollama.com/" rel="nofollow">ollama</a>, <a href="https://www.litellm.ai/" rel="nofollow">LiteLLM</a>, <a href="https://azure.microsoft.com/en-us/products/ai-services/openai-service" rel="nofollow">Azure OpenAI</a>, <a href="https://aws.amazon.com/bedrock/?nc1=h_ls" rel="nofollow">Amazon Bedrock</a>, 또는 <a href="https://pypi.org/project/mlx-lm/" rel="nofollow">mlx-lm</a>을 통해 원하는 LLM을 사용할 수 있습니다.',et,Cl,Hn=`모든 모델 클래스는 인스턴스화 시점에 추가 키워드 인수(예: <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code> 등)를 직접 전달하는 것을 지원합니다.
이러한 매개변수는 기본 모델의 완성 호출에 자동으로 전달되어 창의성, 응답 길이, 샘플링 전략 등의 모델 동작을 구성할 수 있습니다.`,tt,q,nt,bl,st,jl,Tt,fl,Ln=`기본적으로 에이전트는 <code>final_answer</code> 함수를 호출하거나 최대 단계 수에 도달할 때까지 계속 실행됩니다.
<code>final_answer_checks</code> 매개변수는 에이전트가 실행을 종료하는 시점과 방법을 더 세밀하게 제어할 수 있게 해줍니다:`,Jt,kl,Mt,hl,zn="<code>final_answer_checks</code> 매개변수는 각각 다음과 같은 함수들의 목록을 받습니다:",Ut,Bl,Dn="<li>에이전트의 final_answer 문자열과 에이전트의 메모리를 매개변수로 받습니다</li> <li>final_answer가 유효한지(True) 아닌지(False)를 나타내는 불리언을 반환합니다</li>",at,Vl,Yn=`함수 중 하나라도 <code>False</code>를 반환하면 에이전트는 오류 메시지를 로그에 기록하고 실행을 계속합니다.
이 검증 메커니즘은 다음을 가능하게 합니다:`,ot,Zl,Xn="<li>출력 형식 요구사항 강제(예: 수학 문제에 대한 숫자 답변 보장)</li> <li>도메인별 검증 규칙 구현</li> <li>자체 출력을 검증하는 더 견고한 에이전트 생성</li>",it,Rl,wt,$l,qn="실행 후 무슨 일이 일어났는지 확인하는 데 유용한 몇 가지 속성이 있습니다:",pt,Al,Pn="<li><code>agent.logs</code>는 에이전트의 상세한 실행 로그를 저장합니다. 에이전트 실행의 각 단계마다 모든 정보가 딕셔너리 형태로 저장되어 <code>agent.logs</code>에 추가됩니다.</li> <li><code>agent.write_memory_to_messages()</code>는 에이전트의 메모리를 모델이 볼 수 있는 채팅 메시지 목록으로 변환합니다. 이 메소드는 로그의 각 단계를 살펴보고 중요한 내용만 메시지로 저장합니다. 예를 들어, 시스템 프롬프트와 작업을 각각 별도 메시지로 저장하고, 각 단계의 LLM 출력과 도구 호출 결과를 개별 메시지로 저장합니다. 전체적인 흐름 파악이 필요할 때 권장드립니다. 단, 모든 로그가 이 메소드를 통해 기록되는 것은 아닙니다.</li>",yt,Nl,dt,Wl,Kn="도구는 에이전트가 사용할 수 있는 독립적인 함수입니다. LLM이 도구를 사용하기 위해서는 먼저 API를 구성해야하며, 또한 LLM에게 해당 도구 호출하는 방법을 설명해주어야합니다 :",mt,Ql,ls="<li>이름</li> <li>설명</li> <li>입력 타입과 설명</li> <li>출력 타입</li>",ut,Fl,es="예를 들어 <code>PythonInterpreterTool</code>을 확인할 수 있습니다: 이름, 설명, 입력 설명, 출력 타입, 그리고 액션을 수행하는 <code>forward</code> 메소드가 있습니다.",ct,vl,ts="에이전트가 초기화될 때 도구 속성이 에이전트의 시스템 프롬프트에 포함되는 도구 설명을 생성하는 데 사용됩니다. 이를 통해 에이전트는 사용할 수 있는 도구와 그 이유를 알 수 있습니다.",rt,Gl,ns="<strong>스키마 정보</strong>: <code>output_schema</code>가 정의된 도구(구조화된 출력을 가진 MCP 도구 등)의 경우, <code>CodeAgent</code> 시스템 프롬프트에 자동으로 JSON 스키마 정보가 포함됩니다. 이는 에이전트가 도구 출력의 예상 구조를 이해하고 데이터에 적절히 접근할 수 있도록 도와줍니다.",It,El,gt,_l,ss="“toolkit” extra와 함께 <code>smolagents</code>를 설치하면 에이전트를 강화하는 기본 툴박스가 함께 제공되며, <code>add_base_tools=True</code> 인수로 초기화 시 에이전트에 추가할 수 있습니다:",Ct,xl,Ts='<li><strong>DuckDuckGo 웹 검색*</strong>: DuckDuckGo 브라우저를 사용하여 웹 검색을 수행합니다.</li> <li><strong>Python 코드 인터프리터</strong>: 보안 환경에서 LLM이 생성한 Python 코드를 실행합니다. 이 도구는 코드 기반 에이전트가 이미 기본적으로 Python 코드를 실행할 수 있으므로 <code>add_base_tools=True</code>로 초기화할 때만 <a href="/docs/smolagents/main/ko/reference/agents#smolagents.ToolCallingAgent">ToolCallingAgent</a>에 추가됩니다.</li> <li><strong>Transcriber</strong>: 오디오를 텍스트로 변환하는 Whisper-Turbo 기반의 음성-텍스트 파이프라인입니다.</li>',bt,Ol,Js="인수와 함께 호출하여 도구를 수동으로 사용할 수 있습니다.",jt,Sl,ft,Hl,kt,Ll,Ms=`Hugging Face의 기본 도구가 다루지 않는 사용 사례를 위해 자신만의 도구를 만들 수 있습니다.
예를 들어, Hub에서 주어진 작업에 대해 가장 많이 다운로드된 모델을 반환하는 도구를 만들어보겠습니다.`,ht,zl,Us="아래 코드부터 시작하겠습니다.",Bt,Dl,Vt,Yl,as=`이 코드는 함수로 만들고 <code>tool</code> 데코레이터를 추가하여 간단히 도구로 변환할 수 있습니다.
하지만 이것이 도구를 만드는 유일한 방법은 아닙니다. [Tool]의 하위 클래스로 직접 정의하는 방법도 있으며, 이 방식은 더 많은 유연성을 제공합니다. 예를 들어 리소스 집약적인 클래스 속성을 초기화할 때 유용합니다.`,Zt,Xl,os="두 옵션 모두에서 어떻게 작동하는지 살펴보겠습니다:",Rt,P,$t,ql,is="다음 로그를 얻습니다:",At,Pl,Nt,K,ws='<p>도구에 대해 더 자세히 알아보려면 <a href="./tutorials/tools#what-is-a-tool-and-how-to-build-one">전용 튜토리얼</a>을 읽어보세요.</p>',Wt,Kl,Qt,le,ps='멀티 에이전트 시스템은 Microsoft의 프레임워크 <a href="https://huggingface.co/papers/2308.08155" rel="nofollow">Autogen</a>과 함께 도입되었습니다.',Ft,ee,ys=`이러한 프레임워크에서는 단일 에이전트 대신 여러 에이전트가 협력하여 작업을 해결합니다.
실제로 대부분의 벤치마크에서 더 우수한 성능을 보여줍니다. 성능이 향상되는 이유는 개념적으로 단순합니다. 많은 작업에서 모든 기능을 담당하는 범용 시스템보다는 특정 하위 작업에 특화된 전문 단위를 사용하는 것이 더 효과적이기 때문입니다. 서로 다른 도구와 메모리를 가진 에이전트들을 활용하면 효율적인 역할 분담이 가능합니다. 예를 들어, 웹 검색 에이전트가 수집한 모든 웹페이지 내용을 코드 생성 에이전트의 메모리에까지 저장할 필요가 있을까요? 각자의 역할에 맞게 분리해서 운영하는 것이 훨씬 효율적입니다.`,vt,te,ds="<code>smolagents</code>로 계층적 멀티 에이전트 시스템을 쉽게 구축할 수 있습니다.",Gt,ne,ms=`이를 위해서는 에이전트에 <code>name</code>과 <code>description</code> 속성만 있으면 되며, 이는 도구와 마찬가지로 관리자 에이전트의 시스템 프롬프트에 포함되어 관리되는 에이전트를 호출하는 방법을 알려줍니다.
그런 다음 관리자 에이전트를 초기화할 때 <code>managed_agents</code> 매개변수에 이 관리되는 에이전트를 전달할 수 있습니다.`,Et,se,us="다음은 네이티브 <code>WebSearchTool</code>을 사용하여 특정 웹 검색 에이전트를 관리하는 에이전트를 만드는 예시입니다:",_t,Te,xt,ll,cs='<p>효율적인 멀티 에이전트 구현의 심화 예제를 보려면 <a href="https://huggingface.co/blog/beating-gaia" rel="nofollow">멀티 에이전트 시스템을 GAIA 리더보드 상위권으로 끌어올린 방법</a>을 확인하세요.</p>',Ot,Je,St,Me,rs="<code>GradioUI</code>를 사용하여 에이전트에 대화형으로 작업을 제출하고 그 사고와 실행 과정을 관찰할 수 있습니다. 다음은 예시입니다:",Ht,Ue,Lt,ae,Is=`내부적으로 사용자가 새로운 요청을 입력하면 에이전트는 <code>agent.run(user_request, reset=False)</code>로 실행됩니다.
<code>reset=False</code> 플래그는 이 새로운 작업을 실행하기 전에 에이전트의 메모리가 플러시되지 않음을 의미하며, 이를 통해 대화가 계속될 수 있습니다.`,zt,oe,gs="다른 에이전트 애플리케이션에서도 이 <code>reset=False</code> 인수를 사용하여 대화를 계속할 수 있습니다.",Dt,ie,Cs=`Gradio UI에서 사용자가 실행 중인 에이전트를 중단할 수 있도록 하려면 <code>agent.interrupt()</code> 메소드를 트리거하는 버튼으로 이를 수행할 수 있습니다.
이렇게 하면 현재 단계가 끝날 때 에이전트가 중지되고 오류가 발생합니다.`,Yt,we,Xt,pe,bs="마지막으로 에이전트를 필요에 맞게 구성했다면 Hub에 공유할 수 있습니다!",qt,ye,Pt,de,js="마찬가지로, 도구의 코드를 신뢰한다면 Hub에 업로드된 에이전트를 불러오려면 다음을 사용하세요:",Kt,me,ln,ue,fs="더 자세한 활용법을 원한다면 다음 튜토리얼들을 참고하세요:",en,ce,ks='<li><a href="./tutorials/secure_code_execution">코드 에이전트가 작동하는 방법에 대한 설명</a></li> <li><a href="./tutorials/building_good_agents">좋은 에이전트를 구축하는 방법에 대한 가이드</a>.</li> <li><a href="./tutorials/building_good_agents">도구 사용에 대한 상세 가이드</a>.</li>',tn,re,nn,Ne,sn;return y=new Ws({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),j=new Fs({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/ko/guided_tour.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/ko/pytorch/guided_tour.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/smolagents_doc/ko/tensorflow/guided_tour.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/ko/guided_tour.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/ko/pytorch/guided_tour.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/smolagents_doc/ko/tensorflow/guided_tour.ipynb"}]}}),w=new _({props:{title:"에이전트 안내서",local:"agents---guided-tour",headingTag:"h1"}}),d=new _({props:{title:"에이전트 유형 선택: CodeAgent 또는 ToolCallingAgent",local:"choosing-an-agent-type:-codeagent-or-toolcallingagent",headingTag:"h2"}}),el=new F({props:{code:"cmVzdWx0JTIwJTNEJTIwc2VhcmNoX2RvY3MoJTIyV2hhdCUyMGlzJTIwdGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTNGJTIyKSUwQXByaW50KHJlc3VsdCk=",highlighted:`result = search_docs(<span class="hljs-string">&quot;What is the capital of France?&quot;</span>)
<span class="hljs-built_in">print</span>(result)`,wrap:!1}}),nl=new F({props:{code:"JTdCJTBBJTIwJTIwJTIydG9vbF9jYWxsJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMnNlYXJjaF9kb2NzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXJndW1lbnRzJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIycXVlcnklMjIlM0ElMjAlMjJXaGF0JTIwaXMlMjB0aGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlM0YlMjIlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlN0QlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;tool_call&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;name&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;search_docs&quot;</span><span class="hljs-punctuation">,</span>
    <span class="hljs-attr">&quot;arguments&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">&quot;query&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;What is the capital of France?&quot;</span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),Jl=new _({props:{title:"CodeAgent",local:"codeagent",headingTag:"h2"}}),ol=new F({props:{code:"bW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUIlNUQlMkMlMjBtb2RlbCUzRG1vZGVsJTJDJTIwYWRkaXRpb25hbF9hdXRob3JpemVkX2ltcG9ydHMlM0QlNUIncmVxdWVzdHMnJTJDJTIwJ2JzNCclNUQpJTBBYWdlbnQucnVuKCUyMkNvdWxkJTIweW91JTIwZ2V0JTIwbWUlMjB0aGUlMjB0aXRsZSUyMG9mJTIwdGhlJTIwcGFnZSUyMGF0JTIwdXJsJTIwJ2h0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZibG9nJyUzRiUyMik=",highlighted:`model = InferenceClientModel()
agent = CodeAgent(tools=[], model=model, additional_authorized_imports=[<span class="hljs-string">&#x27;requests&#x27;</span>, <span class="hljs-string">&#x27;bs4&#x27;</span>])
agent.run(<span class="hljs-string">&quot;Could you get me the title of the page at url &#x27;https://huggingface.co/blog&#x27;?&quot;</span>)`,wrap:!1}}),yl=new _({props:{title:"ToolCallingAgent",local:"toolcallingagent",headingTag:"h3"}}),ul=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUb29sQ2FsbGluZ0FnZW50JTJDJTIwV2ViU2VhcmNoVG9vbCUwQSUwQWFnZW50JTIwJTNEJTIwVG9vbENhbGxpbmdBZ2VudCh0b29scyUzRCU1QldlYlNlYXJjaFRvb2woKSU1RCUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBYWdlbnQucnVuKCUyMkNvdWxkJTIweW91JTIwZ2V0JTIwbWUlMjB0aGUlMjB0aXRsZSUyMG9mJTIwdGhlJTIwcGFnZSUyMGF0JTIwdXJsJTIwJ2h0dHBzJTNBJTJGJTJGaHVnZ2luZ2ZhY2UuY28lMkZibG9nJyUzRiUyMik=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> ToolCallingAgent, WebSearchTool

agent = ToolCallingAgent(tools=[WebSearchTool()], model=model)
agent.run(<span class="hljs-string">&quot;Could you get me the title of the page at url &#x27;https://huggingface.co/blog&#x27;?&quot;</span>)`,wrap:!1}}),cl=new _({props:{title:"에이전트 구축",local:"building-your-agent",headingTag:"h2"}}),q=new Vs({props:{id:"Pick a LLM",options:["Inference Providers","Local Transformers Model","OpenAI or Anthropic API","Ollama","Azure OpenAI","Amazon Bedrock","mlx-lm"],$$slots:{default:[Hs]},$$scope:{ctx:v}}}),bl=new _({props:{title:"고급 에이전트 구성",local:"advanced-agent-configuration",headingTag:"h2"}}),jl=new _({props:{title:"에이전트 종료 조건 맞춤 설정",local:"customizing-agent-termination-conditions",headingTag:"h3"}}),kl=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBDb2RlQWdlbnQlMkMlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQSUyMyUyMERlZmluZSUyMGElMjBjdXN0b20lMjBmaW5hbCUyMGFuc3dlciUyMGNoZWNrJTIwZnVuY3Rpb24lMEFkZWYlMjBpc19pbnRlZ2VyKGZpbmFsX2Fuc3dlciUzQSUyMHN0ciUyQyUyMGFnZW50X21lbW9yeSUzRE5vbmUpJTIwLSUzRSUyMGJvb2wlM0ElMEElMjAlMjAlMjAlMjAlMjIlMjIlMjJSZXR1cm4lMjBUcnVlJTIwaWYlMjBmaW5hbF9hbnN3ZXIlMjBpcyUyMGFuJTIwaW50ZWdlci4lMjIlMjIlMjIlMEElMjAlMjAlMjAlMjB0cnklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBpbnQoZmluYWxfYW5zd2VyKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMFRydWUlMEElMjAlMjAlMjAlMjBleGNlcHQlMjBWYWx1ZUVycm9yJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwRmFsc2UlMEElMEElMjMlMjBJbml0aWFsaXplJTIwYWdlbnQlMjB3aXRoJTIwY3VzdG9tJTIwZmluYWwlMjBhbnN3ZXIlMjBjaGVjayUwQWFnZW50JTIwJTNEJTIwQ29kZUFnZW50KCUwQSUyMCUyMCUyMCUyMHRvb2xzJTNEJTVCJTVEJTJDJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0RJbmZlcmVuY2VDbGllbnRNb2RlbCgpJTJDJTBBJTIwJTIwJTIwJTIwZmluYWxfYW5zd2VyX2NoZWNrcyUzRCU1QmlzX2ludGVnZXIlNUQlMEEpJTBBJTBBYWdlbnQucnVuKCUyMkNhbGN1bGF0ZSUyMHRoZSUyMGxlYXN0JTIwY29tbW9uJTIwbXVsdGlwbGUlMjBvZiUyMDMlMjBhbmQlMjA3JTIyKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, InferenceClientModel

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

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

agent.run(<span class="hljs-string">&quot;Calculate the least common multiple of 3 and 7&quot;</span>)`,wrap:!1}}),Rl=new _({props:{title:"에이전트 실행 검사",local:"inspecting-an-agent-run",headingTag:"h2"}}),Nl=new _({props:{title:"도구",local:"tools",headingTag:"h2"}}),El=new _({props:{title:"기본 툴박스",local:"default-toolbox",headingTag:"h3"}}),Sl=new F({props:{code:"JTIzJTIwIXBpcCUyMGluc3RhbGwlMjBzbW9sYWdlbnRzJTVCdG9vbGtpdCU1RCUwQWZyb20lMjBzbW9sYWdlbnRzJTIwaW1wb3J0JTIwV2ViU2VhcmNoVG9vbCUwQSUwQXNlYXJjaF90b29sJTIwJTNEJTIwV2ViU2VhcmNoVG9vbCgpJTBBcHJpbnQoc2VhcmNoX3Rvb2woJTIyV2hvJ3MlMjB0aGUlMjBjdXJyZW50JTIwcHJlc2lkZW50JTIwb2YlMjBSdXNzaWElM0YlMjIpKQ==",highlighted:`<span class="hljs-comment"># !pip install smolagents[toolkit]</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> WebSearchTool

search_tool = WebSearchTool()
<span class="hljs-built_in">print</span>(search_tool(<span class="hljs-string">&quot;Who&#x27;s the current president of Russia?&quot;</span>))`,wrap:!1}}),Hl=new _({props:{title:"새로운 도구 생성",local:"create-a-new-tool",headingTag:"h3"}}),Dl=new F({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxpc3RfbW9kZWxzJTBBJTBBdGFzayUyMCUzRCUyMCUyMnRleHQtY2xhc3NpZmljYXRpb24lMjIlMEElMEFtb3N0X2Rvd25sb2FkZWRfbW9kZWwlMjAlM0QlMjBuZXh0KGl0ZXIobGlzdF9tb2RlbHMoZmlsdGVyJTNEdGFzayUyQyUyMHNvcnQlM0QlMjJkb3dubG9hZHMlMjIlMkMlMjBkaXJlY3Rpb24lM0QtMSkpKSUwQXByaW50KG1vc3RfZG93bmxvYWRlZF9tb2RlbC5pZCk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> list_models

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

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

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

model = InferenceClientModel()

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

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

manager_agent.run(<span class="hljs-string">&quot;Who is the CEO of Hugging Face?&quot;</span>)`,wrap:!1}}),Je=new _({props:{title:"에이전트와 대화하고 멋진 Gradio 인터페이스에서 그 사고 과정을 시각화하기",local:"talk-with-your-agent-and-visualize-its-thoughts-in-a-cool-gradio-interface",headingTag:"h2"}}),Ue=new F({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjAoJTBBJTIwJTIwJTIwJTIwbG9hZF90b29sJTJDJTBBJTIwJTIwJTIwJTIwQ29kZUFnZW50JTJDJTBBJTIwJTIwJTIwJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwlMkMlMEElMjAlMjAlMjAlMjBHcmFkaW9VSSUwQSklMEElMEElMjMlMjBJbXBvcnQlMjB0b29sJTIwZnJvbSUyMEh1YiUwQWltYWdlX2dlbmVyYXRpb25fdG9vbCUyMCUzRCUyMGxvYWRfdG9vbCglMjJtLXJpYyUyRnRleHQtdG8taW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBJTBBbW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbChtb2RlbF9pZCUzRG1vZGVsX2lkKSUwQSUwQSUyMyUyMEluaXRpYWxpemUlMjB0aGUlMjBhZ2VudCUyMHdpdGglMjB0aGUlMjBpbWFnZSUyMGdlbmVyYXRpb24lMjB0b29sJTBBYWdlbnQlMjAlM0QlMjBDb2RlQWdlbnQodG9vbHMlM0QlNUJpbWFnZV9nZW5lcmF0aW9uX3Rvb2wlNUQlMkMlMjBtb2RlbCUzRG1vZGVsKSUwQSUwQUdyYWRpb1VJKGFnZW50KS5sYXVuY2goKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> (
    load_tool,
    CodeAgent,
    InferenceClientModel,
    GradioUI
)

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

model = InferenceClientModel(model_id=model_id)

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

GradioUI(agent).launch()`,wrap:!1}}),we=new _({props:{title:"다음 단계",local:"next-steps",headingTag:"h2"}}),ye=new F({props:{code:"YWdlbnQucHVzaF90b19odWIoJTIybS1yaWMlMkZteV9hZ2VudCUyMik=",highlighted:'agent.push_to_hub(<span class="hljs-string">&quot;m-ric/my_agent&quot;</span>)',wrap:!1}}),me=new F({props:{code:"YWdlbnQuZnJvbV9odWIoJTIybS1yaWMlMkZteV9hZ2VudCUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSk=",highlighted:'agent.from_hub(<span class="hljs-string">&quot;m-ric/my_agent&quot;</span>, trust_remote_code=<span class="hljs-literal">True</span>)',wrap:!1}}),re=new Qs({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/ko/guided_tour.md"}}),{c(){J=U("meta"),k=s(),o=U("p"),m=s(),c(y.$$.fragment),p=s(),c(j.$$.fragment),Z=s(),c(w.$$.fragment),Q=s(),R=U("p"),R.textContent=V,N=s(),c(d.$$.fragment),M=s(),B=U("p"),B.innerHTML=f,$=s(),E=U("ul"),u=U("li"),W=U("p"),W.innerHTML=h,G=s(),x=U("ul"),be=U("li"),be.textContent=gn,Jn=s(),je=U("li"),je.textContent=Cn,Mn=s(),fe=U("li"),Un=hs(`도구 호출 예시:

	`),c(el.$$.fragment),an=s(),ke=U("li"),ke.innerHTML=bn,on=s(),he=U("li"),he.innerHTML=jn,wn=s(),tl=U("li"),Be=U("p"),Be.innerHTML=fn,pn=s(),O=U("ul"),Ve=U("li"),Ve.textContent=kn,yn=s(),Ze=U("li"),Ze.textContent=hn,dn=s(),Re=U("li"),mn=hs(`도구 호출 예시:

	`),c(nl.$$.fragment),un=s(),$e=U("li"),$e.innerHTML=Bn,cn=s(),Ae=U("li"),Ae.innerHTML=Vn,We=s(),sl=U("p"),sl.textContent=Zn,Qe=s(),Tl=U("ul"),Tl.innerHTML=Rn,Fe=s(),c(Jl.$$.fragment),ve=s(),Ml=U("p"),Ml.innerHTML=$n,Ge=s(),Ul=U("p"),Ul.innerHTML=An,Ee=s(),al=U("p"),al.innerHTML=Nn,_e=s(),c(ol.$$.fragment),xe=s(),il=U("p"),il.innerHTML=Wn,Oe=s(),Y=U("blockquote"),Y.innerHTML=Qn,Se=s(),wl=U("p"),wl.textContent=Fn,He=s(),pl=U("p"),pl.innerHTML=vn,Le=s(),X=U("blockquote"),X.innerHTML=Gn,ze=s(),c(yl.$$.fragment),De=s(),dl=U("p"),dl.innerHTML=En,Ye=s(),ml=U("p"),ml.innerHTML=_n,Xe=s(),c(ul.$$.fragment),qe=s(),c(cl.$$.fragment),Pe=s(),rl=U("p"),rl.textContent=xn,Ke=s(),Il=U("ul"),Il.innerHTML=On,lt=s(),gl=U("p"),gl.innerHTML=Sn,et=s(),Cl=U("p"),Cl.innerHTML=Hn,tt=s(),c(q.$$.fragment),nt=s(),c(bl.$$.fragment),st=s(),c(jl.$$.fragment),Tt=s(),fl=U("p"),fl.innerHTML=Ln,Jt=s(),c(kl.$$.fragment),Mt=s(),hl=U("p"),hl.innerHTML=zn,Ut=s(),Bl=U("ul"),Bl.innerHTML=Dn,at=s(),Vl=U("p"),Vl.innerHTML=Yn,ot=s(),Zl=U("ul"),Zl.innerHTML=Xn,it=s(),c(Rl.$$.fragment),wt=s(),$l=U("p"),$l.textContent=qn,pt=s(),Al=U("ul"),Al.innerHTML=Pn,yt=s(),c(Nl.$$.fragment),dt=s(),Wl=U("p"),Wl.textContent=Kn,mt=s(),Ql=U("ul"),Ql.innerHTML=ls,ut=s(),Fl=U("p"),Fl.innerHTML=es,ct=s(),vl=U("p"),vl.textContent=ts,rt=s(),Gl=U("p"),Gl.innerHTML=ns,It=s(),c(El.$$.fragment),gt=s(),_l=U("p"),_l.innerHTML=ss,Ct=s(),xl=U("ul"),xl.innerHTML=Ts,bt=s(),Ol=U("p"),Ol.textContent=Js,jt=s(),c(Sl.$$.fragment),ft=s(),c(Hl.$$.fragment),kt=s(),Ll=U("p"),Ll.textContent=Ms,ht=s(),zl=U("p"),zl.textContent=Us,Bt=s(),c(Dl.$$.fragment),Vt=s(),Yl=U("p"),Yl.innerHTML=as,Zt=s(),Xl=U("p"),Xl.textContent=os,Rt=s(),c(P.$$.fragment),$t=s(),ql=U("p"),ql.textContent=is,At=s(),c(Pl.$$.fragment),Nt=s(),K=U("blockquote"),K.innerHTML=ws,Wt=s(),c(Kl.$$.fragment),Qt=s(),le=U("p"),le.innerHTML=ps,Ft=s(),ee=U("p"),ee.textContent=ys,vt=s(),te=U("p"),te.innerHTML=ds,Gt=s(),ne=U("p"),ne.innerHTML=ms,Et=s(),se=U("p"),se.innerHTML=us,_t=s(),c(Te.$$.fragment),xt=s(),ll=U("blockquote"),ll.innerHTML=cs,Ot=s(),c(Je.$$.fragment),St=s(),Me=U("p"),Me.innerHTML=rs,Ht=s(),c(Ue.$$.fragment),Lt=s(),ae=U("p"),ae.innerHTML=Is,zt=s(),oe=U("p"),oe.innerHTML=gs,Dt=s(),ie=U("p"),ie.innerHTML=Cs,Yt=s(),c(we.$$.fragment),Xt=s(),pe=U("p"),pe.textContent=bs,qt=s(),c(ye.$$.fragment),Pt=s(),de=U("p"),de.textContent=js,Kt=s(),c(me.$$.fragment),ln=s(),ue=U("p"),ue.textContent=fs,en=s(),ce=U("ul"),ce.innerHTML=ks,tn=s(),c(re.$$.fragment),nn=s(),Ne=U("p"),this.h()},l(l){const n=Ns("svelte-u9bgzb",document.head);J=a(n,"META",{name:!0,content:!0}),n.forEach(e),k=T(l),o=a(l,"P",{}),L(o).forEach(e),m=T(l),r(y.$$.fragment,l),p=T(l),r(j.$$.fragment,l),Z=T(l),r(w.$$.fragment,l),Q=T(l),R=a(l,"P",{"data-svelte-h":!0}),i(R)!=="svelte-19amz7s"&&(R.textContent=V),N=T(l),r(d.$$.fragment,l),M=T(l),B=a(l,"P",{"data-svelte-h":!0}),i(B)!=="svelte-1tti6uk"&&(B.innerHTML=f),$=T(l),E=a(l,"UL",{});var Ie=L(E);u=a(Ie,"LI",{});var ge=L(u);W=a(ge,"P",{"data-svelte-h":!0}),i(W)!=="svelte-faefx"&&(W.innerHTML=h),G=T(ge),x=a(ge,"UL",{});var S=L(x);be=a(S,"LI",{"data-svelte-h":!0}),i(be)!=="svelte-qv49g4"&&(be.textContent=gn),Jn=T(S),je=a(S,"LI",{"data-svelte-h":!0}),i(je)!=="svelte-13eraqg"&&(je.textContent=Cn),Mn=T(S),fe=a(S,"LI",{});var rn=L(fe);Un=Bs(rn,`도구 호출 예시:

	`),r(el.$$.fragment,rn),rn.forEach(e),an=T(S),ke=a(S,"LI",{"data-svelte-h":!0}),i(ke)!=="svelte-whtdmw"&&(ke.innerHTML=bn),on=T(S),he=a(S,"LI",{"data-svelte-h":!0}),i(he)!=="svelte-1j43w19"&&(he.innerHTML=jn),S.forEach(e),ge.forEach(e),wn=T(Ie),tl=a(Ie,"LI",{});var Tn=L(tl);Be=a(Tn,"P",{"data-svelte-h":!0}),i(Be)!=="svelte-3jvi7a"&&(Be.innerHTML=fn),pn=T(Tn),O=a(Tn,"UL",{});var H=L(O);Ve=a(H,"LI",{"data-svelte-h":!0}),i(Ve)!=="svelte-qgx10j"&&(Ve.textContent=kn),yn=T(H),Ze=a(H,"LI",{"data-svelte-h":!0}),i(Ze)!=="svelte-m9mtl"&&(Ze.textContent=hn),dn=T(H),Re=a(H,"LI",{});var In=L(Re);mn=Bs(In,`도구 호출 예시:

	`),r(nl.$$.fragment,In),In.forEach(e),un=T(H),$e=a(H,"LI",{"data-svelte-h":!0}),i($e)!=="svelte-12xhwvz"&&($e.innerHTML=Bn),cn=T(H),Ae=a(H,"LI",{"data-svelte-h":!0}),i(Ae)!=="svelte-149tf88"&&(Ae.innerHTML=Vn),H.forEach(e),Tn.forEach(e),Ie.forEach(e),We=T(l),sl=a(l,"P",{"data-svelte-h":!0}),i(sl)!=="svelte-de5x1m"&&(sl.textContent=Zn),Qe=T(l),Tl=a(l,"UL",{"data-svelte-h":!0}),i(Tl)!=="svelte-ya6wfe"&&(Tl.innerHTML=Rn),Fe=T(l),r(Jl.$$.fragment,l),ve=T(l),Ml=a(l,"P",{"data-svelte-h":!0}),i(Ml)!=="svelte-gxwyp7"&&(Ml.innerHTML=$n),Ge=T(l),Ul=a(l,"P",{"data-svelte-h":!0}),i(Ul)!=="svelte-65nep7"&&(Ul.innerHTML=An),Ee=T(l),al=a(l,"P",{"data-svelte-h":!0}),i(al)!=="svelte-pz0af3"&&(al.innerHTML=Nn),_e=T(l),r(ol.$$.fragment,l),xe=T(l),il=a(l,"P",{"data-svelte-h":!0}),i(il)!=="svelte-1vsbnjm"&&(il.innerHTML=Wn),Oe=T(l),Y=a(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),i(Y)!=="svelte-lrxuhn"&&(Y.innerHTML=Qn),Se=T(l),wl=a(l,"P",{"data-svelte-h":!0}),i(wl)!=="svelte-cy0r6u"&&(wl.textContent=Fn),He=T(l),pl=a(l,"P",{"data-svelte-h":!0}),i(pl)!=="svelte-bheldg"&&(pl.innerHTML=vn),Le=T(l),X=a(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),i(X)!=="svelte-pcp3au"&&(X.innerHTML=Gn),ze=T(l),r(yl.$$.fragment,l),De=T(l),dl=a(l,"P",{"data-svelte-h":!0}),i(dl)!=="svelte-139g3xt"&&(dl.innerHTML=En),Ye=T(l),ml=a(l,"P",{"data-svelte-h":!0}),i(ml)!=="svelte-a4557t"&&(ml.innerHTML=_n),Xe=T(l),r(ul.$$.fragment,l),qe=T(l),r(cl.$$.fragment,l),Pe=T(l),rl=a(l,"P",{"data-svelte-h":!0}),i(rl)!=="svelte-jxoy5v"&&(rl.textContent=xn),Ke=T(l),Il=a(l,"UL",{"data-svelte-h":!0}),i(Il)!=="svelte-17o221a"&&(Il.innerHTML=On),lt=T(l),gl=a(l,"P",{"data-svelte-h":!0}),i(gl)!=="svelte-axfbel"&&(gl.innerHTML=Sn),et=T(l),Cl=a(l,"P",{"data-svelte-h":!0}),i(Cl)!=="svelte-1qby8z"&&(Cl.innerHTML=Hn),tt=T(l),r(q.$$.fragment,l),nt=T(l),r(bl.$$.fragment,l),st=T(l),r(jl.$$.fragment,l),Tt=T(l),fl=a(l,"P",{"data-svelte-h":!0}),i(fl)!=="svelte-18sf0i3"&&(fl.innerHTML=Ln),Jt=T(l),r(kl.$$.fragment,l),Mt=T(l),hl=a(l,"P",{"data-svelte-h":!0}),i(hl)!=="svelte-pkvesx"&&(hl.innerHTML=zn),Ut=T(l),Bl=a(l,"UL",{"data-svelte-h":!0}),i(Bl)!=="svelte-jg4how"&&(Bl.innerHTML=Dn),at=T(l),Vl=a(l,"P",{"data-svelte-h":!0}),i(Vl)!=="svelte-1vhtgtu"&&(Vl.innerHTML=Yn),ot=T(l),Zl=a(l,"UL",{"data-svelte-h":!0}),i(Zl)!=="svelte-1yvvtux"&&(Zl.innerHTML=Xn),it=T(l),r(Rl.$$.fragment,l),wt=T(l),$l=a(l,"P",{"data-svelte-h":!0}),i($l)!=="svelte-xceg47"&&($l.textContent=qn),pt=T(l),Al=a(l,"UL",{"data-svelte-h":!0}),i(Al)!=="svelte-1qav1e5"&&(Al.innerHTML=Pn),yt=T(l),r(Nl.$$.fragment,l),dt=T(l),Wl=a(l,"P",{"data-svelte-h":!0}),i(Wl)!=="svelte-8tmi56"&&(Wl.textContent=Kn),mt=T(l),Ql=a(l,"UL",{"data-svelte-h":!0}),i(Ql)!=="svelte-142two3"&&(Ql.innerHTML=ls),ut=T(l),Fl=a(l,"P",{"data-svelte-h":!0}),i(Fl)!=="svelte-1j711sa"&&(Fl.innerHTML=es),ct=T(l),vl=a(l,"P",{"data-svelte-h":!0}),i(vl)!=="svelte-jvmnhc"&&(vl.textContent=ts),rt=T(l),Gl=a(l,"P",{"data-svelte-h":!0}),i(Gl)!=="svelte-zl5tzb"&&(Gl.innerHTML=ns),It=T(l),r(El.$$.fragment,l),gt=T(l),_l=a(l,"P",{"data-svelte-h":!0}),i(_l)!=="svelte-1rdhx1y"&&(_l.innerHTML=ss),Ct=T(l),xl=a(l,"UL",{"data-svelte-h":!0}),i(xl)!=="svelte-11d1pnz"&&(xl.innerHTML=Ts),bt=T(l),Ol=a(l,"P",{"data-svelte-h":!0}),i(Ol)!=="svelte-1fqntez"&&(Ol.textContent=Js),jt=T(l),r(Sl.$$.fragment,l),ft=T(l),r(Hl.$$.fragment,l),kt=T(l),Ll=a(l,"P",{"data-svelte-h":!0}),i(Ll)!=="svelte-122bhdj"&&(Ll.textContent=Ms),ht=T(l),zl=a(l,"P",{"data-svelte-h":!0}),i(zl)!=="svelte-ezzxi4"&&(zl.textContent=Us),Bt=T(l),r(Dl.$$.fragment,l),Vt=T(l),Yl=a(l,"P",{"data-svelte-h":!0}),i(Yl)!=="svelte-1f8v5mb"&&(Yl.innerHTML=as),Zt=T(l),Xl=a(l,"P",{"data-svelte-h":!0}),i(Xl)!=="svelte-1bwbi9n"&&(Xl.textContent=os),Rt=T(l),r(P.$$.fragment,l),$t=T(l),ql=a(l,"P",{"data-svelte-h":!0}),i(ql)!=="svelte-tunl0y"&&(ql.textContent=is),At=T(l),r(Pl.$$.fragment,l),Nt=T(l),K=a(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),i(K)!=="svelte-1ibre0g"&&(K.innerHTML=ws),Wt=T(l),r(Kl.$$.fragment,l),Qt=T(l),le=a(l,"P",{"data-svelte-h":!0}),i(le)!=="svelte-e3xte0"&&(le.innerHTML=ps),Ft=T(l),ee=a(l,"P",{"data-svelte-h":!0}),i(ee)!=="svelte-r80hcc"&&(ee.textContent=ys),vt=T(l),te=a(l,"P",{"data-svelte-h":!0}),i(te)!=="svelte-1omuaip"&&(te.innerHTML=ds),Gt=T(l),ne=a(l,"P",{"data-svelte-h":!0}),i(ne)!=="svelte-982dee"&&(ne.innerHTML=ms),Et=T(l),se=a(l,"P",{"data-svelte-h":!0}),i(se)!=="svelte-54l33b"&&(se.innerHTML=us),_t=T(l),r(Te.$$.fragment,l),xt=T(l),ll=a(l,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),i(ll)!=="svelte-2fjgwv"&&(ll.innerHTML=cs),Ot=T(l),r(Je.$$.fragment,l),St=T(l),Me=a(l,"P",{"data-svelte-h":!0}),i(Me)!=="svelte-140jjfh"&&(Me.innerHTML=rs),Ht=T(l),r(Ue.$$.fragment,l),Lt=T(l),ae=a(l,"P",{"data-svelte-h":!0}),i(ae)!=="svelte-1oh1cz1"&&(ae.innerHTML=Is),zt=T(l),oe=a(l,"P",{"data-svelte-h":!0}),i(oe)!=="svelte-1e71kfx"&&(oe.innerHTML=gs),Dt=T(l),ie=a(l,"P",{"data-svelte-h":!0}),i(ie)!=="svelte-ydn6vq"&&(ie.innerHTML=Cs),Yt=T(l),r(we.$$.fragment,l),Xt=T(l),pe=a(l,"P",{"data-svelte-h":!0}),i(pe)!=="svelte-1qenioq"&&(pe.textContent=bs),qt=T(l),r(ye.$$.fragment,l),Pt=T(l),de=a(l,"P",{"data-svelte-h":!0}),i(de)!=="svelte-gg25wv"&&(de.textContent=js),Kt=T(l),r(me.$$.fragment,l),ln=T(l),ue=a(l,"P",{"data-svelte-h":!0}),i(ue)!=="svelte-1lhz2mw"&&(ue.textContent=fs),en=T(l),ce=a(l,"UL",{"data-svelte-h":!0}),i(ce)!=="svelte-1dm99ui"&&(ce.innerHTML=ks),tn=T(l),r(re.$$.fragment,l),nn=T(l),Ne=a(l,"P",{}),L(Ne).forEach(e),this.h()},h(){Ce(J,"name","hf:doc:metadata"),Ce(J,"content",Xs),Ce(Y,"class","warning"),Ce(X,"class","tip"),Ce(K,"class","tip"),Ce(ll,"class","tip")},m(l,n){A(document.head,J),t(l,k,n),t(l,o,n),t(l,m,n),I(y,l,n),t(l,p,n),I(j,l,n),t(l,Z,n),I(w,l,n),t(l,Q,n),t(l,R,n),t(l,N,n),I(d,l,n),t(l,M,n),t(l,B,n),t(l,$,n),t(l,E,n),A(E,u),A(u,W),A(u,G),A(u,x),A(x,be),A(x,Jn),A(x,je),A(x,Mn),A(x,fe),A(fe,Un),I(el,fe,null),A(x,an),A(x,ke),A(x,on),A(x,he),A(E,wn),A(E,tl),A(tl,Be),A(tl,pn),A(tl,O),A(O,Ve),A(O,yn),A(O,Ze),A(O,dn),A(O,Re),A(Re,mn),I(nl,Re,null),A(O,un),A(O,$e),A(O,cn),A(O,Ae),t(l,We,n),t(l,sl,n),t(l,Qe,n),t(l,Tl,n),t(l,Fe,n),I(Jl,l,n),t(l,ve,n),t(l,Ml,n),t(l,Ge,n),t(l,Ul,n),t(l,Ee,n),t(l,al,n),t(l,_e,n),I(ol,l,n),t(l,xe,n),t(l,il,n),t(l,Oe,n),t(l,Y,n),t(l,Se,n),t(l,wl,n),t(l,He,n),t(l,pl,n),t(l,Le,n),t(l,X,n),t(l,ze,n),I(yl,l,n),t(l,De,n),t(l,dl,n),t(l,Ye,n),t(l,ml,n),t(l,Xe,n),I(ul,l,n),t(l,qe,n),I(cl,l,n),t(l,Pe,n),t(l,rl,n),t(l,Ke,n),t(l,Il,n),t(l,lt,n),t(l,gl,n),t(l,et,n),t(l,Cl,n),t(l,tt,n),I(q,l,n),t(l,nt,n),I(bl,l,n),t(l,st,n),I(jl,l,n),t(l,Tt,n),t(l,fl,n),t(l,Jt,n),I(kl,l,n),t(l,Mt,n),t(l,hl,n),t(l,Ut,n),t(l,Bl,n),t(l,at,n),t(l,Vl,n),t(l,ot,n),t(l,Zl,n),t(l,it,n),I(Rl,l,n),t(l,wt,n),t(l,$l,n),t(l,pt,n),t(l,Al,n),t(l,yt,n),I(Nl,l,n),t(l,dt,n),t(l,Wl,n),t(l,mt,n),t(l,Ql,n),t(l,ut,n),t(l,Fl,n),t(l,ct,n),t(l,vl,n),t(l,rt,n),t(l,Gl,n),t(l,It,n),I(El,l,n),t(l,gt,n),t(l,_l,n),t(l,Ct,n),t(l,xl,n),t(l,bt,n),t(l,Ol,n),t(l,jt,n),I(Sl,l,n),t(l,ft,n),I(Hl,l,n),t(l,kt,n),t(l,Ll,n),t(l,ht,n),t(l,zl,n),t(l,Bt,n),I(Dl,l,n),t(l,Vt,n),t(l,Yl,n),t(l,Zt,n),t(l,Xl,n),t(l,Rt,n),I(P,l,n),t(l,$t,n),t(l,ql,n),t(l,At,n),I(Pl,l,n),t(l,Nt,n),t(l,K,n),t(l,Wt,n),I(Kl,l,n),t(l,Qt,n),t(l,le,n),t(l,Ft,n),t(l,ee,n),t(l,vt,n),t(l,te,n),t(l,Gt,n),t(l,ne,n),t(l,Et,n),t(l,se,n),t(l,_t,n),I(Te,l,n),t(l,xt,n),t(l,ll,n),t(l,Ot,n),I(Je,l,n),t(l,St,n),t(l,Me,n),t(l,Ht,n),I(Ue,l,n),t(l,Lt,n),t(l,ae,n),t(l,zt,n),t(l,oe,n),t(l,Dt,n),t(l,ie,n),t(l,Yt,n),I(we,l,n),t(l,Xt,n),t(l,pe,n),t(l,qt,n),I(ye,l,n),t(l,Pt,n),t(l,de,n),t(l,Kt,n),I(me,l,n),t(l,ln,n),t(l,ue,n),t(l,en,n),t(l,ce,n),t(l,tn,n),I(re,l,n),t(l,nn,n),t(l,Ne,n),sn=!0},p(l,[n]){const Ie={};n&2&&(Ie.$$scope={dirty:n,ctx:l}),q.$set(Ie);const ge={};n&2&&(ge.$$scope={dirty:n,ctx:l}),P.$set(ge)},i(l){sn||(g(y.$$.fragment,l),g(j.$$.fragment,l),g(w.$$.fragment,l),g(d.$$.fragment,l),g(el.$$.fragment,l),g(nl.$$.fragment,l),g(Jl.$$.fragment,l),g(ol.$$.fragment,l),g(yl.$$.fragment,l),g(ul.$$.fragment,l),g(cl.$$.fragment,l),g(q.$$.fragment,l),g(bl.$$.fragment,l),g(jl.$$.fragment,l),g(kl.$$.fragment,l),g(Rl.$$.fragment,l),g(Nl.$$.fragment,l),g(El.$$.fragment,l),g(Sl.$$.fragment,l),g(Hl.$$.fragment,l),g(Dl.$$.fragment,l),g(P.$$.fragment,l),g(Pl.$$.fragment,l),g(Kl.$$.fragment,l),g(Te.$$.fragment,l),g(Je.$$.fragment,l),g(Ue.$$.fragment,l),g(we.$$.fragment,l),g(ye.$$.fragment,l),g(me.$$.fragment,l),g(re.$$.fragment,l),sn=!0)},o(l){C(y.$$.fragment,l),C(j.$$.fragment,l),C(w.$$.fragment,l),C(d.$$.fragment,l),C(el.$$.fragment,l),C(nl.$$.fragment,l),C(Jl.$$.fragment,l),C(ol.$$.fragment,l),C(yl.$$.fragment,l),C(ul.$$.fragment,l),C(cl.$$.fragment,l),C(q.$$.fragment,l),C(bl.$$.fragment,l),C(jl.$$.fragment,l),C(kl.$$.fragment,l),C(Rl.$$.fragment,l),C(Nl.$$.fragment,l),C(El.$$.fragment,l),C(Sl.$$.fragment,l),C(Hl.$$.fragment,l),C(Dl.$$.fragment,l),C(P.$$.fragment,l),C(Pl.$$.fragment,l),C(Kl.$$.fragment,l),C(Te.$$.fragment,l),C(Je.$$.fragment,l),C(Ue.$$.fragment,l),C(we.$$.fragment,l),C(ye.$$.fragment,l),C(me.$$.fragment,l),C(re.$$.fragment,l),sn=!1},d(l){l&&(e(k),e(o),e(m),e(p),e(Z),e(Q),e(R),e(N),e(M),e(B),e($),e(E),e(We),e(sl),e(Qe),e(Tl),e(Fe),e(ve),e(Ml),e(Ge),e(Ul),e(Ee),e(al),e(_e),e(xe),e(il),e(Oe),e(Y),e(Se),e(wl),e(He),e(pl),e(Le),e(X),e(ze),e(De),e(dl),e(Ye),e(ml),e(Xe),e(qe),e(Pe),e(rl),e(Ke),e(Il),e(lt),e(gl),e(et),e(Cl),e(tt),e(nt),e(st),e(Tt),e(fl),e(Jt),e(Mt),e(hl),e(Ut),e(Bl),e(at),e(Vl),e(ot),e(Zl),e(it),e(wt),e($l),e(pt),e(Al),e(yt),e(dt),e(Wl),e(mt),e(Ql),e(ut),e(Fl),e(ct),e(vl),e(rt),e(Gl),e(It),e(gt),e(_l),e(Ct),e(xl),e(bt),e(Ol),e(jt),e(ft),e(kt),e(Ll),e(ht),e(zl),e(Bt),e(Vt),e(Yl),e(Zt),e(Xl),e(Rt),e($t),e(ql),e(At),e(Nt),e(K),e(Wt),e(Qt),e(le),e(Ft),e(ee),e(vt),e(te),e(Gt),e(ne),e(Et),e(se),e(_t),e(xt),e(ll),e(Ot),e(St),e(Me),e(Ht),e(Lt),e(ae),e(zt),e(oe),e(Dt),e(ie),e(Yt),e(Xt),e(pe),e(qt),e(Pt),e(de),e(Kt),e(ln),e(ue),e(en),e(ce),e(tn),e(nn),e(Ne)),e(J),b(y,l),b(j,l),b(w,l),b(d,l),b(el),b(nl),b(Jl,l),b(ol,l),b(yl,l),b(ul,l),b(cl,l),b(q,l),b(bl,l),b(jl,l),b(kl,l),b(Rl,l),b(Nl,l),b(El,l),b(Sl,l),b(Hl,l),b(Dl,l),b(P,l),b(Pl,l),b(Kl,l),b(Te,l),b(Je,l),b(Ue,l),b(we,l),b(ye,l),b(me,l),b(re,l)}}}const Xs='{"title":"에이전트 안내서","local":"agents---guided-tour","sections":[{"title":"에이전트 유형 선택: CodeAgent 또는 ToolCallingAgent","local":"choosing-an-agent-type:-codeagent-or-toolcallingagent","sections":[],"depth":2},{"title":"CodeAgent","local":"codeagent","sections":[{"title":"ToolCallingAgent","local":"toolcallingagent","sections":[],"depth":3}],"depth":2},{"title":"에이전트 구축","local":"building-your-agent","sections":[],"depth":2},{"title":"고급 에이전트 구성","local":"advanced-agent-configuration","sections":[{"title":"에이전트 종료 조건 맞춤 설정","local":"customizing-agent-termination-conditions","sections":[],"depth":3}],"depth":2},{"title":"에이전트 실행 검사","local":"inspecting-an-agent-run","sections":[],"depth":2},{"title":"도구","local":"tools","sections":[{"title":"기본 툴박스","local":"default-toolbox","sections":[],"depth":3},{"title":"새로운 도구 생성","local":"create-a-new-tool","sections":[],"depth":3}],"depth":2},{"title":"멀티 에이전트","local":"multi-agents","sections":[],"depth":2},{"title":"에이전트와 대화하고 멋진 Gradio 인터페이스에서 그 사고 과정을 시각화하기","local":"talk-with-your-agent-and-visualize-its-thoughts-in-a-cool-gradio-interface","sections":[],"depth":2},{"title":"다음 단계","local":"next-steps","sections":[],"depth":2}],"depth":1}';function qs(v){return Rs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sT extends $s{constructor(J){super(),As(this,J,qs,Ys,Zs,{})}}export{sT as component};
