import{s as Pt,a as kt,n as At,o as Lt}from"../chunks/scheduler.505acc25.js";import{S as St,i as Tt,e as i,s as l,c as M,h as Mt,a as r,d as n,b as a,f as st,g as H,j as s,k as m,l as Ht,m as o,n as E,t as I,o as Y,p as j}from"../chunks/index.fbb49fb4.js";import{C as Et}from"../chunks/CopyLLMTxtMenu.564b44fd.js";import{H as pt}from"../chunks/Heading.511e0027.js";import{E as It}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.8c19e80e.js";function Yt(ut){let h,F,B,O,g,R,f,z,c,mt="It’s now time to battle! ⚡️",U,w,D,d,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>',G,p,gt,W,$,ft="To battle the agent in stream you can:",J,b,ct="Instructions:",N,v,wt=`<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>`,K,_,dt="<em>Heads Up:</em> Only one agent is online at once! Make sure you’ve got the right name.",Q,y,V,x,$t="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!",X,C,bt='We’ve built a dedicated <a href="https://huggingface.co/spaces/PShowdown/pokemon_agents" rel="nofollow">Hugging Face Space</a> for this purpose:',Z,u,vt,tt,k,_t="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.",et,P,nt,A,yt="Follow these steps to bring your Agent to life in the arena:",ot,L,xt=`<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>`,lt,S,Ct="Ready to see your creation in action? Let the AI showdown commence! 🥊",at,T,it,q,rt;return g=new Et({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new pt({props:{title:"Launching Your Pokémon Battle Agent",local:"launching-your-pokémon-battle-agent",headingTag:"h1"}}),w=new pt({props:{title:"Battle the Stream Agent!",local:"battle-the-stream-agent",headingTag:"h2"}}),y=new pt({props:{title:"Pokémon Battle Agent Challenger",local:"pokémon-battle-agent-challenger",headingTag:"h2"}}),P=new pt({props:{title:"How to Launch Your Agent",local:"how-to-launch-your-agent",headingTag:"h3"}}),T=new It({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/en/bonus-unit3/launching_agent_battle.mdx"}}),{c(){h=i("meta"),F=l(),B=i("p"),O=l(),M(g.$$.fragment),R=l(),M(f.$$.fragment),z=l(),c=i("p"),c.textContent=mt,U=l(),M(w.$$.fragment),D=l(),d=i("p"),d.innerHTML=ht,G=l(),p=i("iframe"),W=l(),$=i("p"),$.textContent=ft,J=l(),b=i("p"),b.textContent=ct,N=l(),v=i("ol"),v.innerHTML=wt,K=l(),_=i("p"),_.innerHTML=dt,Q=l(),M(y.$$.fragment),V=l(),x=i("p"),x.innerHTML=$t,X=l(),C=i("p"),C.innerHTML=bt,Z=l(),u=i("iframe"),tt=l(),k=i("p"),k.innerHTML=_t,et=l(),M(P.$$.fragment),nt=l(),A=i("p"),A.textContent=yt,ot=l(),L=i("ol"),L.innerHTML=xt,lt=l(),S=i("p"),S.textContent=Ct,at=l(),M(T.$$.fragment),it=l(),q=i("p"),this.h()},l(t){const e=Mt("svelte-u9bgzb",document.head);h=r(e,"META",{name:!0,content:!0}),e.forEach(n),F=a(t),B=r(t,"P",{}),st(B).forEach(n),O=a(t),H(g.$$.fragment,t),R=a(t),H(f.$$.fragment,t),z=a(t),c=r(t,"P",{"data-svelte-h":!0}),s(c)!=="svelte-axq8du"&&(c.textContent=mt),U=a(t),H(w.$$.fragment,t),D=a(t),d=r(t,"P",{"data-svelte-h":!0}),s(d)!=="svelte-jzratb"&&(d.innerHTML=ht),G=a(t),p=r(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),st(p).forEach(n),W=a(t),$=r(t,"P",{"data-svelte-h":!0}),s($)!=="svelte-xuc57h"&&($.textContent=ft),J=a(t),b=r(t,"P",{"data-svelte-h":!0}),s(b)!=="svelte-1hm7s0x"&&(b.textContent=ct),N=a(t),v=r(t,"OL",{"data-svelte-h":!0}),s(v)!=="svelte-1l28yqe"&&(v.innerHTML=wt),K=a(t),_=r(t,"P",{"data-svelte-h":!0}),s(_)!=="svelte-57sl72"&&(_.innerHTML=dt),Q=a(t),H(y.$$.fragment,t),V=a(t),x=r(t,"P",{"data-svelte-h":!0}),s(x)!=="svelte-17ptu7r"&&(x.innerHTML=$t),X=a(t),C=r(t,"P",{"data-svelte-h":!0}),s(C)!=="svelte-98lns2"&&(C.innerHTML=bt),Z=a(t),u=r(t,"IFRAME",{src:!0,frameborder:!0,width:!0,height:!0}),st(u).forEach(n),tt=a(t),k=r(t,"P",{"data-svelte-h":!0}),s(k)!=="svelte-ug8sqa"&&(k.innerHTML=_t),et=a(t),H(P.$$.fragment,t),nt=a(t),A=r(t,"P",{"data-svelte-h":!0}),s(A)!=="svelte-uj1gxe"&&(A.textContent=yt),ot=a(t),L=r(t,"OL",{"data-svelte-h":!0}),s(L)!=="svelte-zqc6dj"&&(L.innerHTML=xt),lt=a(t),S=r(t,"P",{"data-svelte-h":!0}),s(S)!=="svelte-1wvus4m"&&(S.textContent=Ct),at=a(t),H(T.$$.fragment,t),it=a(t),q=r(t,"P",{}),st(q).forEach(n),this.h()},h(){m(h,"name","hf:doc:metadata"),m(h,"content",jt),kt(p.src,gt="https://jofthomas-twitch-streaming.hf.space")||m(p,"src",gt),m(p,"frameborder","0"),m(p,"width","1200"),m(p,"height","600"),kt(u.src,vt="https://pshowdown-pokemon-agents.hf.space")||m(u,"src",vt),m(u,"frameborder","0"),m(u,"width","1200"),m(u,"height","600")},m(t,e){Ht(document.head,h),o(t,F,e),o(t,B,e),o(t,O,e),E(g,t,e),o(t,R,e),E(f,t,e),o(t,z,e),o(t,c,e),o(t,U,e),E(w,t,e),o(t,D,e),o(t,d,e),o(t,G,e),o(t,p,e),o(t,W,e),o(t,$,e),o(t,J,e),o(t,b,e),o(t,N,e),o(t,v,e),o(t,K,e),o(t,_,e),o(t,Q,e),E(y,t,e),o(t,V,e),o(t,x,e),o(t,X,e),o(t,C,e),o(t,Z,e),o(t,u,e),o(t,tt,e),o(t,k,e),o(t,et,e),E(P,t,e),o(t,nt,e),o(t,A,e),o(t,ot,e),o(t,L,e),o(t,lt,e),o(t,S,e),o(t,at,e),E(T,t,e),o(t,it,e),o(t,q,e),rt=!0},p:At,i(t){rt||(I(g.$$.fragment,t),I(f.$$.fragment,t),I(w.$$.fragment,t),I(y.$$.fragment,t),I(P.$$.fragment,t),I(T.$$.fragment,t),rt=!0)},o(t){Y(g.$$.fragment,t),Y(f.$$.fragment,t),Y(w.$$.fragment,t),Y(y.$$.fragment,t),Y(P.$$.fragment,t),Y(T.$$.fragment,t),rt=!1},d(t){t&&(n(F),n(B),n(O),n(R),n(z),n(c),n(U),n(D),n(d),n(G),n(p),n(W),n($),n(J),n(b),n(N),n(v),n(K),n(_),n(Q),n(V),n(x),n(X),n(C),n(Z),n(u),n(tt),n(k),n(et),n(nt),n(A),n(ot),n(L),n(lt),n(S),n(at),n(it),n(q)),n(h),j(g,t),j(f,t),j(w,t),j(y,t),j(P,t),j(T,t)}}}const jt='{"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 Bt(ut){return Lt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends St{constructor(h){super(),Tt(this,h,Bt,Yt,Pt,{})}}export{Ut as component};
