Buckets:

HuggingFaceDocBuilder's picture
download
raw
5.83 kB
import{s as K,n as R,o as W}from"../chunks/scheduler.4048030c.js";import{S as G,i as U,e as j,s as n,c as i,h as B,a as F,d as a,b as o,f as L,j as l,g as D,k as J,l as V,m as s,n as m,t as p,o as c,p as u}from"../chunks/index.5d0b9360.js";import{C as X,H as Y,E as Z}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.89cf75bd.js";import{Q as T}from"../chunks/Question.e487118a.js";function ee(I){let r,C,v,P,d,k,h,q,f,Q="Test your understanding of agent loops, tools, and sandboxing.",E,x,S,$,z,g,H,y,M,w,N,_,A,b,O;return d=new X({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),h=new Y({props:{title:"Quiz: Nano Harness and Agent Internals",local:"quiz-nano-harness-and-agent-internals",headingTag:"h1"}}),x=new T({props:{choices:[{text:"Call model → return result immediately",explain:"That's not an agent loop. A loop requires observation and repetition."},{text:"Call model → parse Python code → execute with tools → observe → repeat until final_answer()",explain:"Correct! That's the core loop: model → code → execute → observe → repeat.",correct:!0},{text:"Model returns JSON → parse → store in database → done",explain:"That's a one-shot API call, not an agent loop."},{text:"Keep calling the model until it returns the word 'done'",explain:"The agent needs to execute code, not just call the model repeatedly."}]}}),$=new T({props:{choices:[{text:"The model outputs English text like 'The answer is 42'",explain:"Nano Harness is code-first. Model outputs Python code, not prose."},{text:"The model outputs Python code that calls tools; agent executes that code in a sandbox",explain:"Correct! Model → Python code → execution → observation.",correct:!0},{text:"The model outputs JSON which the agent parses",explain:"Some models do this, but nano_harness expects Python code."},{text:"The model outputs commands like 'list_dir' and the agent translates them",explain:"The model directly outputs Python function calls."}]}}),g=new T({props:{choices:[{text:"The message history grows with every loop iteration (model output + observation)",explain:"Correct! Each step adds assistant response + user observation. History provides memory.",correct:!0},{text:"The message history is cleared every step to save tokens",explain:"False. Full history is kept so the model can learn from prior steps."},{text:"The message history is stored in a database for later analysis",explain:"The history is maintained in memory during the loop."},{text:"The message history doesn't matter; only the latest model output matters",explain:"False. History provides crucial context for the model to make good decisions."}]}}),y=new T({props:{choices:[{text:"safe_path() allows reading any file on the system",explain:"False. safe_path() confines paths to the workspace directory."},{text:"safe_path() prevents directory traversal by checking that paths stay within WORKSPACE",explain:"Correct! It resolves paths and ensures they're within the workspace.",correct:!0},{text:"safe_path() is optional; security isn't really needed",explain:"Safety is critical. Without safe_path(), agents could read /etc/passwd."},{text:"safe_path() encrypts paths for transmission",explain:"No, it just prevents path escape attacks."}]}}),w=new T({props:{choices:[{text:"exec_cmd() allows any shell command to run",explain:"False. Only whitelisted commands (ls, cat, pwd, etc.) are allowed."},{text:"exec_cmd() maintains a whitelist of safe commands; anything else is blocked",explain:"Correct! Only safe commands like 'ls' work. 'rm' and 'curl' are blocked.",correct:!0},{text:"exec_cmd() has a timeout to prevent hanging commands",explain:"True, but the whitelist is the primary security control."},{text:"exec_cmd() runs commands with admin privileges",explain:"No. Commands run with normal user privileges and are rate-limited."}]}}),_=new Z({props:{source:"https://github.com/huggingface/context-course/blob/main/units/en/unit6/quiz1.mdx"}}),{c(){r=j("meta"),C=n(),v=j("p"),P=n(),i(d.$$.fragment),k=n(),i(h.$$.fragment),q=n(),f=j("p"),f.textContent=Q,E=n(),i(x.$$.fragment),S=n(),i($.$$.fragment),z=n(),i(g.$$.fragment),H=n(),i(y.$$.fragment),M=n(),i(w.$$.fragment),N=n(),i(_.$$.fragment),A=n(),b=j("p"),this.h()},l(e){const t=B("svelte-u9bgzb",document.head);r=F(t,"META",{name:!0,content:!0}),t.forEach(a),C=o(e),v=F(e,"P",{}),L(v).forEach(a),P=o(e),l(d.$$.fragment,e),k=o(e),l(h.$$.fragment,e),q=o(e),f=F(e,"P",{"data-svelte-h":!0}),D(f)!=="svelte-1rhcvjj"&&(f.textContent=Q),E=o(e),l(x.$$.fragment,e),S=o(e),l($.$$.fragment,e),z=o(e),l(g.$$.fragment,e),H=o(e),l(y.$$.fragment,e),M=o(e),l(w.$$.fragment,e),N=o(e),l(_.$$.fragment,e),A=o(e),b=F(e,"P",{}),L(b).forEach(a),this.h()},h(){J(r,"name","hf:doc:metadata"),J(r,"content",te)},m(e,t){V(document.head,r),s(e,C,t),s(e,v,t),s(e,P,t),m(d,e,t),s(e,k,t),m(h,e,t),s(e,q,t),s(e,f,t),s(e,E,t),m(x,e,t),s(e,S,t),m($,e,t),s(e,z,t),m(g,e,t),s(e,H,t),m(y,e,t),s(e,M,t),m(w,e,t),s(e,N,t),m(_,e,t),s(e,A,t),s(e,b,t),O=!0},p:R,i(e){O||(p(d.$$.fragment,e),p(h.$$.fragment,e),p(x.$$.fragment,e),p($.$$.fragment,e),p(g.$$.fragment,e),p(y.$$.fragment,e),p(w.$$.fragment,e),p(_.$$.fragment,e),O=!0)},o(e){c(d.$$.fragment,e),c(h.$$.fragment,e),c(x.$$.fragment,e),c($.$$.fragment,e),c(g.$$.fragment,e),c(y.$$.fragment,e),c(w.$$.fragment,e),c(_.$$.fragment,e),O=!1},d(e){e&&(a(C),a(v),a(P),a(k),a(q),a(f),a(E),a(S),a(z),a(H),a(M),a(N),a(A),a(b)),a(r),u(d,e),u(h,e),u(x,e),u($,e),u(g,e),u(y,e),u(w,e),u(_,e)}}}const te='{"title":"Quiz: Nano Harness and Agent Internals","local":"quiz-nano-harness-and-agent-internals","sections":[],"depth":1}';function ae(I){return W(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ie extends G{constructor(r){super(),U(this,r,ae,ee,K,{})}}export{ie as component};

Xet Storage Details

Size:
5.83 kB
·
Xet hash:
af9ebed5f07b46736f21a3af9e35597761f81197fae2ac2c0c4861c846942068

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