import{s as KM,o as lU,n as MU}from"../chunks/scheduler.d6170356.js";import{S as UU,i as JU,g as e,s as T,r as y,A as TU,h as s,f as U,c as t,j as YM,u as a,x as n,k as XM,y as tU,a as J,v as j,d as w,t as A,w as C}from"../chunks/index.fcd4cc08.js";import{T as eU}from"../chunks/Tip.b09c67cf.js";import{C as o}from"../chunks/CodeBlock.db16bf50.js";import{H as gl,E as sU}from"../chunks/getInferenceSnippets.0f6acb26.js";function nU(Il){let i,I='Don’t hesitate to contribute your agent to the community by opening a Pull Request in the <a href="https://huggingface.co/datasets/tiny-agents/tiny-agents" rel="nofollow">tiny-agents</a> Hugging Face dataset.';return{c(){i=e("p"),i.innerHTML=I},l(g){i=s(g,"P",{"data-svelte-h":!0}),n(i)!=="svelte-1kij619"&&(i.innerHTML=I)},m(g,ol){J(g,i,ol)},p:MU,d(g){g&&U(i)}}}function yU(Il){let i,I,g,ol,u,ul,c,pM="This page compiles all the libraries and tools Hugging Face offers for agentic workflows:",cl,k,IM="<li><code>tiny-agents</code>: A lightweight toolkit for MCP-powered agents, available in both JS (<code>@huggingface/tiny-agents</code>) and Python (<code>huggingface_hub</code>).</li> <li><code>Gradio MCP Server</code>: Easily create MCP servers from Gradio apps and Spaces.</li> <li><code>smolagents</code>: a Python library that enables you to run powerful agents in a few lines of code.</li>",kl,r,rl,h,uM='<a href="https://github.com/huggingface/smolagents" rel="nofollow">smolagents</a> is a lightweight library to cover all agentic use cases, from code-writing agents to computer use, in few lines of code. It is model agnostic, supporting local models served with Hugging Face Transformers, as well as models offered with <a href="../inference-providers/index.md">Inference Providers</a>, and proprietary model providers.',hl,O,cM=`It offers a unique kind of agent :<code>CodeAgent</code>, an agent that writes its actions in Python code.
It also supports the standard agent that writes actions in JSON blobs as most other agentic frameworks do, called <code>ToolCallingAgent</code>.
To learn more about write actions in code vs JSON, check out our <a href="https://www.deeplearning.ai/short-courses/building-code-agents-with-hugging-face-smolagents/" rel="nofollow">new short course on DeepLearning.AI</a>.`,Ol,d,kM="If you want to avoid defining agents yourself, the easiest way to start an agent is through the CLI, using the <code>smolagent</code> command.",dl,m,ml,f,rM='Agents can be pushed to Hugging Face Hub as Spaces. Check out all the cool agents people have built <a href="https://huggingface.co/spaces?filter=smolagents&amp;sort=likes" rel="nofollow">here</a>.',fl,Q,hM="smolagents also supports MCP servers as tools, as follows:",Ql,V,Vl,R,OM='Learn more <a href="https://huggingface.co/docs/smolagents/tutorials/tools#use-mcp-tools-with-mcpclient-directly" rel="nofollow">in the documentation</a>.',Rl,N,Nl,F,dM="<code>tiny-agents</code> is a lightweight toolkit for running and building MCP-powered agents on top of the Hugging Face Inference Client + Model Context Protocol (MCP). It is available as a JS package <code>@huggingface/tiny-agents</code> and in the <code>huggingface_hub</code> Python package.",Fl,D,Dl,b,mM="The <code>@huggingface/tiny-agents</code> package offers a simple and straightforward CLI and a simple programmatic API for running and building MCP-powered agents in JS.",bl,v,fM="<strong>Getting Started</strong>",vl,$,QM="First, you need to install the package:",$l,B,Bl,Z,VM="Then, you can your agent:",Zl,S,Sl,E,RM='You can load agents directly from the <a href="https://huggingface.co/datasets/tiny-agents/tiny-agents" rel="nofollow">tiny-agents</a> Dataset, or specify a path to your own local agent configuration.',El,H,NM=`<strong>Advanced Usage</strong>
In addition to the CLI, you can use the <code>Agent</code> class for more fine-grained control. For lower-level interactions, use the <code>MCPClient</code> from the <code>@huggingface/mcp-client</code> package to connect directly to MCP servers and manage tool calls.`,Hl,q,FM='Learn more about tiny-agents in the <a href="https://huggingface.co/docs/huggingface.js/en/tiny-agents/README" rel="nofollow">huggingface.js documentation</a>.',ql,G,Gl,W,DM='The <code>huggingface_hub</code> library is the easiest way to run MCP-powered agents in Python. It includes a high-level <code>tiny-agents</code> CLI as well as programmatic access via the <code>Agent</code> and <code>MCPClient</code> classes — all built to work with <a href="https://huggingface.co/docs/inference-providers/index" rel="nofollow">Hugging Face Inference Providers</a>, local LLMs, or any inference endpoint compatible with OpenAI’s API specs.',Wl,x,bM="<strong>Getting started</strong>",xl,P,vM="Install the latest version with MCP support:",Pl,L,Ll,_,$M="Then, you can run your agent:",_l,z,zl,Y,BM="The CLI pulls the config, connects to its MCP servers, prints the available tools, and waits for your prompt.",Yl,X,ZM="<strong>Advanced Usage</strong>",Xl,K,SM="For more fine-grained control, use the <code>MCPClient</code> directly. This low-level interface extends <code>AsyncInferenceClient</code> and allows LLMs to call tools via the Model Context Protocol (MCP). It supports both local (<code>stdio</code>) and remote (<code>http</code>/<code>sse</code>) MCP servers, handles tool registration and execution, and streams results back to the model in real-time.",Kl,ll,EM='Learn more in the <a href="https://huggingface.co/docs/huggingface_hub/main/en/package_reference/mcp" rel="nofollow"><code>huggingface_hub</code> MCP documentation</a>.',lM,Ml,MM,Ul,HM=`To create your own agent, simply create a folder (e.g., <code>my-agent/</code>) and define your agent’s configuration in an <code>agent.json</code> file.
The following example shows a web-browsing agent configured to use the <a href="https://huggingface.co/Qwen/Qwen2.5-72B-Instruct" rel="nofollow">Qwen/Qwen2.5-72B-Instruct</a> model via Nebius inference provider, and it comes equipped with a playwright MCP server, which lets it use a web browser`,UM,Jl,JM,Tl,qM='To use a local LLM (such as <a href="https://github.com/ggerganov/llama.cpp" rel="nofollow">llama.cpp</a>, or <a href="https://lmstudio.ai/" rel="nofollow">LM Studio</a>), just provide an <code>endpointUrl</code>:',TM,tl,tM,el,GM="Optionally, add a <code>PROMPT.md</code> to customize the system prompt.",eM,p,sM,sl,nM,nl,WM="You can build an MCP server in just a few lines of Python with Gradio. If you have an existing Gradio app or Space you’d like to use as an MCP server / tool, it’s just a single-line change.",yM,yl,xM="To make a Gradio application an MCP server, simply pass in <code>mcp_server=True</code> when launching your demo like follows.",aM,al,jM,jl,PM="The MCP server will be available at <code>http://your-space-id.hf.space/gradio_api/mcp/sse</code> where your application is served. It will have a tool corresponding to each function in your Gradio app, with the tool description automatically generated from the docstrings of your functions.",wM,wl,LM="Lastly, add this to the settings of the MCP Client of your choice (e.g. Cursor).",AM,Al,CM,Cl,_M='This is very powerful because it lets the LLM use any Gradio application as a tool. You can find thousands of them on <a href="https://huggingface.co/spaces" rel="nofollow">Spaces</a>. Learn more <a href="https://www.gradio.app/guides/building-mcp-server-with-gradio" rel="nofollow">here</a>.',iM,il,gM,pl,oM;return u=new gl({props:{title:"Agents on the Hub",local:"agents-on-the-hub",headingTag:"h1"}}),r=new gl({props:{title:"smolagents",local:"smolagents",headingTag:"h2"}}),m=new o({props:{code:"c21vbGFnZW50JTIwJTIyUGxhbiUyMGElMjB0cmlwJTIwdG8lMjBUb2t5byUyQyUyMEt5b3RvJTIwYW5kJTIwT3Nha2ElMjBiZXR3ZWVuJTIwTWFyJTIwMjglMjBhbmQlMjBBcHIlMjA3LiUyMiUyMCU1QyUwQS0tbW9kZWwtdHlwZSUyMCUyMkluZmVyZW5jZUNsaWVudE1vZGVsJTIyJTIwJTVDJTBBLS1tb2RlbC1pZCUyMCUyMlF3ZW4lMkZRd2VuMi41LUNvZGVyLTMyQi1JbnN0cnVjdCUyMiUyMCU1QyUwQS0taW1wb3J0cyUyMCUyMnBhbmRhcyUyMG51bXB5JTIyJTIwJTVDJTBBLS10b29scyUyMCUyMndlYl9zZWFyY2glMjI=",highlighted:`smolagent <span class="hljs-string">&quot;Plan a trip to Tokyo, Kyoto and Osaka between Mar 28 and Apr 7.&quot;</span> \\
--model-type <span class="hljs-string">&quot;InferenceClientModel&quot;</span> \\
--model-id <span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span> \\
--imports <span class="hljs-string">&quot;pandas numpy&quot;</span> \\
--tools <span class="hljs-string">&quot;web_search&quot;</span>`,wrap:!1}}),V=new o({props:{code:"JTIzJTIwcGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZSUyMHNtb2xhZ2VudHMlMjBtY3AlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyME1DUENsaWVudCUyQyUyMENvZGVBZ2VudCUwQWZyb20lMjBtY3AlMjBpbXBvcnQlMjBTdGRpb1NlcnZlclBhcmFtZXRlcnMlMEFpbXBvcnQlMjBvcyUwQSUwQXNlcnZlcl9wYXJhbWV0ZXJzJTIwJTNEJTIwU3RkaW9TZXJ2ZXJQYXJhbWV0ZXJzKCUwQSUyMCUyMCUyMCUyMGNvbW1hbmQlM0QlMjJ1dnglMjIlMkMlMjAlMjAlMjMlMjBVc2luZyUyMHV2eCUyMGVuc3VyZXMlMjBkZXBlbmRlbmNpZXMlMjBhcmUlMjBhdmFpbGFibGUlMEElMjAlMjAlMjAlMjBhcmdzJTNEJTVCJTIyLS1xdWlldCUyMiUyQyUyMCUyMnB1Ym1lZG1jcCU0MDAuMS4zJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwZW52JTNEJTdCJTIyVVZfUFlUSE9OJTIyJTNBJTIwJTIyMy4xMiUyMiUyQyUyMCoqb3MuZW52aXJvbiU3RCUyQyUwQSklMEElMEF3aXRoJTIwTUNQQ2xpZW50KHNlcnZlcl9wYXJhbWV0ZXJzKSUyMGFzJTIwdG9vbHMlM0ElMEElMjAlMjAlMjAlMjBhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRHRvb2xzJTJDJTIwbW9kZWwlM0Rtb2RlbCUyQyUyMGFkZF9iYXNlX3Rvb2xzJTNEVHJ1ZSklMEElMjAlMjAlMjAlMjBhZ2VudC5ydW4oJTIyUGxlYXNlJTIwZmluZCUyMHRoZSUyMGxhdGVzdCUyMHJlc2VhcmNoJTIwb24lMjBDT1ZJRC0xOSUyMHRyZWF0bWVudC4lMjIp",highlighted:`<span class="hljs-comment"># pip install --upgrade smolagents mcp</span>
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> MCPClient, CodeAgent
<span class="hljs-keyword">from</span> mcp <span class="hljs-keyword">import</span> StdioServerParameters
<span class="hljs-keyword">import</span> os

server_parameters = StdioServerParameters(
    command=<span class="hljs-string">&quot;uvx&quot;</span>,  <span class="hljs-comment"># Using uvx ensures dependencies are available</span>
    args=[<span class="hljs-string">&quot;--quiet&quot;</span>, <span class="hljs-string">&quot;pubmedmcp@0.1.3&quot;</span>],
    env={<span class="hljs-string">&quot;UV_PYTHON&quot;</span>: <span class="hljs-string">&quot;3.12&quot;</span>, **os.environ},
)

<span class="hljs-keyword">with</span> MCPClient(server_parameters) <span class="hljs-keyword">as</span> tools:
    agent = CodeAgent(tools=tools, model=model, add_base_tools=<span class="hljs-literal">True</span>)
    agent.run(<span class="hljs-string">&quot;Please find the latest research on COVID-19 treatment.&quot;</span>)`,wrap:!1}}),N=new gl({props:{title:"tiny-agents (JS and Python)",local:"tiny-agents-js-and-python",headingTag:"h2"}}),D=new gl({props:{title:"@huggingface/tiny-agents (JS)",local:"huggingfacetiny-agents-js",headingTag:"h3"}}),B=new o({props:{code:"bnBtJTIwaW5zdGFsbCUyMCU0MGh1Z2dpbmdmYWNlJTJGdGlueS1hZ2VudHMlMEElMjMlMjBvciUwQXBucG0lMjBhZGQlMjAlNDBodWdnaW5nZmFjZSUyRnRpbnktYWdlbnRz",highlighted:`npm install @huggingface/tiny-agents
<span class="hljs-comment"># or</span>
pnpm add @huggingface/tiny-agents`,wrap:!1}}),S=new o({props:{code:"bnB4JTIwJTQwaHVnZ2luZ2ZhY2UlMkZ0aW55LWFnZW50cyUyMCU1QmNvbW1hbmQlNUQlMjAlMjJhZ2VudCUyRmlkJTIyJTBBJTBBVXNhZ2UlM0ElMEElMjAlMjB0aW55LWFnZW50cyUyMCU1QmZsYWdzJTVEJTBBJTIwJTIwdGlueS1hZ2VudHMlMjBydW4lMjAlMjAlMjAlMjJhZ2VudCUyRmlkJTIyJTBBJTIwJTIwdGlueS1hZ2VudHMlMjBzZXJ2ZSUyMCUyMmFnZW50JTJGaWQlMjIlMEElMEFBdmFpbGFibGUlMjBDb21tYW5kcyUzQSUwQSUyMCUyMHJ1biUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMFJ1biUyMHRoZSUyMEFnZW50JTIwaW4lMjBjb21tYW5kLWxpbmUlMEElMjAlMjBzZXJ2ZSUyMCUyMCUyMCUyMCUyMCUyMCUyMFJ1biUyMHRoZSUyMEFnZW50JTIwYXMlMjBhbiUyME9wZW5BSS1jb21wYXRpYmxlJTIwSFRUUCUyMHNlcnZlcg==",highlighted:`npx @huggingface/tiny-agents [<span class="hljs-built_in">command</span>] <span class="hljs-string">&quot;agent/id&quot;</span>

Usage:
  tiny-agents [flags]
  tiny-agents run   <span class="hljs-string">&quot;agent/id&quot;</span>
  tiny-agents serve <span class="hljs-string">&quot;agent/id&quot;</span>

Available Commands:
  run         Run the Agent <span class="hljs-keyword">in</span> command-line
  serve       Run the Agent as an OpenAI-compatible HTTP server`,wrap:!1}}),G=new gl({props:{title:"huggingface_hub (Python)",local:"huggingfacehub-python",headingTag:"h3"}}),L=new o({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMmh1Z2dpbmdmYWNlX2h1YiU1Qm1jcCU1RCUzRSUzRDAuMzIuMiUyMg==",highlighted:'pip install <span class="hljs-string">&quot;huggingface_hub[mcp]&gt;=0.32.2&quot;</span>',wrap:!1}}),z=new o({props:{code:" ",highlighted:`&gt; tiny-agents run --<span class="hljs-built_in">help</span>
                                                                                                                                                                                     
 Usage: tiny-agents run [OPTIONS] [PATH] COMMAND [ARGS]...                                                                                                                           
                                                                                                                                                                                     
 Run the Agent <span class="hljs-keyword">in</span> the CLI                                                                                                                                                            
                                                                                                                                                                                     
                                                                                                                                                                                     
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│   path      [PATH]  Path to a <span class="hljs-built_in">local</span> folder containing an agent.json file or a built-in agent stored <span class="hljs-keyword">in</span> the <span class="hljs-string">&#x27;tiny-agents/tiny-agents&#x27;</span> Hugging Face dataset                         │
│                     (https://huggingface.co/datasets/tiny-agents/tiny-agents)                                                                                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --<span class="hljs-built_in">help</span>          Show this message and <span class="hljs-built_in">exit</span>.                                                                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
`,wrap:!1}}),Ml=new gl({props:{title:"Custom Agents",local:"custom-agents",headingTag:"h3"}}),Jl=new o({props:{code:"JTdCJTBBJTA5JTIybW9kZWwlMjIlM0ElMjAlMjJRd2VuJTJGUXdlbjIuNS03MkItSW5zdHJ1Y3QlMjIlMkMlMEElMDklMjJwcm92aWRlciUyMiUzQSUyMCUyMm5lYml1cyUyMiUyQyUwQSUwOSUyMnNlcnZlcnMlMjIlM0ElMjAlNUIlMEElMDklMDklN0IlMEElMDklMDklMDklMjJ0eXBlJTIyJTNBJTIwJTIyc3RkaW8lMjIlMkMlMEElMDklMDklMDklMjJjb25maWclMjIlM0ElMjAlN0IlMEElMDklMDklMDklMDklMjJjb21tYW5kJTIyJTNBJTIwJTIybnB4JTIyJTJDJTBBJTA5JTA5JTA5JTA5JTIyYXJncyUyMiUzQSUyMCU1QiUyMiU0MHBsYXl3cmlnaHQlMkZtY3AlNDBsYXRlc3QlMjIlNUQlMEElMDklMDklMDklN0QlMEElMDklMDklN0QlMEElMDklNUQlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span>
	<span class="hljs-attr">&quot;model&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Qwen/Qwen2.5-72B-Instruct&quot;</span><span class="hljs-punctuation">,</span>
	<span class="hljs-attr">&quot;provider&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;nebius&quot;</span><span class="hljs-punctuation">,</span>
	<span class="hljs-attr">&quot;servers&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
		<span class="hljs-punctuation">{</span>
			<span class="hljs-attr">&quot;type&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;stdio&quot;</span><span class="hljs-punctuation">,</span>
			<span class="hljs-attr">&quot;config&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
				<span class="hljs-attr">&quot;command&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;npx&quot;</span><span class="hljs-punctuation">,</span>
				<span class="hljs-attr">&quot;args&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">&quot;@playwright/mcp@latest&quot;</span><span class="hljs-punctuation">]</span>
			<span class="hljs-punctuation">}</span>
		<span class="hljs-punctuation">}</span>
	<span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),tl=new o({props:{code:"JTdCJTBBJTA5JTIybW9kZWwlMjIlM0ElMjAlMjJRd2VuJTJGUXdlbjMtMzJCJTIyJTJDJTBBJTA5JTIyZW5kcG9pbnRVcmwlMjIlM0ElMjAlMjJodHRwJTNBJTJGJTJGbG9jYWxob3N0JTNBMTIzNCUyRnYxJTIyJTJDJTBBJTA5JTIyc2VydmVycyUyMiUzQSUyMCU1QiUwQSUwOSUwOSU3QiUwQSUwOSUwOSUwOSUyMnR5cGUlMjIlM0ElMjAlMjJzdGRpbyUyMiUyQyUwQSUwOSUwOSUwOSUyMmNvbmZpZyUyMiUzQSUyMCU3QiUwQSUwOSUwOSUwOSUwOSUyMmNvbW1hbmQlMjIlM0ElMjAlMjJucHglMjIlMkMlMEElMDklMDklMDklMDklMjJhcmdzJTIyJTNBJTIwJTVCJTIyJTQwcGxheXdyaWdodCUyRm1jcCU0MGxhdGVzdCUyMiU1RCUwQSUwOSUwOSUwOSU3RCUwQSUwOSUwOSU3RCUwQSUwOSU1RCUwQSU3RCUwQQ==",highlighted:`<span class="hljs-punctuation">{</span>
	<span class="hljs-attr">&quot;model&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;Qwen/Qwen3-32B&quot;</span><span class="hljs-punctuation">,</span>
	<span class="hljs-attr">&quot;endpointUrl&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;http://localhost:1234/v1&quot;</span><span class="hljs-punctuation">,</span>
	<span class="hljs-attr">&quot;servers&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span>
		<span class="hljs-punctuation">{</span>
			<span class="hljs-attr">&quot;type&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;stdio&quot;</span><span class="hljs-punctuation">,</span>
			<span class="hljs-attr">&quot;config&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
				<span class="hljs-attr">&quot;command&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;npx&quot;</span><span class="hljs-punctuation">,</span>
				<span class="hljs-attr">&quot;args&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">&quot;@playwright/mcp@latest&quot;</span><span class="hljs-punctuation">]</span>
			<span class="hljs-punctuation">}</span>
		<span class="hljs-punctuation">}</span>
	<span class="hljs-punctuation">]</span>
<span class="hljs-punctuation">}</span>
`,wrap:!1}}),p=new eU({props:{$$slots:{default:[nU]},$$scope:{ctx:Il}}}),sl=new gl({props:{title:"Gradio MCP Server / Tools",local:"gradio-mcp-server--tools",headingTag:"h2"}}),al=new o({props:{code:"JTIzJUMyJUEwcGlwJTIwaW5zdGFsbCUyMGdyYWRpbyUwQSUwQWltcG9ydCUyMGdyYWRpbyUyMGFzJTIwZ3IlMEElMEFkZWYlMjBnZW5lcmF0ZV9pbWFnZShwcm9tcHQlM0ElMjBzdHIpJTNBJTBBJTIwJTIwJTIwJTIyJTIyJTIyJTBBJTIwJTIwJTIwR2VuZXJhdGUlMjBhbiUyMGltYWdlJTIwYmFzZWQlMjBvbiUyMGElMjB0ZXh0JTIwcHJvbXB0JTBBJTIwJTIwJTIwJTBBJTIwJTIwJTIwQXJncyUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMHByb21wdCUzQSUyMGElMjB0ZXh0JTIwc3RyaW5nJTIwZGVzY3JpYmluZyUyMHRoZSUyMGltYWdlJTIwdG8lMjBnZW5lcmF0ZSUwQSUyMCUyMCUyMCUyMiUyMiUyMiUwQSUyMCUyMCUyMHBhc3MlMEElMEFkZW1vJTIwJTNEJTIwZ3IuSW50ZXJmYWNlKCUwQSUyMCUyMCUyMCUyMGZuJTNEZ2VuZXJhdGVfaW1hZ2UlMkMlMEElMjAlMjAlMjAlMjBpbnB1dHMlM0QlMjJ0ZXh0JTIyJTJDJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUzRCUyMmltYWdlJTIyJTJDJTBBJTIwJTIwJTIwJTIwdGl0bGUlM0QlMjJJbWFnZSUyMEdlbmVyYXRvciUyMiUwQSklMEElMEFkZW1vLmxhdW5jaChtY3Bfc2VydmVyJTNEVHJ1ZSk=",highlighted:`<span class="hljs-comment"># pip install gradio</span>

<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr

<span class="hljs-keyword">def</span> <span class="hljs-title function_">generate_image</span>(<span class="hljs-params">prompt: <span class="hljs-built_in">str</span></span>):
   <span class="hljs-string">&quot;&quot;&quot;
   Generate an image based on a text prompt
   
   Args:
       prompt: a text string describing the image to generate
   &quot;&quot;&quot;</span>
   <span class="hljs-keyword">pass</span>

demo = gr.Interface(
    fn=generate_image,
    inputs=<span class="hljs-string">&quot;text&quot;</span>,
    outputs=<span class="hljs-string">&quot;image&quot;</span>,
    title=<span class="hljs-string">&quot;Image Generator&quot;</span>
)

demo.launch(mcp_server=<span class="hljs-literal">True</span>)`,wrap:!1}}),Al=new o({props:{code:"JTdCJTBBJTIwJTIwJTIybWNwU2VydmVycyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmdyYWRpbyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMnVybCUyMiUzQSUyMCUyMmh0dHAlM0ElMkYlMkZ5b3VyLXNlcnZlciUzQXBvcnQlMkZncmFkaW9fYXBpJTJGbWNwJTJGc3NlJTIyJTBBJTIwJTIwJTIwJTIwJTdEJTBBJTIwJTIwJTdEJTBBJTdE",highlighted:`<span class="hljs-punctuation">{</span>
  <span class="hljs-attr">&quot;mcpServers&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
    <span class="hljs-attr">&quot;gradio&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span>
      <span class="hljs-attr">&quot;url&quot;</span><span class="hljs-punctuation">:</span> <span class="hljs-string">&quot;http://your-server:port/gradio_api/mcp/sse&quot;</span>
    <span class="hljs-punctuation">}</span>
  <span class="hljs-punctuation">}</span>
<span class="hljs-punctuation">}</span>`,wrap:!1}}),il=new sU({props:{source:"https://github.com/huggingface/hub-docs/blob/main/docs/hub/agents.md"}}),{c(){i=e("meta"),I=T(),g=e("p"),ol=T(),y(u.$$.fragment),ul=T(),c=e("p"),c.textContent=pM,cl=T(),k=e("ul"),k.innerHTML=IM,kl=T(),y(r.$$.fragment),rl=T(),h=e("p"),h.innerHTML=uM,hl=T(),O=e("p"),O.innerHTML=cM,Ol=T(),d=e("p"),d.innerHTML=kM,dl=T(),y(m.$$.fragment),ml=T(),f=e("p"),f.innerHTML=rM,fl=T(),Q=e("p"),Q.textContent=hM,Ql=T(),y(V.$$.fragment),Vl=T(),R=e("p"),R.innerHTML=OM,Rl=T(),y(N.$$.fragment),Nl=T(),F=e("p"),F.innerHTML=dM,Fl=T(),y(D.$$.fragment),Dl=T(),b=e("p"),b.innerHTML=mM,bl=T(),v=e("p"),v.innerHTML=fM,vl=T(),$=e("p"),$.textContent=QM,$l=T(),y(B.$$.fragment),Bl=T(),Z=e("p"),Z.textContent=VM,Zl=T(),y(S.$$.fragment),Sl=T(),E=e("p"),E.innerHTML=RM,El=T(),H=e("p"),H.innerHTML=NM,Hl=T(),q=e("p"),q.innerHTML=FM,ql=T(),y(G.$$.fragment),Gl=T(),W=e("p"),W.innerHTML=DM,Wl=T(),x=e("p"),x.innerHTML=bM,xl=T(),P=e("p"),P.textContent=vM,Pl=T(),y(L.$$.fragment),Ll=T(),_=e("p"),_.textContent=$M,_l=T(),y(z.$$.fragment),zl=T(),Y=e("p"),Y.textContent=BM,Yl=T(),X=e("p"),X.innerHTML=ZM,Xl=T(),K=e("p"),K.innerHTML=SM,Kl=T(),ll=e("p"),ll.innerHTML=EM,lM=T(),y(Ml.$$.fragment),MM=T(),Ul=e("p"),Ul.innerHTML=HM,UM=T(),y(Jl.$$.fragment),JM=T(),Tl=e("p"),Tl.innerHTML=qM,TM=T(),y(tl.$$.fragment),tM=T(),el=e("p"),el.innerHTML=GM,eM=T(),y(p.$$.fragment),sM=T(),y(sl.$$.fragment),nM=T(),nl=e("p"),nl.textContent=WM,yM=T(),yl=e("p"),yl.innerHTML=xM,aM=T(),y(al.$$.fragment),jM=T(),jl=e("p"),jl.innerHTML=PM,wM=T(),wl=e("p"),wl.textContent=LM,AM=T(),y(Al.$$.fragment),CM=T(),Cl=e("p"),Cl.innerHTML=_M,iM=T(),y(il.$$.fragment),gM=T(),pl=e("p"),this.h()},l(l){const M=TU("svelte-u9bgzb",document.head);i=s(M,"META",{name:!0,content:!0}),M.forEach(U),I=t(l),g=s(l,"P",{}),YM(g).forEach(U),ol=t(l),a(u.$$.fragment,l),ul=t(l),c=s(l,"P",{"data-svelte-h":!0}),n(c)!=="svelte-uybl9t"&&(c.textContent=pM),cl=t(l),k=s(l,"UL",{"data-svelte-h":!0}),n(k)!=="svelte-1luyfud"&&(k.innerHTML=IM),kl=t(l),a(r.$$.fragment,l),rl=t(l),h=s(l,"P",{"data-svelte-h":!0}),n(h)!=="svelte-1l4edi5"&&(h.innerHTML=uM),hl=t(l),O=s(l,"P",{"data-svelte-h":!0}),n(O)!=="svelte-6cz8i9"&&(O.innerHTML=cM),Ol=t(l),d=s(l,"P",{"data-svelte-h":!0}),n(d)!=="svelte-18u3l69"&&(d.innerHTML=kM),dl=t(l),a(m.$$.fragment,l),ml=t(l),f=s(l,"P",{"data-svelte-h":!0}),n(f)!=="svelte-1296ipl"&&(f.innerHTML=rM),fl=t(l),Q=s(l,"P",{"data-svelte-h":!0}),n(Q)!=="svelte-1dgx75v"&&(Q.textContent=hM),Ql=t(l),a(V.$$.fragment,l),Vl=t(l),R=s(l,"P",{"data-svelte-h":!0}),n(R)!=="svelte-1bky1ee"&&(R.innerHTML=OM),Rl=t(l),a(N.$$.fragment,l),Nl=t(l),F=s(l,"P",{"data-svelte-h":!0}),n(F)!=="svelte-12fep30"&&(F.innerHTML=dM),Fl=t(l),a(D.$$.fragment,l),Dl=t(l),b=s(l,"P",{"data-svelte-h":!0}),n(b)!=="svelte-170yil8"&&(b.innerHTML=mM),bl=t(l),v=s(l,"P",{"data-svelte-h":!0}),n(v)!=="svelte-qtgy0c"&&(v.innerHTML=fM),vl=t(l),$=s(l,"P",{"data-svelte-h":!0}),n($)!=="svelte-1w4rzaq"&&($.textContent=QM),$l=t(l),a(B.$$.fragment,l),Bl=t(l),Z=s(l,"P",{"data-svelte-h":!0}),n(Z)!=="svelte-16su98k"&&(Z.textContent=VM),Zl=t(l),a(S.$$.fragment,l),Sl=t(l),E=s(l,"P",{"data-svelte-h":!0}),n(E)!=="svelte-1cmjtr9"&&(E.innerHTML=RM),El=t(l),H=s(l,"P",{"data-svelte-h":!0}),n(H)!=="svelte-m1ruvs"&&(H.innerHTML=NM),Hl=t(l),q=s(l,"P",{"data-svelte-h":!0}),n(q)!=="svelte-bbaapj"&&(q.innerHTML=FM),ql=t(l),a(G.$$.fragment,l),Gl=t(l),W=s(l,"P",{"data-svelte-h":!0}),n(W)!=="svelte-37noht"&&(W.innerHTML=DM),Wl=t(l),x=s(l,"P",{"data-svelte-h":!0}),n(x)!=="svelte-1nllubw"&&(x.innerHTML=bM),xl=t(l),P=s(l,"P",{"data-svelte-h":!0}),n(P)!=="svelte-afwxt0"&&(P.textContent=vM),Pl=t(l),a(L.$$.fragment,l),Ll=t(l),_=s(l,"P",{"data-svelte-h":!0}),n(_)!=="svelte-e7kx1l"&&(_.textContent=$M),_l=t(l),a(z.$$.fragment,l),zl=t(l),Y=s(l,"P",{"data-svelte-h":!0}),n(Y)!=="svelte-1qfxace"&&(Y.textContent=BM),Yl=t(l),X=s(l,"P",{"data-svelte-h":!0}),n(X)!=="svelte-1x3whta"&&(X.innerHTML=ZM),Xl=t(l),K=s(l,"P",{"data-svelte-h":!0}),n(K)!=="svelte-d0b3nb"&&(K.innerHTML=SM),Kl=t(l),ll=s(l,"P",{"data-svelte-h":!0}),n(ll)!=="svelte-vm7dnh"&&(ll.innerHTML=EM),lM=t(l),a(Ml.$$.fragment,l),MM=t(l),Ul=s(l,"P",{"data-svelte-h":!0}),n(Ul)!=="svelte-ovi071"&&(Ul.innerHTML=HM),UM=t(l),a(Jl.$$.fragment,l),JM=t(l),Tl=s(l,"P",{"data-svelte-h":!0}),n(Tl)!=="svelte-1v3djgc"&&(Tl.innerHTML=qM),TM=t(l),a(tl.$$.fragment,l),tM=t(l),el=s(l,"P",{"data-svelte-h":!0}),n(el)!=="svelte-1mi2sgf"&&(el.innerHTML=GM),eM=t(l),a(p.$$.fragment,l),sM=t(l),a(sl.$$.fragment,l),nM=t(l),nl=s(l,"P",{"data-svelte-h":!0}),n(nl)!=="svelte-98db42"&&(nl.textContent=WM),yM=t(l),yl=s(l,"P",{"data-svelte-h":!0}),n(yl)!=="svelte-1i1xz1q"&&(yl.innerHTML=xM),aM=t(l),a(al.$$.fragment,l),jM=t(l),jl=s(l,"P",{"data-svelte-h":!0}),n(jl)!=="svelte-7c34et"&&(jl.innerHTML=PM),wM=t(l),wl=s(l,"P",{"data-svelte-h":!0}),n(wl)!=="svelte-jrre7u"&&(wl.textContent=LM),AM=t(l),a(Al.$$.fragment,l),CM=t(l),Cl=s(l,"P",{"data-svelte-h":!0}),n(Cl)!=="svelte-17ayo9g"&&(Cl.innerHTML=_M),iM=t(l),a(il.$$.fragment,l),gM=t(l),pl=s(l,"P",{}),YM(pl).forEach(U),this.h()},h(){XM(i,"name","hf:doc:metadata"),XM(i,"content",aU)},m(l,M){tU(document.head,i),J(l,I,M),J(l,g,M),J(l,ol,M),j(u,l,M),J(l,ul,M),J(l,c,M),J(l,cl,M),J(l,k,M),J(l,kl,M),j(r,l,M),J(l,rl,M),J(l,h,M),J(l,hl,M),J(l,O,M),J(l,Ol,M),J(l,d,M),J(l,dl,M),j(m,l,M),J(l,ml,M),J(l,f,M),J(l,fl,M),J(l,Q,M),J(l,Ql,M),j(V,l,M),J(l,Vl,M),J(l,R,M),J(l,Rl,M),j(N,l,M),J(l,Nl,M),J(l,F,M),J(l,Fl,M),j(D,l,M),J(l,Dl,M),J(l,b,M),J(l,bl,M),J(l,v,M),J(l,vl,M),J(l,$,M),J(l,$l,M),j(B,l,M),J(l,Bl,M),J(l,Z,M),J(l,Zl,M),j(S,l,M),J(l,Sl,M),J(l,E,M),J(l,El,M),J(l,H,M),J(l,Hl,M),J(l,q,M),J(l,ql,M),j(G,l,M),J(l,Gl,M),J(l,W,M),J(l,Wl,M),J(l,x,M),J(l,xl,M),J(l,P,M),J(l,Pl,M),j(L,l,M),J(l,Ll,M),J(l,_,M),J(l,_l,M),j(z,l,M),J(l,zl,M),J(l,Y,M),J(l,Yl,M),J(l,X,M),J(l,Xl,M),J(l,K,M),J(l,Kl,M),J(l,ll,M),J(l,lM,M),j(Ml,l,M),J(l,MM,M),J(l,Ul,M),J(l,UM,M),j(Jl,l,M),J(l,JM,M),J(l,Tl,M),J(l,TM,M),j(tl,l,M),J(l,tM,M),J(l,el,M),J(l,eM,M),j(p,l,M),J(l,sM,M),j(sl,l,M),J(l,nM,M),J(l,nl,M),J(l,yM,M),J(l,yl,M),J(l,aM,M),j(al,l,M),J(l,jM,M),J(l,jl,M),J(l,wM,M),J(l,wl,M),J(l,AM,M),j(Al,l,M),J(l,CM,M),J(l,Cl,M),J(l,iM,M),j(il,l,M),J(l,gM,M),J(l,pl,M),oM=!0},p(l,[M]){const zM={};M&2&&(zM.$$scope={dirty:M,ctx:l}),p.$set(zM)},i(l){oM||(w(u.$$.fragment,l),w(r.$$.fragment,l),w(m.$$.fragment,l),w(V.$$.fragment,l),w(N.$$.fragment,l),w(D.$$.fragment,l),w(B.$$.fragment,l),w(S.$$.fragment,l),w(G.$$.fragment,l),w(L.$$.fragment,l),w(z.$$.fragment,l),w(Ml.$$.fragment,l),w(Jl.$$.fragment,l),w(tl.$$.fragment,l),w(p.$$.fragment,l),w(sl.$$.fragment,l),w(al.$$.fragment,l),w(Al.$$.fragment,l),w(il.$$.fragment,l),oM=!0)},o(l){A(u.$$.fragment,l),A(r.$$.fragment,l),A(m.$$.fragment,l),A(V.$$.fragment,l),A(N.$$.fragment,l),A(D.$$.fragment,l),A(B.$$.fragment,l),A(S.$$.fragment,l),A(G.$$.fragment,l),A(L.$$.fragment,l),A(z.$$.fragment,l),A(Ml.$$.fragment,l),A(Jl.$$.fragment,l),A(tl.$$.fragment,l),A(p.$$.fragment,l),A(sl.$$.fragment,l),A(al.$$.fragment,l),A(Al.$$.fragment,l),A(il.$$.fragment,l),oM=!1},d(l){l&&(U(I),U(g),U(ol),U(ul),U(c),U(cl),U(k),U(kl),U(rl),U(h),U(hl),U(O),U(Ol),U(d),U(dl),U(ml),U(f),U(fl),U(Q),U(Ql),U(Vl),U(R),U(Rl),U(Nl),U(F),U(Fl),U(Dl),U(b),U(bl),U(v),U(vl),U($),U($l),U(Bl),U(Z),U(Zl),U(Sl),U(E),U(El),U(H),U(Hl),U(q),U(ql),U(Gl),U(W),U(Wl),U(x),U(xl),U(P),U(Pl),U(Ll),U(_),U(_l),U(zl),U(Y),U(Yl),U(X),U(Xl),U(K),U(Kl),U(ll),U(lM),U(MM),U(Ul),U(UM),U(JM),U(Tl),U(TM),U(tM),U(el),U(eM),U(sM),U(nM),U(nl),U(yM),U(yl),U(aM),U(jM),U(jl),U(wM),U(wl),U(AM),U(CM),U(Cl),U(iM),U(gM),U(pl)),U(i),C(u,l),C(r,l),C(m,l),C(V,l),C(N,l),C(D,l),C(B,l),C(S,l),C(G,l),C(L,l),C(z,l),C(Ml,l),C(Jl,l),C(tl,l),C(p,l),C(sl,l),C(al,l),C(Al,l),C(il,l)}}}const aU='{"title":"Agents on the Hub","local":"agents-on-the-hub","sections":[{"title":"smolagents","local":"smolagents","sections":[],"depth":2},{"title":"tiny-agents (JS and Python)","local":"tiny-agents-js-and-python","sections":[{"title":"@huggingface/tiny-agents (JS)","local":"huggingfacetiny-agents-js","sections":[],"depth":3},{"title":"huggingface_hub (Python)","local":"huggingfacehub-python","sections":[],"depth":3},{"title":"Custom Agents","local":"custom-agents","sections":[],"depth":3}],"depth":2},{"title":"Gradio MCP Server / Tools","local":"gradio-mcp-server--tools","sections":[],"depth":2}],"depth":1}';function jU(Il){return lU(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class oU extends UU{constructor(i){super(),JU(this,i,jU,yU,KM,{})}}export{oU as component};
