Buckets:

download
raw
11.4 kB
import{s as ve,n as be,o as je}from"../chunks/scheduler.2b22cead.js";import{S as _e,i as ke,e as m,s,c as i,h as xe,a as u,d as l,b as a,f as Ce,g as r,j as M,k as ge,l as Ze,m as n,n as o,t as p,o as d,p as c}from"../chunks/index.1a0e8013.js";import{C as Ae,H as f,E as Be}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.f5f19e58.js";import{C as L}from"../chunks/CodeBlock.640a2a71.js";function Ee(Me){let y,X,H,N,w,q,J,P,T,fe=`<code>jupyter_env</code> exposes a stateful Jupyter-style Python notebook through MCP
tools. Each episode creates a fresh E2B Code Interpreter sandbox, so Python
variables, imports, files, and generated plots persist across tool calls until
the next reset.`,W,$,we=`Reset can also receive setup and verify scripts. Setup commands run immediately
after the sandbox is created. Verify commands are stored for the episode and run
when the agent calls <code>final_answer</code>.`,z,h,F,U,Je=`<li><code>add_and_execute_code_cell(code)</code>: execute a new Python cell.</li> <li><code>edit_and_execute_current_cell(code)</code>: replace and re-run the latest code cell.</li> <li><code>execute_shell_command(command)</code>: run shell commands inside the sandbox.</li> <li><code>get_notebook_state(include_images=False)</code>: summarize recent notebook cells.</li> <li><code>final_answer(answer)</code>: record a final answer and run any configured verify
commands.</li>`,Y,I,K,C,D,g,O,v,ee,b,Te=`The API and custom web UI are served on port 8000. The notebook UI is mounted
at <code>/web</code>.`,te,j,le,_,ne,k,se,x,$e="<li><code>E2B_API_KEY</code>: required when resetting an episode.</li> <li><code>MAX_CONCURRENT_ENVS</code>: maximum concurrent WebSocket sessions. Defaults to <code>4</code>.</li> <li><code>KAGGLE_DATA_DIR</code>: optional root directory for reset-time Kaggle file staging.</li>",ae,Z,ie,A,he=`<code>reset()</code> accepts either <code>setup</code> / <code>verify</code> or <code>setup_scripts</code> /
<code>verify_scripts</code>.`,re,B,oe,E,Ue=`Setup failure ends the reset response with <code>done=True</code> and returns the captured
setup results. Verify commands run when <code>final_answer(answer)</code> is called. Reward
defaults to <code>passed_verify_commands / total_verify_commands</code>. A verify command
can override this by writing a float to:`,pe,V,de,G,ce,Q,Ie=`This first version intentionally keeps sandbox provider selection local to the
environment and uses E2B as the concrete backend. A shared OpenEnv sandbox API
can be introduced later once the provider contract is RFC-backed.`,me,S,ue,R,ye;return w=new Ae({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),J=new f({props:{title:"Jupyter Environment",local:"jupyter-environment",headingTag:"h1"}}),h=new f({props:{title:"Tools",local:"tools",headingTag:"h2"}}),I=new f({props:{title:"Quick Start",local:"quick-start",headingTag:"h2"}}),C=new L({props:{code:"ZnJvbSUyMGp1cHl0ZXJfZW52JTIwaW1wb3J0JTIwSnVweXRlckVudiUwQSUwQXdpdGglMjBKdXB5dGVyRW52KGJhc2VfdXJsJTNEJTIyaHR0cCUzQSUyRiUyRmxvY2FsaG9zdCUzQTgwMDAlMjIpLnN5bmMoKSUyMGFzJTIwZW52JTNBJTBBJTIwJTIwJTIwJTIwZW52LnJlc2V0KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNldHVwJTNEJTVCJTIycGlwJTIwaW5zdGFsbCUyMC1xJTIwcGFuZGFzJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdmVyaWZ5JTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycHl0aG9uJTIwLSUyMCUzQyUzQydQWSclNUNuZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTVDbmFzc2VydCUyMFBhdGgoJyUyRmhvbWUlMkZ1c2VyJTJGd29yayUyRmFuc3dlci50eHQnKS5leGlzdHMoKSU1Q25QWSUyMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjBwcmludChlbnYuY2FsbF90b29sKCUyMmFkZF9hbmRfZXhlY3V0ZV9jb2RlX2NlbGwlMjIlMkMlMjBjb2RlJTNEJTIyeCUyMCUzRCUyMDIxJTIwKiUyMDIlNUNueCUyMikpJTBBJTIwJTIwJTIwJTIwcHJpbnQoZW52LmNhbGxfdG9vbCglMjJmaW5hbF9hbnN3ZXIlMjIlMkMlMjBhbnN3ZXIlM0QlMjJkb25lJTIyKSk=",highlighted:`<span class="hljs-keyword">from</span> jupyter_env <span class="hljs-keyword">import</span> JupyterEnv
<span class="hljs-keyword">with</span> JupyterEnv(base_url=<span class="hljs-string">&quot;http://localhost:8000&quot;</span>).sync() <span class="hljs-keyword">as</span> env:
env.reset(
setup=[<span class="hljs-string">&quot;pip install -q pandas&quot;</span>],
verify=[
<span class="hljs-string">&quot;python - &lt;&lt;&#x27;PY&#x27;\\nfrom pathlib import Path\\nassert Path(&#x27;/home/user/work/answer.txt&#x27;).exists()\\nPY&quot;</span>
],
)
<span class="hljs-built_in">print</span>(env.call_tool(<span class="hljs-string">&quot;add_and_execute_code_cell&quot;</span>, code=<span class="hljs-string">&quot;x = 21 * 2\\nx&quot;</span>))
<span class="hljs-built_in">print</span>(env.call_tool(<span class="hljs-string">&quot;final_answer&quot;</span>, answer=<span class="hljs-string">&quot;done&quot;</span>))`,lang:"python",wrap:!1}}),g=new f({props:{title:"Local Server",local:"local-server",headingTag:"h2"}}),v=new L({props:{code:"Y2QlMjBlbnZzJTJGanVweXRlcl9lbnYlMEFFMkJfQVBJX0tFWSUzRGUyYl8uLi4lMjB1diUyMHJ1biUyMC0tcHJvamVjdCUyMC4lMjBzZXJ2ZXI=",highlighted:`<span class="hljs-built_in">cd</span> envs/jupyter_env
E2B_API_KEY=e2b_... uv run --project . server`,lang:"bash",wrap:!1}}),j=new f({props:{title:"Docker",local:"docker",headingTag:"h2"}}),_=new L({props:{code:"Y2QlMjBlbnZzJTJGanVweXRlcl9lbnYlMEFvcGVuZW52JTIwYnVpbGQlMjAtdCUyMGp1cHl0ZXItZW52JTBBZG9ja2VyJTIwcnVuJTIwLXAlMjA4MDAwJTNBODAwMCUyMC1lJTIwRTJCX0FQSV9LRVklM0RlMmJfLi4uJTIwanVweXRlci1lbnY=",highlighted:`<span class="hljs-built_in">cd</span> envs/jupyter_env
openenv build -t jupyter-env
docker run -p 8000:8000 -e E2B_API_KEY=e2b_... jupyter-env`,lang:"bash",wrap:!1}}),k=new f({props:{title:"Configuration",local:"configuration",headingTag:"h2"}}),Z=new f({props:{title:"Setup and Verify Commands",local:"setup-and-verify-commands",headingTag:"h2"}}),B=new L({props:{code:"ZW52LnJlc2V0KCUwQSUyMCUyMCUyMCUyMHNldHVwJTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWtkaXIlMjAtcCUyMCUyRmhvbWUlMkZ1c2VyJTJGd29yayUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnByaW50ZiUyMCdzZWVkJTIwZGF0YSclMjAlM0UlMjAlMkZob21lJTJGdXNlciUyRndvcmslMkZpbnB1dC50eHQlMjIlMkMlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjB2ZXJpZnklM0QlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0ZXN0JTIwLWYlMjAlMkZob21lJTJGdXNlciUyRndvcmslMkZhbnN3ZXIudHh0JTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIycHl0aG9uJTIwLW0lMjBweXRlc3QlMjAlMkZob21lJTJGdXNlciUyRndvcmslMkZ0ZXN0cyUyMiUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSk=",highlighted:`env.reset(
setup=[
<span class="hljs-string">&quot;mkdir -p /home/user/work&quot;</span>,
<span class="hljs-string">&quot;printf &#x27;seed data&#x27; &gt; /home/user/work/input.txt&quot;</span>,
],
verify=[
<span class="hljs-string">&quot;test -f /home/user/work/answer.txt&quot;</span>,
<span class="hljs-string">&quot;python -m pytest /home/user/work/tests&quot;</span>,
],
)`,lang:"python",wrap:!1}}),V=new L({props:{code:"JTJGaG9tZSUyRnVzZXIlMkZsb2dzJTJGdmVyaWZpZXIlMkZyZXdhcmQudHh0",highlighted:"/home/user/logs/verifier/reward.txt",lang:"text",wrap:!1}}),G=new f({props:{title:"Notes",local:"notes",headingTag:"h2"}}),S=new Be({props:{source:"https://github.com/huggingface/openenv/blob/main/docs/source/environments/jupyter.md"}}),{c(){y=m("meta"),X=s(),H=m("p"),N=s(),i(w.$$.fragment),q=s(),i(J.$$.fragment),P=s(),T=m("p"),T.innerHTML=fe,W=s(),$=m("p"),$.innerHTML=we,z=s(),i(h.$$.fragment),F=s(),U=m("ul"),U.innerHTML=Je,Y=s(),i(I.$$.fragment),K=s(),i(C.$$.fragment),D=s(),i(g.$$.fragment),O=s(),i(v.$$.fragment),ee=s(),b=m("p"),b.innerHTML=Te,te=s(),i(j.$$.fragment),le=s(),i(_.$$.fragment),ne=s(),i(k.$$.fragment),se=s(),x=m("ul"),x.innerHTML=$e,ae=s(),i(Z.$$.fragment),ie=s(),A=m("p"),A.innerHTML=he,re=s(),i(B.$$.fragment),oe=s(),E=m("p"),E.innerHTML=Ue,pe=s(),i(V.$$.fragment),de=s(),i(G.$$.fragment),ce=s(),Q=m("p"),Q.textContent=Ie,me=s(),i(S.$$.fragment),ue=s(),R=m("p"),this.h()},l(e){const t=xe("svelte-u9bgzb",document.head);y=u(t,"META",{name:!0,content:!0}),t.forEach(l),X=a(e),H=u(e,"P",{}),Ce(H).forEach(l),N=a(e),r(w.$$.fragment,e),q=a(e),r(J.$$.fragment,e),P=a(e),T=u(e,"P",{"data-svelte-h":!0}),M(T)!=="svelte-vq7l0i"&&(T.innerHTML=fe),W=a(e),$=u(e,"P",{"data-svelte-h":!0}),M($)!=="svelte-y0whmu"&&($.innerHTML=we),z=a(e),r(h.$$.fragment,e),F=a(e),U=u(e,"UL",{"data-svelte-h":!0}),M(U)!=="svelte-17b7nda"&&(U.innerHTML=Je),Y=a(e),r(I.$$.fragment,e),K=a(e),r(C.$$.fragment,e),D=a(e),r(g.$$.fragment,e),O=a(e),r(v.$$.fragment,e),ee=a(e),b=u(e,"P",{"data-svelte-h":!0}),M(b)!=="svelte-1nxehaj"&&(b.innerHTML=Te),te=a(e),r(j.$$.fragment,e),le=a(e),r(_.$$.fragment,e),ne=a(e),r(k.$$.fragment,e),se=a(e),x=u(e,"UL",{"data-svelte-h":!0}),M(x)!=="svelte-j1busn"&&(x.innerHTML=$e),ae=a(e),r(Z.$$.fragment,e),ie=a(e),A=u(e,"P",{"data-svelte-h":!0}),M(A)!=="svelte-17dd3ue"&&(A.innerHTML=he),re=a(e),r(B.$$.fragment,e),oe=a(e),E=u(e,"P",{"data-svelte-h":!0}),M(E)!=="svelte-m94lfw"&&(E.innerHTML=Ue),pe=a(e),r(V.$$.fragment,e),de=a(e),r(G.$$.fragment,e),ce=a(e),Q=u(e,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-qprt5r"&&(Q.textContent=Ie),me=a(e),r(S.$$.fragment,e),ue=a(e),R=u(e,"P",{}),Ce(R).forEach(l),this.h()},h(){ge(y,"name","hf:doc:metadata"),ge(y,"content",Ve)},m(e,t){Ze(document.head,y),n(e,X,t),n(e,H,t),n(e,N,t),o(w,e,t),n(e,q,t),o(J,e,t),n(e,P,t),n(e,T,t),n(e,W,t),n(e,$,t),n(e,z,t),o(h,e,t),n(e,F,t),n(e,U,t),n(e,Y,t),o(I,e,t),n(e,K,t),o(C,e,t),n(e,D,t),o(g,e,t),n(e,O,t),o(v,e,t),n(e,ee,t),n(e,b,t),n(e,te,t),o(j,e,t),n(e,le,t),o(_,e,t),n(e,ne,t),o(k,e,t),n(e,se,t),n(e,x,t),n(e,ae,t),o(Z,e,t),n(e,ie,t),n(e,A,t),n(e,re,t),o(B,e,t),n(e,oe,t),n(e,E,t),n(e,pe,t),o(V,e,t),n(e,de,t),o(G,e,t),n(e,ce,t),n(e,Q,t),n(e,me,t),o(S,e,t),n(e,ue,t),n(e,R,t),ye=!0},p:be,i(e){ye||(p(w.$$.fragment,e),p(J.$$.fragment,e),p(h.$$.fragment,e),p(I.$$.fragment,e),p(C.$$.fragment,e),p(g.$$.fragment,e),p(v.$$.fragment,e),p(j.$$.fragment,e),p(_.$$.fragment,e),p(k.$$.fragment,e),p(Z.$$.fragment,e),p(B.$$.fragment,e),p(V.$$.fragment,e),p(G.$$.fragment,e),p(S.$$.fragment,e),ye=!0)},o(e){d(w.$$.fragment,e),d(J.$$.fragment,e),d(h.$$.fragment,e),d(I.$$.fragment,e),d(C.$$.fragment,e),d(g.$$.fragment,e),d(v.$$.fragment,e),d(j.$$.fragment,e),d(_.$$.fragment,e),d(k.$$.fragment,e),d(Z.$$.fragment,e),d(B.$$.fragment,e),d(V.$$.fragment,e),d(G.$$.fragment,e),d(S.$$.fragment,e),ye=!1},d(e){e&&(l(X),l(H),l(N),l(q),l(P),l(T),l(W),l($),l(z),l(F),l(U),l(Y),l(K),l(D),l(O),l(ee),l(b),l(te),l(le),l(ne),l(se),l(x),l(ae),l(ie),l(A),l(re),l(oe),l(E),l(pe),l(de),l(ce),l(Q),l(me),l(ue),l(R)),l(y),c(w,e),c(J,e),c(h,e),c(I,e),c(C,e),c(g,e),c(v,e),c(j,e),c(_,e),c(k,e),c(Z,e),c(B,e),c(V,e),c(G,e),c(S,e)}}}const Ve='{"title":"Jupyter Environment","local":"jupyter-environment","sections":[{"title":"Tools","local":"tools","sections":[],"depth":2},{"title":"Quick Start","local":"quick-start","sections":[],"depth":2},{"title":"Local Server","local":"local-server","sections":[],"depth":2},{"title":"Docker","local":"docker","sections":[],"depth":2},{"title":"Configuration","local":"configuration","sections":[],"depth":2},{"title":"Setup and Verify Commands","local":"setup-and-verify-commands","sections":[],"depth":2},{"title":"Notes","local":"notes","sections":[],"depth":2}],"depth":1}';function Ge(Me){return je(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Le extends _e{constructor(y){super(),ke(this,y,Ge,Ee,ve,{})}}export{Le as component};

Xet Storage Details

Size:
11.4 kB
·
Xet hash:
c8c2fb2f0b0c1fcaa9991936a07136f6582fe5ed4132278c7f8fed9ab867f852

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.