import{s as $t,n as gt,o as xt}from"../chunks/scheduler.505acc25.js";import{S as _t,i as vt,e as a,s as i,c as H,h as Ct,a as m,d as l,b as s,f as ut,g as w,j as f,k as ot,l as ht,m as n,n as P,t as c,o as d,p as y}from"../chunks/index.b1175496.js";import{C as Tt,H as et}from"../chunks/Heading.eda51538.js";import{E as Lt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ea377ea6.js";function Mt(lt){let p,E,A,S,r,k,u,R,o,nt='<img src="https://langfuse.com/images/cookbook/huggingface-agent-course/agent-observability-and-evaluation.png" alt="Bonus Unit 2 Thumbnail"/>',U,$,it="欢迎来到 <strong>附加单元 2</strong>！在本章中，你将探索用于观测、评估、并最终提升你的AI智能体性能的高级策略。",z,q,G,g,O,x,st="如果你符合以下情况，那么这个附加单元非常适合你：",j,_,at="<li><strong>开发和部署 AI 智能体：</strong> 你希望确保你的智能体在生产环境中能够可靠地运行。</li> <li><strong>需要详细的洞察：</strong> 你希望诊断问题、优化性能或理解你的智能体的内部工作原理。</li> <li><strong>旨在减少运营开销：</strong> 通过监控智能体成本、延迟和执行细节，你可以高效地管理资源。</li> <li><strong>寻求持续改进：</strong> 你对将实时用户反馈和自动化评估集成到你的 AI 应用中感兴趣。</li>",B,v,mt="简而言之，对于每个想要将他们的智能体带到用户面前的人！",K,N,D,C,F,h,pt="在本单元中，你将学习：",J,T,ft="<li><strong>检测你的智能体：</strong> 学习如何通过 OpenTelemetry 将可观测性工具与 <em>smolagents</em> 集成。</li> <li><strong>监控指标：</strong> 追踪性能指标，例如 token 使用量（成本）、延迟和错误追踪。</li> <li><strong>实时评估：</strong> 理解用于实时评估的技术，包括收集用户反馈和利用 LLM 作为评判者。</li> <li><strong>离线分析：</strong> 使用基准数据集（例如 GSM8K）来测试和比较智能体性能。</li>",Q,V,W,L,X,M,rt="在下一节中，你将学习智能体可观测性与评估的基础知识。之后，就该看它在实践中的应用了！",Y,b,Z,I,tt;return r=new Tt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),u=new et({props:{title:"AI 智能体(AI Agent)的可观测性与评估",local:"ai-智能体ai-agent的可观测性与评估",headingTag:"h1"}}),g=new et({props:{title:"📚 我应该在什么时候学习这个附加单元？",local:"-我应该在什么时候学习这个附加单元",headingTag:"h2"}}),C=new et({props:{title:"🤓 你将学到什么",local:"-你将学到什么",headingTag:"h2"}}),L=new et({props:{title:"🚀 准备好开始了吗？",local:"-准备好开始了吗",headingTag:"h2"}}),b=new Lt({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/zh-CN/bonus_unit2/introduction.mdx"}}),{c(){p=a("meta"),E=i(),A=a("p"),S=i(),H(r.$$.fragment),k=i(),H(u.$$.fragment),R=i(),o=a("p"),o.innerHTML=nt,U=i(),$=a("p"),$.innerHTML=it,z=i(),q=a("hr"),G=i(),H(g.$$.fragment),O=i(),x=a("p"),x.textContent=st,j=i(),_=a("ul"),_.innerHTML=at,B=i(),v=a("p"),v.textContent=mt,K=i(),N=a("hr"),D=i(),H(C.$$.fragment),F=i(),h=a("p"),h.textContent=pt,J=i(),T=a("ul"),T.innerHTML=ft,Q=i(),V=a("hr"),W=i(),H(L.$$.fragment),X=i(),M=a("p"),M.textContent=rt,Y=i(),H(b.$$.fragment),Z=i(),I=a("p"),this.h()},l(t){const e=Ct("svelte-u9bgzb",document.head);p=m(e,"META",{name:!0,content:!0}),e.forEach(l),E=s(t),A=m(t,"P",{}),ut(A).forEach(l),S=s(t),w(r.$$.fragment,t),k=s(t),w(u.$$.fragment,t),R=s(t),o=m(t,"P",{"data-svelte-h":!0}),f(o)!=="svelte-1927uig"&&(o.innerHTML=nt),U=s(t),$=m(t,"P",{"data-svelte-h":!0}),f($)!=="svelte-1nmdacw"&&($.innerHTML=it),z=s(t),q=m(t,"HR",{}),G=s(t),w(g.$$.fragment,t),O=s(t),x=m(t,"P",{"data-svelte-h":!0}),f(x)!=="svelte-ttlxd4"&&(x.textContent=st),j=s(t),_=m(t,"UL",{"data-svelte-h":!0}),f(_)!=="svelte-1st85yt"&&(_.innerHTML=at),B=s(t),v=m(t,"P",{"data-svelte-h":!0}),f(v)!=="svelte-1oanoe0"&&(v.textContent=mt),K=s(t),N=m(t,"HR",{}),D=s(t),w(C.$$.fragment,t),F=s(t),h=m(t,"P",{"data-svelte-h":!0}),f(h)!=="svelte-rl1vpd"&&(h.textContent=pt),J=s(t),T=m(t,"UL",{"data-svelte-h":!0}),f(T)!=="svelte-uxqdt"&&(T.innerHTML=ft),Q=s(t),V=m(t,"HR",{}),W=s(t),w(L.$$.fragment,t),X=s(t),M=m(t,"P",{"data-svelte-h":!0}),f(M)!=="svelte-14dlgwa"&&(M.textContent=rt),Y=s(t),w(b.$$.fragment,t),Z=s(t),I=m(t,"P",{}),ut(I).forEach(l),this.h()},h(){ot(p,"name","hf:doc:metadata"),ot(p,"content",bt)},m(t,e){ht(document.head,p),n(t,E,e),n(t,A,e),n(t,S,e),P(r,t,e),n(t,k,e),P(u,t,e),n(t,R,e),n(t,o,e),n(t,U,e),n(t,$,e),n(t,z,e),n(t,q,e),n(t,G,e),P(g,t,e),n(t,O,e),n(t,x,e),n(t,j,e),n(t,_,e),n(t,B,e),n(t,v,e),n(t,K,e),n(t,N,e),n(t,D,e),P(C,t,e),n(t,F,e),n(t,h,e),n(t,J,e),n(t,T,e),n(t,Q,e),n(t,V,e),n(t,W,e),P(L,t,e),n(t,X,e),n(t,M,e),n(t,Y,e),P(b,t,e),n(t,Z,e),n(t,I,e),tt=!0},p:gt,i(t){tt||(c(r.$$.fragment,t),c(u.$$.fragment,t),c(g.$$.fragment,t),c(C.$$.fragment,t),c(L.$$.fragment,t),c(b.$$.fragment,t),tt=!0)},o(t){d(r.$$.fragment,t),d(u.$$.fragment,t),d(g.$$.fragment,t),d(C.$$.fragment,t),d(L.$$.fragment,t),d(b.$$.fragment,t),tt=!1},d(t){t&&(l(E),l(A),l(S),l(k),l(R),l(o),l(U),l($),l(z),l(q),l(G),l(O),l(x),l(j),l(_),l(B),l(v),l(K),l(N),l(D),l(F),l(h),l(J),l(T),l(Q),l(V),l(W),l(X),l(M),l(Y),l(Z),l(I)),l(p),y(r,t),y(u,t),y(g,t),y(C,t),y(L,t),y(b,t)}}}const bt='{"title":"AI 智能体(AI Agent)的可观测性与评估","local":"ai-智能体ai-agent的可观测性与评估","sections":[{"title":"📚 我应该在什么时候学习这个附加单元？","local":"-我应该在什么时候学习这个附加单元","sections":[],"depth":2},{"title":"🤓 你将学到什么","local":"-你将学到什么","sections":[],"depth":2},{"title":"🚀 准备好开始了吗？","local":"-准备好开始了吗","sections":[],"depth":2}],"depth":1}';function Ht(lt){return xt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yt extends _t{constructor(p){super(),vt(this,p,Ht,Mt,$t,{})}}export{yt as component};
