import{s as Ht,o as Mt}from"../chunks/scheduler.37c15a92.js";import{S as dt,i as Lt,g as p,s as i,r as j,A as wt,h as a,f as n,c as s,j as At,u as E,x as m,k as ht,y as bt,a as l,v as y,d as z,t as k,w as D,m as Gt,n as Rt}from"../chunks/index.2bf4358c.js";import{T as jt}from"../chunks/Tip.363c041f.js";import{H as pt}from"../chunks/Heading.8ada512a.js";import{E as Et}from"../chunks/getInferenceSnippets.d4d07d1e.js";function yt(S){let f;return{c(){f=Gt("这是代理增强 RAG 的「真实世界」应用案例，您可直接应用于个人项目或工作场景。若想获得更多实践收获，何不尝试将其应用于您的实际场景并在 Discord 社区分享？")},l(r){f=Rt(r,"这是代理增强 RAG 的「真实世界」应用案例，您可直接应用于个人项目或工作场景。若想获得更多实践收获，何不尝试将其应用于您的实际场景并在 Discord 社区分享？")},m(r,$){l(r,f,$)},d(r){r&&n(f)}}}function zt(S){let f,r,$,q,o,J,x,at='<img src="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit3/agentic-rag/thumbnail.jpg" alt="代理增强 RAG 横幅图"/>',N,g,ft="在本单元中，我们将通过代理增强检索生成（Agentic RAG）技术，帮助负责主持晚会的友好智能体 Alfred 创建用于解答宾客问题的工具。",O,u,U,v,mt="您可以选择课程中讨论的任何框架来实现本用例。我们已在独立标签页中为每个框架提供代码示例。",B,_,F,C,rt="现在让我们进入实战环节，为这场盛会搭建舞台！",I,T,ut="<strong>您决定举办本世纪最奢华、最盛大的派对</strong>——这意味着将包含：豪华宴席、魅惑舞者、知名 DJ、精致饮品、震撼烟花表演等极致元素。",K,c,$t="您的好邻居智能体 Alfred 正着手统筹派对的各项需求，<strong>Alfred 将全权管理所有事务</strong>。为此，他需要掌握包括菜单、宾客名单、日程安排、天气预报等在内的完整派对信息！",Q,P,ot="除此之外，他还需确保派对圆满成功，因此<strong>必须具备在派对期间实时解答各类问题的能力</strong>，同时处理可能出现的突发状况。",V,A,xt="Alfred 无法孤军奋战，我们需要确保他能够获取所需的所有信息和工具。",W,h,gt="首先，让我们为晚会制定核心需求清单。",X,H,Y,M,vt=`在<strong>文艺复兴时期</strong>，真正受过良好教育的人需具备三大核心素养：
需精通<strong>体育、文化与科学知识</strong>。因此，我们必须通过知识储备给宾客留下深刻印象，呈现真正难忘的盛会。
但为避免冲突，<strong>政治与宗教等敏感话题应在晚会中回避</strong>，确保派对氛围轻松愉快，不涉及信仰与理念分歧。`,Z,d,_t="根据礼仪规范，<strong>优秀的主办方应充分了解宾客背景</strong>，包括其兴趣爱好与事业成就。同时应善于通过宾客间的故事分享促进交流。",tt,L,Ct="最后，我们还需掌握<strong>基础天气知识</strong>，以便实时获取更新信息，精准把握烟花表演时机，为晚会画上完美句号！🎆",et,w,Tt=`由此可见，Alfred 需要大量信息支持才能办好晚会。
幸运的是，我们可以通过<strong>检索增强生成（RAG）训练</strong>为 Alfred 做好准备！`,nt,b,ct="现在让我们开始创建 Alfred 主持晚会所需的工具集！",lt,G,it,R,st;return o=new pt({props:{title:"代理增强检索生成（Agentic RAG）用例介绍",local:"代理增强检索生成agentic-rag用例介绍",headingTag:"h1"}}),u=new jt({props:{$$slots:{default:[yt]},$$scope:{ctx:S}}}),_=new pt({props:{title:"值得铭记的盛会",local:"值得铭记的盛会",headingTag:"h2"}}),H=new pt({props:{title:"晚会核心需求",local:"晚会核心需求",headingTag:"h2"}}),G=new Et({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/zh-CN/unit3/agentic-rag/introduction.mdx"}}),{c(){f=p("meta"),r=i(),$=p("p"),q=i(),j(o.$$.fragment),J=i(),x=p("p"),x.innerHTML=at,N=i(),g=p("p"),g.textContent=ft,O=i(),j(u.$$.fragment),U=i(),v=p("p"),v.textContent=mt,B=i(),j(_.$$.fragment),F=i(),C=p("p"),C.textContent=rt,I=i(),T=p("p"),T.innerHTML=ut,K=i(),c=p("p"),c.innerHTML=$t,Q=i(),P=p("p"),P.innerHTML=ot,V=i(),A=p("p"),A.textContent=xt,W=i(),h=p("p"),h.textContent=gt,X=i(),j(H.$$.fragment),Y=i(),M=p("p"),M.innerHTML=vt,Z=i(),d=p("p"),d.innerHTML=_t,tt=i(),L=p("p"),L.innerHTML=Ct,et=i(),w=p("p"),w.innerHTML=Tt,nt=i(),b=p("p"),b.textContent=ct,lt=i(),j(G.$$.fragment),it=i(),R=p("p"),this.h()},l(t){const e=wt("svelte-u9bgzb",document.head);f=a(e,"META",{name:!0,content:!0}),e.forEach(n),r=s(t),$=a(t,"P",{}),At($).forEach(n),q=s(t),E(o.$$.fragment,t),J=s(t),x=a(t,"P",{"data-svelte-h":!0}),m(x)!=="svelte-pxhyh7"&&(x.innerHTML=at),N=s(t),g=a(t,"P",{"data-svelte-h":!0}),m(g)!=="svelte-xj6p7h"&&(g.textContent=ft),O=s(t),E(u.$$.fragment,t),U=s(t),v=a(t,"P",{"data-svelte-h":!0}),m(v)!=="svelte-12hv252"&&(v.textContent=mt),B=s(t),E(_.$$.fragment,t),F=s(t),C=a(t,"P",{"data-svelte-h":!0}),m(C)!=="svelte-mhfjgx"&&(C.textContent=rt),I=s(t),T=a(t,"P",{"data-svelte-h":!0}),m(T)!=="svelte-104pvwo"&&(T.innerHTML=ut),K=s(t),c=a(t,"P",{"data-svelte-h":!0}),m(c)!=="svelte-1p3kfyf"&&(c.innerHTML=$t),Q=s(t),P=a(t,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1u7z4b3"&&(P.innerHTML=ot),V=s(t),A=a(t,"P",{"data-svelte-h":!0}),m(A)!=="svelte-1gzseqk"&&(A.textContent=xt),W=s(t),h=a(t,"P",{"data-svelte-h":!0}),m(h)!=="svelte-1d9twtp"&&(h.textContent=gt),X=s(t),E(H.$$.fragment,t),Y=s(t),M=a(t,"P",{"data-svelte-h":!0}),m(M)!=="svelte-1j3ej1r"&&(M.innerHTML=vt),Z=s(t),d=a(t,"P",{"data-svelte-h":!0}),m(d)!=="svelte-1xxsrzh"&&(d.innerHTML=_t),tt=s(t),L=a(t,"P",{"data-svelte-h":!0}),m(L)!=="svelte-16b6d7n"&&(L.innerHTML=Ct),et=s(t),w=a(t,"P",{"data-svelte-h":!0}),m(w)!=="svelte-106osa6"&&(w.innerHTML=Tt),nt=s(t),b=a(t,"P",{"data-svelte-h":!0}),m(b)!=="svelte-6xanh1"&&(b.textContent=ct),lt=s(t),E(G.$$.fragment,t),it=s(t),R=a(t,"P",{}),At(R).forEach(n),this.h()},h(){ht(f,"name","hf:doc:metadata"),ht(f,"content",kt)},m(t,e){bt(document.head,f),l(t,r,e),l(t,$,e),l(t,q,e),y(o,t,e),l(t,J,e),l(t,x,e),l(t,N,e),l(t,g,e),l(t,O,e),y(u,t,e),l(t,U,e),l(t,v,e),l(t,B,e),y(_,t,e),l(t,F,e),l(t,C,e),l(t,I,e),l(t,T,e),l(t,K,e),l(t,c,e),l(t,Q,e),l(t,P,e),l(t,V,e),l(t,A,e),l(t,W,e),l(t,h,e),l(t,X,e),y(H,t,e),l(t,Y,e),l(t,M,e),l(t,Z,e),l(t,d,e),l(t,tt,e),l(t,L,e),l(t,et,e),l(t,w,e),l(t,nt,e),l(t,b,e),l(t,lt,e),y(G,t,e),l(t,it,e),l(t,R,e),st=!0},p(t,[e]){const Pt={};e&2&&(Pt.$$scope={dirty:e,ctx:t}),u.$set(Pt)},i(t){st||(z(o.$$.fragment,t),z(u.$$.fragment,t),z(_.$$.fragment,t),z(H.$$.fragment,t),z(G.$$.fragment,t),st=!0)},o(t){k(o.$$.fragment,t),k(u.$$.fragment,t),k(_.$$.fragment,t),k(H.$$.fragment,t),k(G.$$.fragment,t),st=!1},d(t){t&&(n(r),n($),n(q),n(J),n(x),n(N),n(g),n(O),n(U),n(v),n(B),n(F),n(C),n(I),n(T),n(K),n(c),n(Q),n(P),n(V),n(A),n(W),n(h),n(X),n(Y),n(M),n(Z),n(d),n(tt),n(L),n(et),n(w),n(nt),n(b),n(lt),n(it),n(R)),n(f),D(o,t),D(u,t),D(_,t),D(H,t),D(G,t)}}}const kt='{"title":"代理增强检索生成（Agentic RAG）用例介绍","local":"代理增强检索生成agentic-rag用例介绍","sections":[{"title":"值得铭记的盛会","local":"值得铭记的盛会","sections":[],"depth":2},{"title":"晚会核心需求","local":"晚会核心需求","sections":[],"depth":2}],"depth":1}';function Dt(S){return Mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ut extends dt{constructor(f){super(),Lt(this,f,Dt,zt,Ht,{})}}export{Ut as component};
