import{s as Ct,f as xt,n as kt,o as At}from"../chunks/scheduler.37c15a92.js";import{S as Pt,i as Lt,g as i,s as a,r as M,A as St,h as s,f as n,c as l,j as it,u as E,x as r,k as u,y as Tt,a as o,v as I,d as Y,t as j,w as B}from"../chunks/index.2bf4358c.js";import{H as st}from"../chunks/Heading.8ada512a.js";import{E as Ht}from"../chunks/index.f9c0018f.js";function Mt(rt){let m,F,T,O,g,R,f,pt="It’s now time to battle! ⚡️",q,c,U,w,ht='If you don’t feel like building your own agent, and you’re just curious about the battle potential of agents in pokémon. We are hosting an automated livestream on <a href="https://www.twitch.tv/jofthomas" rel="nofollow">twitch</a>',z,p,ut,D,d,mt="To battle the agent in stream you can:",G,b,gt="Instructions:",W,v,ft='<li>Go to the <strong>Pokémon Showdown Space</strong>: <a href="https://huggingface.co/spaces/Jofthomas/Pokemon_showdown" rel="nofollow">Link Here</a></li> <li><strong>Choose Your Name</strong> (Top-right corner).</li> <li>Find the <strong>Current Agent’s Username</strong>. Check:<ul><li>The <strong>Stream Display</strong>: <a href="https://www.twitch.tv/jofthomas" rel="nofollow">Link Here</a></li></ul></li> <li><strong>Search</strong> for that username on the Showdown Space and <strong>Send a Battle Invitation</strong>.</li>',J,$,ct="<em>Heads Up:</em> Only one agent is online at once! Make sure you’ve got the right name.",N,_,K,y,wt="If you’ve created your own Pokémon Battle Agent from the last section, you’re probably wondering: <strong>how can I test it against others?</strong> Let’s find out!",Q,x,dt='We’ve built a dedicated <a href="https://huggingface.co/spaces/PShowdown/pokemon_agents" rel="nofollow">Hugging Face Space</a> for this purpose:',V,h,bt,X,C,vt="This Space is connected to our own <strong>Pokémon Showdown server</strong>, where your Agent can take on others in epic AI-powered battles.",Z,k,tt,A,$t="Follow these steps to bring your Agent to life in the arena:",et,P,_t=`<li><p><strong>Duplicate the Space</strong><br/>
Click the three dots in the top-right menu of the Space and select “Duplicate this Space”.</p></li> <li><p><strong>Add Your Agent Code to <code>agent.py</code></strong><br/>
Open the file and paste your Agent implementation. You can follow this <a href="https://huggingface.co/spaces/PShowdown/pokemon_agents/blob/main/agents.py" rel="nofollow">example</a> or check out the <a href="https://huggingface.co/spaces/PShowdown/pokemon_agents/tree/main" rel="nofollow">project structure</a> for guidance.</p></li> <li><p><strong>Register Your Agent in <code>app.py</code></strong><br/>
Add your Agent’s name and logic to the dropdown menu. Refer to <a href="https://huggingface.co/spaces/PShowdown/pokemon_agents/blob/main/app.py" rel="nofollow">this snippet</a> for inspiration.</p></li> <li><p><strong>Select Your Agent</strong><br/>
Once added, your Agent will show up in the “Select Agent” dropdown menu. Pick it from the list! ✅</p></li> <li><p><strong>Enter Your Pokémon Showdown Username</strong><br/>
Make sure the username matches the one shown in the iframe’s <strong>“Choose name”</strong> input. You can also connect with your official account.</p></li> <li><p><strong>Click “Send Battle Invitation”</strong><br/>
Your Agent will send an invite to the selected opponent. It should appear on-screen!</p></li> <li><p><strong>Accept the Battle &amp; Enjoy the Fight!</strong><br/>
Let the battle begin! May the smartest Agent win</p></li>`,nt,L,yt="Ready to see your creation in action? Let the AI showdown commence! 🥊",ot,S,at,H,lt;return g=new st({props:{title:"Launching Your Pokémon Battle Agent",local:"launching-your-pokémon-battle-agent",headingTag:"h1"}}),c=new st({props:{title:"Battle the Stream Agent!",local:"battle-the-stream-agent",headingTag:"h2"}}),_=new st({props:{title:"Pokémon Battle Agent Challenger",local:"pokémon-battle-agent-challenger",headingTag:"h2"}}),k=new st({props:{title:"How to Launch Your Agent",local:"how-to-launch-your-agent",headingTag:"h3"}}),S=new Ht({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/bonus-unit3/launching_agent_battle.mdx"}}),{c(){m=i("meta"),F=a(),T=i("p"),O=a(),M(g.$$.fragment),R=a(),f=i("p"),f.textContent=pt,q=a(),M(c.$$.fragment),U=a(),w=i("p"),w.innerHTML=ht,z=a(),p=i("iframe"),D=a(),d=i("p"),d.textContent=mt,G=a(),b=i("p"),b.textContent=gt,W=a(),v=i("ol"),v.innerHTML=ft,J=a(),$=i("p"),$.innerHTML=ct,N=a(),M(_.$$.fragment),K=a(),y=i("p"),y.innerHTML=wt,Q=a(),x=i("p"),x.innerHTML=dt,V=a(),h=i("iframe"),X=a(),C=i("p"),C.innerHTML=vt,Z=a(),M(k.$$.fragment),tt=a(),A=i("p"),A.textContent=$t,et=a(),P=i("ol"),P.innerHTML=_t,nt=a(),L=i("p"),L.textContent=yt,ot=a(),M(S.$$.fragment),at=a(),H=i("p"),this.h()},l(t){const e=St("svelte-u9bgzb",document.head);m=s(e,"META",{name:!0,content:!0}),e.forEach(n),F=l(t),T=s(t,"P",{}),it(T).forEach(n),O=l(t),E(g.$$.fragment,t),R=l(t),f=s(t,"P",{"data-svelte-h":!0}),r(f)!=="svelte-axq8du"&&(f.textContent=pt),q=l(t),E(c.$$.fragment,t),U=l(t),w=s(t,"P",{"data-svelte-h":!0}),r(w)!=="svelte-jzratb"&&(w.innerHTML=ht),z=l(t),p=s(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),it(p).forEach(n),D=l(t),d=s(t,"P",{"data-svelte-h":!0}),r(d)!=="svelte-xuc57h"&&(d.textContent=mt),G=l(t),b=s(t,"P",{"data-svelte-h":!0}),r(b)!=="svelte-1hm7s0x"&&(b.textContent=gt),W=l(t),v=s(t,"OL",{"data-svelte-h":!0}),r(v)!=="svelte-6dcvcm"&&(v.innerHTML=ft),J=l(t),$=s(t,"P",{"data-svelte-h":!0}),r($)!=="svelte-57sl72"&&($.innerHTML=ct),N=l(t),E(_.$$.fragment,t),K=l(t),y=s(t,"P",{"data-svelte-h":!0}),r(y)!=="svelte-17ptu7r"&&(y.innerHTML=wt),Q=l(t),x=s(t,"P",{"data-svelte-h":!0}),r(x)!=="svelte-98lns2"&&(x.innerHTML=dt),V=l(t),h=s(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),it(h).forEach(n),X=l(t),C=s(t,"P",{"data-svelte-h":!0}),r(C)!=="svelte-ug8sqa"&&(C.innerHTML=vt),Z=l(t),E(k.$$.fragment,t),tt=l(t),A=s(t,"P",{"data-svelte-h":!0}),r(A)!=="svelte-uj1gxe"&&(A.textContent=$t),et=l(t),P=s(t,"OL",{"data-svelte-h":!0}),r(P)!=="svelte-zqc6dj"&&(P.innerHTML=_t),nt=l(t),L=s(t,"P",{"data-svelte-h":!0}),r(L)!=="svelte-1wvus4m"&&(L.textContent=yt),ot=l(t),E(S.$$.fragment,t),at=l(t),H=s(t,"P",{}),it(H).forEach(n),this.h()},h(){u(m,"name","hf:doc:metadata"),u(m,"content",Et),xt(p.src,ut="https://jofthomas-twitch-streaming.hf.space")||u(p,"src",ut),u(p,"frameborder","0"),u(p,"width","1200"),u(p,"height","600"),xt(h.src,bt="https://pshowdown-pokemon-agents.hf.space")||u(h,"src",bt),u(h,"frameborder","0"),u(h,"width","1200"),u(h,"height","600")},m(t,e){Tt(document.head,m),o(t,F,e),o(t,T,e),o(t,O,e),I(g,t,e),o(t,R,e),o(t,f,e),o(t,q,e),I(c,t,e),o(t,U,e),o(t,w,e),o(t,z,e),o(t,p,e),o(t,D,e),o(t,d,e),o(t,G,e),o(t,b,e),o(t,W,e),o(t,v,e),o(t,J,e),o(t,$,e),o(t,N,e),I(_,t,e),o(t,K,e),o(t,y,e),o(t,Q,e),o(t,x,e),o(t,V,e),o(t,h,e),o(t,X,e),o(t,C,e),o(t,Z,e),I(k,t,e),o(t,tt,e),o(t,A,e),o(t,et,e),o(t,P,e),o(t,nt,e),o(t,L,e),o(t,ot,e),I(S,t,e),o(t,at,e),o(t,H,e),lt=!0},p:kt,i(t){lt||(Y(g.$$.fragment,t),Y(c.$$.fragment,t),Y(_.$$.fragment,t),Y(k.$$.fragment,t),Y(S.$$.fragment,t),lt=!0)},o(t){j(g.$$.fragment,t),j(c.$$.fragment,t),j(_.$$.fragment,t),j(k.$$.fragment,t),j(S.$$.fragment,t),lt=!1},d(t){t&&(n(F),n(T),n(O),n(R),n(f),n(q),n(U),n(w),n(z),n(p),n(D),n(d),n(G),n(b),n(W),n(v),n(J),n($),n(N),n(K),n(y),n(Q),n(x),n(V),n(h),n(X),n(C),n(Z),n(tt),n(A),n(et),n(P),n(nt),n(L),n(ot),n(at),n(H)),n(m),B(g,t),B(c,t),B(_,t),B(k,t),B(S,t)}}}const Et='{"title":"Launching Your Pokémon Battle Agent","local":"launching-your-pokémon-battle-agent","sections":[{"title":"Battle the Stream Agent!","local":"battle-the-stream-agent","sections":[],"depth":2},{"title":"Pokémon Battle Agent Challenger","local":"pokémon-battle-agent-challenger","sections":[{"title":"How to Launch Your Agent","local":"how-to-launch-your-agent","sections":[],"depth":3}],"depth":2}],"depth":1}';function It(rt){return At(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends Pt{constructor(m){super(),Lt(this,m,It,Mt,Ct,{})}}export{Ot as component};
