import{s as hJ,f as BJ,n as gJ,o as oJ}from"../chunks/scheduler.37c15a92.js";import{S as cJ,i as SJ,g as e,s as T,r as M,A as wJ,h as n,f as J,c as s,j as jJ,u as Q,x as a,k as YU,y as uJ,a as t,v as V,d as i,t as C,w as p}from"../chunks/index.2bf4358c.js";import{C as y}from"../chunks/CodeBlock.4e987730.js";import{H as GU}from"../chunks/Heading.8ada512a.js";import{E as IJ}from"../chunks/getInferenceSnippets.d4d07d1e.js";function kJ(DU){let R,ol,Bl,cl,N,Sl,F,fU,wl,E,$U="本课程是框架无关的，因为我们想要<strong>专注于 AI 智能体（AI Agent）的概念，避免陷入特定框架的细节中</strong>。",ul,O,xU="同时，我们希望学生能够在自己的项目中使用他们在本课程中学到的概念，使用任何他们喜欢的框架。",Il,j,AU="因此，在第一单元中，我们将使用一个简单智能体库和一个简单的无服务器 API (serverless API) 来访问我们的 LLM 引擎。",kl,h,_U="你可能不会在生产环境中使用这些，但它们将作为<strong>理解智能体如何工作的良好起点</strong>。",ml,B,XU="在本节之后，你将准备好<strong>使用 <code>smolagents</code> 创建一个简单的智能体</strong>。",rl,g,ZU="在接下来的单元中，我们还将使用其他 AI 智能体库，如 <code>LangGraph</code> 和 <code>LlamaIndex</code>。",dl,o,qU="为了保持简单，我们将使用一个简单的 Python 函数作为工具和智能体。",bl,c,vU="我们将使用内置的 Python 包，如 <code>datetime</code> 和 <code>os</code>，这样你可以在任何环境中尝试它。",Yl,S,WU='你可以<a href="https://huggingface.co/agents-course/notebooks/blob/main/unit1/dummy_agent_library.ipynb" rel="nofollow">在这个 notebook 中</a>跟随过程并<strong>自己运行代码</strong>。',Gl,w,Dl,u,zU="在 Hugging Face 生态系统中，有一个称为无服务器 API 的便捷功能，它允许你轻松地在许多模型上运行推理。不需要安装或部署。",fl,I,$l,k,xl,m,HU="输出:",Al,r,_l,d,LU="如 LLM 部分所见，如果我们只做解码，<strong>模型只会在预测到 EOS 令牌时停止</strong>，而这里没有发生，因为这是一个会话（聊天）模型，<strong>我们没有应用它期望的聊天模板</strong>。",Xl,b,PU='如果我们现在添加与我们使用的<a href="https://huggingface.co/meta-llama/Llama-3.2-3B-Instruct">Llama-3.2-3B-Instruct 模型</a>相关的特殊令牌，行为会改变，现在会产生预期的 EOS。',Zl,Y,ql,G,KU="输出：",vl,D,Wl,f,lJ="使用”chat”方法是应用聊天模板的更方便和可靠的方式：",zl,$,Hl,x,UJ="输出：",Ll,A,Pl,_,JJ="chat 方法是推荐使用的方法，以确保模型之间的平滑过渡，但由于这个 notebook 只是教育性质的，我们将继续使用 “text_generation” 方法来理解细节。",Kl,X,lU,Z,tJ="在前面的部分中，我们看到智能体库的核心是在系统提示中附加信息。",UU,q,TJ="这个系统提示比我们之前看到的要复杂一些，但它已经包含：",JU,v,sJ="<li><strong>工具信息</strong></li> <li><strong>循环指令</strong> （思考 → 行动 → 观察）</li>",tU,W,TU,z,eJ="由于我们正在运行“text_generation”方法，因此我们需要手动应用提示：",sU,H,eU,L,nJ="我们也可以这样做，这就是在 <code>chat</code> 方法内部发生的情况：",nU,P,aU,K,aJ="现在的提示是：",MU,ll,QU,Ul,MJ="Let’s decode!",VU,Jl,iU,tl,QJ="输出:",CU,Tl,pU,sl,VJ="你看到问题了吗？",yU,el,iJ=`<p>答案是模型产生的幻觉。我们需要停下来真正执行这个函数！
现在让我们停在“观察”上，这样我们就不会产生实际函数响应的幻觉。</p>`,RU,nl,NU,al,CJ="输出:",FU,Ml,EU,Ql,pJ=`好多了！
现在让我们创建一个虚拟的获取天气函数。在实际情况下，您可能会调用 API。`,OU,Vl,jU,il,yJ="输出:",hU,Cl,BU,pl,RJ="我们将基本提示、函数执行前的完成以及函数的结果连接起来作为观察并恢复生成。",gU,yl,oU,Rl,NJ="这是新的提示：",cU,Nl,SU,Fl,FJ="输出:",wU,El,uU,IU,kU,Ol,EJ="我们学习了如何使用 Python 代码从头开始创建智能体，并且我们<strong>看到了这个过程是多么繁琐</strong>。幸运的是，许多智能体库通过为您处理大部分繁重的工作来简化这项工作。",mU,jl,OJ="现在，我们已准备好使用 <code>smolagents</code> 库<strong>创建我们的第一个真正的智能体</strong>。",rU,hl,dU,gl,bU;return N=new GU({props:{title:"简单智能体库 (Dummy Agent Library)",local:"简单智能体库-dummy-agent-library",headingTag:"h1"}}),w=new GU({props:{title:"无服务器 API (Serverless API)",local:"无服务器-api-serverless-api",headingTag:"h2"}}),I=new y({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwaHVnZ2luZ2ZhY2VfaHViJTIwaW1wb3J0JTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBJTIzJTIzJTIwJUU0JUJEJUEwJUU5JTlDJTgwJUU4JUE2JTgxJUU0JUI4JTgwJUU0JUI4JUFBJUU2JTlEJUE1JUU4JTg3JUFBJTIwaHR0cHMlM0ElMkYlMkZoZi5jbyUyRnNldHRpbmdzJTJGdG9rZW5zJTIwJUU3JTlBJTg0JUU0JUJCJUE0JUU3JTg5JThDJUVGJUJDJThDJUU3JUExJUFFJUU0JUJGJTlEJUU0JUJEJUEwJUU5JTgwJTg5JUU2JThCJUE5J3JlYWQnJUU0JUJEJTlDJUU0JUI4JUJBJUU0JUJCJUE0JUU3JTg5JThDJUU3JUIxJUJCJUU1JTlFJThCJUUzJTgwJTgyJUU1JUE2JTgyJUU2JTlFJTlDJUU0JUJEJUEwJUU1JTlDJUE4JTIwR29vZ2xlJTIwQ29sYWIlMjAlRTQlQjglOEElRTglQkYlOTAlRTglQTElOEMlRUYlQkMlOEMlRTQlQkQlQTAlRTUlOEYlQUYlRTQlQkIlQTUlRTUlOUMlQTglMjJzZXR0aW5ncyUyMiVFNiVBMCU4NyVFNyVBRCVCRSVFNCVCOCU4QiVFNyU5QSU4NCUyMnNlY3JldHMlMjIlRTQlQjglQUQlRTglQUUlQkUlRTclQkQlQUUlRTUlQUUlODMlRTMlODAlODIlRTclQTElQUUlRTQlQkYlOUQlRTUlQjAlODYlRTUlODUlQjYlRTUlOTElQkQlRTUlOTAlOEQlRTQlQjglQkElMjJIRl9UT0tFTiUyMiUwQW9zLmVudmlyb24lNUIlMjJIRl9UT0tFTiUyMiU1RCUzRCUyMmhmX3h4eHh4eHh4eHh4eHh4JTIyJTBBJTBBY2xpZW50JTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50KHByb3ZpZGVyJTNEJTIyaGYtaW5mZXJlbmNlJTIyJTJDJTIwbW9kZWwlM0QlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4zLTcwQi1JbnN0cnVjdCUyMiklMEElMjMlMjAlRTUlQTYlODIlRTYlOUUlOUMlRTQlQjglOEIlRTQlQjglODAlRTQlQjglQUElRTUlOEQlOTUlRTUlODUlODMlRTYlQTAlQkMlRTclOUElODQlRTglQkUlOTMlRTUlODclQkElRTQlQjglOEQlRTYlQUQlQTMlRTclQTElQUUlRUYlQkMlOEMlRTUlODUlOEQlRTglQjQlQjklRTYlQTglQTElRTUlOUUlOEIlRTUlOEYlQUYlRTglODMlQkQlRTglQkYlODclRTglQkQlQkQlRTMlODAlODIlRTQlQkQlQTAlRTQlQjklOUYlRTUlOEYlQUYlRTQlQkIlQTUlRTQlQkQlQkYlRTclOTQlQTglRTglQkYlOTklRTQlQjglQUElRTUlOEMlODUlRTUlOTAlQUIlMjBMbGFtYS0zLjItM0ItSW5zdHJ1Y3QlMjAlRTclOUElODQlRTUlODUlQUMlRTUlODUlQjElRTclQUIlQUYlRTclODIlQjklMEElMjMlMjBjbGllbnQlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnQoJTIyaHR0cHMlM0ElMkYlMkZqYzI2bXdnMjI4bWtqOGR3LnVzLWVhc3QtMS5hd3MuZW5kcG9pbnRzLmh1Z2dpbmdmYWNlLmNsb3VkJTIyKQ==",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> InferenceClient

<span class="hljs-comment">## 你需要一个来自 https://hf.co/settings/tokens 的令牌，确保你选择&#x27;read&#x27;作为令牌类型。如果你在 Google Colab 上运行，你可以在&quot;settings&quot;标签下的&quot;secrets&quot;中设置它。确保将其命名为&quot;HF_TOKEN&quot;</span>
os.environ[<span class="hljs-string">&quot;HF_TOKEN&quot;</span>]=<span class="hljs-string">&quot;hf_xxxxxxxxxxxxxx&quot;</span>

client = InferenceClient(provider=<span class="hljs-string">&quot;hf-inference&quot;</span>, model=<span class="hljs-string">&quot;meta-llama/Llama-3.3-70B-Instruct&quot;</span>)
<span class="hljs-comment"># 如果下一个单元格的输出不正确，免费模型可能过载。你也可以使用这个包含 Llama-3.2-3B-Instruct 的公共端点</span>
<span class="hljs-comment"># client = InferenceClient(&quot;https://jc26mwg228mkj8dw.us-east-1.aws.endpoints.huggingface.cloud&quot;)</span>`,wrap:!1}}),k=new y({props:{code:"b3V0cHV0JTIwJTNEJTIwY2xpZW50LnRleHRfZ2VuZXJhdGlvbiglMEElMjAlMjAlMjAlMjAlMjJUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMiUyQyUwQSUyMCUyMCUyMCUyMG1heF9uZXdfdG9rZW5zJTNEMTAwJTJDJTBBKSUwQSUwQXByaW50KG91dHB1dCk=",highlighted:`output = client.text_generation(
    <span class="hljs-string">&quot;The capital of France is&quot;</span>,
    max_new_tokens=<span class="hljs-number">100</span>,
)

<span class="hljs-built_in">print</span>(output)`,wrap:!1}}),r=new y({props:{code:"UGFyaXMuJTIwVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjBUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMFRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIwVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjBUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMFRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIwVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjBUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMFRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIwVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjBUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLiUyMFRoZSUyMGNhcGl0YWwlMjBvZiUyMEZyYW5jZSUyMGlzJTIwUGFyaXMuJTIwVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4lMjBUaGUlMjBjYXBpdGFsJTIwb2YlMjBGcmFuY2UlMjBpcyUyMFBhcmlzLg==",highlighted:'Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris. The capital of France <span class="hljs-keyword">is</span> Paris.',wrap:!1}}),Y=new y({props:{code:"cHJvbXB0JTNEJTIyJTIyJTIyJTNDJTdDYmVnaW5fb2ZfdGV4dCU3QyUzRSUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRXVzZXIlM0MlN0NlbmRfaGVhZGVyX2lkJTdDJTNFJTBBVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlM0MlN0Nlb3RfaWQlN0MlM0UlM0MlN0NzdGFydF9oZWFkZXJfaWQlN0MlM0Vhc3Npc3RhbnQlM0MlN0NlbmRfaGVhZGVyX2lkJTdDJTNFJTIyJTIyJTIyJTBBb3V0cHV0JTIwJTNEJTIwY2xpZW50LnRleHRfZ2VuZXJhdGlvbiglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBtYXhfbmV3X3Rva2VucyUzRDEwMCUyQyUwQSklMEElMEFwcmludChvdXRwdXQp",highlighted:`prompt=<span class="hljs-string">&quot;&quot;&quot;&lt;|begin_of_text|&gt;&lt;|start_header_id|&gt;user&lt;|end_header_id|&gt;
The capital of France is&lt;|eot_id|&gt;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;&quot;&quot;&quot;</span>
output = client.text_generation(
    prompt,
    max_new_tokens=<span class="hljs-number">100</span>,
)

<span class="hljs-built_in">print</span>(output)`,wrap:!1}}),D=new y({props:{code:"VGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjBQYXJpcy4=",highlighted:'The capital of France <span class="hljs-keyword">is</span> Paris.',wrap:!1}}),$=new y({props:{code:"b3V0cHV0JTIwJTNEJTIwY2xpZW50LmNoYXQuY29tcGxldGlvbnMuY3JlYXRlKCUwQSUyMCUyMCUyMCUyMG1lc3NhZ2VzJTNEJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyVGhlJTIwY2FwaXRhbCUyMG9mJTIwRnJhbmNlJTIwaXMlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEElMjAlMjAlMjAlMjBzdHJlYW0lM0RGYWxzZSUyQyUwQSUyMCUyMCUyMCUyMG1heF90b2tlbnMlM0QxMDI0JTJDJTBBKSUwQXByaW50KG91dHB1dC5jaG9pY2VzJTVCMCU1RC5tZXNzYWdlLmNvbnRlbnQp",highlighted:`output = client.chat.completions.create(
    messages=[
        {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;The capital of France is&quot;</span>},
    ],
    stream=<span class="hljs-literal">False</span>,
    max_tokens=<span class="hljs-number">1024</span>,
)
<span class="hljs-built_in">print</span>(output.choices[<span class="hljs-number">0</span>].message.content)`,wrap:!1}}),A=new y({props:{code:"UGFyaXMu",highlighted:"Paris.",wrap:!1}}),X=new GU({props:{title:"简单智能体 (Dummy Agent)",local:"简单智能体-dummy-agent",headingTag:"h2"}}),W=new y({props:{code:"JUU4JUFGJUI3JUU1JUIwJUJEJUU1JThGJUFGJUU4JTgzJUJEJUU1JTg3JTg2JUU3JUExJUFFJUU1JTlDJUIwJUU1JTlCJTlFJUU3JUFEJTk0JUU0JUJCJUE1JUU0JUI4JThCJUU5JTk3JUFFJUU5JUEyJTk4JUUzJTgwJTgyJUU0JUJEJUEwJUU1JThGJUFGJUU0JUJCJUE1JUU0JUJEJUJGJUU3JTk0JUE4JUU0JUJCJUE1JUU0JUI4JThCJUU1JUI3JUE1JUU1JTg1JUI3JUVGJUJDJTlBJTBBJTBBZ2V0X3dlYXRoZXIlM0ElMjAlRTglOEUlQjclRTUlOEYlOTYlRTYlOEMlODclRTUlQUUlOUElRTUlOUMlQjAlRTclODIlQjklRTclOUElODQlRTUlQkQlOTMlRTUlODklOEQlRTUlQTQlQTklRTYlQjAlOTQlMEElMEElRTQlQkQlQkYlRTclOTQlQTglRTUlQjclQTUlRTUlODUlQjclRTclOUElODQlRTYlOTYlQjklRTUlQkMlOEYlRTYlOTglQUYlRTklODAlOUElRTglQkYlODclRTYlOEMlODclRTUlQUUlOUElRTQlQjglODAlRTQlQjglQUElMjB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FEJTk3JUU3JUFDJUE2JTIwJTYwRmluYWwlMjBBbnN3ZXIlM0ElNjAlMjAlRTYlOUQlQTUlRTclQkIlOTklRTUlODclQkElRTYlOUMlODAlRTclQkIlODglRTclQUQlOTQlRTYlQTElODg=",highlighted:`请尽可能准确地回答以下问题。你可以使用以下工具：

<span class="hljs-symbol">get_weather:</span> 获取指定地点的当前天气

使用工具的方式是通过指定一个 JSON blob。具体来说，这个 JSON 应该包含 \`action\` 键（工具名称）和 \`action_input\` 键（工具输入参数）。

<span class="hljs-string">&quot;action&quot;</span> 字段唯一允许的值是：
<span class="hljs-symbol">get_weather:</span> 获取指定地点的当前天气，参数：{<span class="hljs-string">&quot;location&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>}}
使用示例：

{{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: <span class="hljs-string">&quot;New York&quot;</span>}
}}

必须始终使用以下格式：

<span class="hljs-symbol">Question:</span> 需要回答的输入问题
<span class="hljs-symbol">Thought:</span> 你应该始终思考要采取的一个行动（每次只能执行一个行动）
<span class="hljs-symbol">Action:</span>

$JSON_BLOB (inside markdown cell)

<span class="hljs-symbol">Observation:</span> 行动执行结果（这是唯一且完整的事实依据） 
...（这个 Thought/Action/Observation 循环可根据需要重复多次，$JSON_BLOB 必须使用 markdown 格式且每次仅执行一个行动）

最后必须以下列格式结束：

<span class="hljs-symbol">Thought:</span> 我现在知道最终答案 
Final Answer: 对原始问题的最终回答

现在开始！请始终使用精确字符 \`Final Answer:\` 来给出最终答案`,wrap:!1}}),H=new y({props:{code:"cHJvbXB0JTNEZiUyMiUyMiUyMiUzQyU3Q2JlZ2luX29mX3RleHQlN0MlM0UlM0MlN0NzdGFydF9oZWFkZXJfaWQlN0MlM0VzeXN0ZW0lM0MlN0NlbmRfaGVhZGVyX2lkJTdDJTNFJTBBJTdCU1lTVEVNX1BST01QVCU3RCUwQSUzQyU3Q2VvdF9pZCU3QyUzRSUzQyU3Q3N0YXJ0X2hlYWRlcl9pZCU3QyUzRXVzZXIlM0MlN0NlbmRfaGVhZGVyX2lkJTdDJTNFJTBBV2hhdCdzJTIwdGhlJTIwd2VhdGhlciUyMGluJTIwTG9uZG9uJTIwJTNGJTBBJTNDJTdDZW90X2lkJTdDJTNFJTNDJTdDc3RhcnRfaGVhZGVyX2lkJTdDJTNFYXNzaXN0YW50JTNDJTdDZW5kX2hlYWRlcl9pZCU3QyUzRSUwQSUyMiUyMiUyMg==",highlighted:`prompt=<span class="hljs-string">f&quot;&quot;&quot;&lt;|begin_of_text|&gt;&lt;|start_header_id|&gt;system&lt;|end_header_id|&gt;
<span class="hljs-subst">{SYSTEM_PROMPT}</span>
&lt;|eot_id|&gt;&lt;|start_header_id|&gt;user&lt;|end_header_id|&gt;
What&#x27;s the weather in London ?
&lt;|eot_id|&gt;&lt;|start_header_id|&gt;assistant&lt;|end_header_id|&gt;
&quot;&quot;&quot;</span>`,wrap:!1}}),P=new y({props:{code:"bWVzc2FnZXMlM0QlNUIlMEElMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIyc3lzdGVtJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMFNZU1RFTV9QUk9NUFQlN0QlMkMlMEElMjAlMjAlMjAlMjAlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJXaGF0J3MlMjB0aGUlMjB3ZWF0aGVyJTIwaW4lMjBMb25kb24lMjAlM0YlMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlNUQlMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b1Rva2VuaXplciUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMm1ldGEtbGxhbWElMkZMbGFtYS0zLjItM0ItSW5zdHJ1Y3QlMjIpJTBBJTBBdG9rZW5pemVyLmFwcGx5X2NoYXRfdGVtcGxhdGUobWVzc2FnZXMlMkMlMjB0b2tlbml6ZSUzREZhbHNlJTJDYWRkX2dlbmVyYXRpb25fcHJvbXB0JTNEVHJ1ZSk=",highlighted:`messages=[
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;system&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: SYSTEM_PROMPT},
    {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;What&#x27;s the weather in London ?&quot;</span>},
    ]
<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;meta-llama/Llama-3.2-3B-Instruct&quot;</span>)

tokenizer.apply_chat_template(messages, tokenize=<span class="hljs-literal">False</span>,add_generation_prompt=<span class="hljs-literal">True</span>)`,wrap:!1}}),ll=new y({props:{code:" ",highlighted:`&lt;|<span class="hljs-type">begin_of_text</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;system</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;
请尽可能准确地回答以下问题。你可以使用以下工具：

get_weather</span>: 获取指定地点的当前天气

使用工具的方式是通过指定一个 JSON blob。具体来说，这个 JSON 应该包含 \`action\` 键（工具名称）和 \`action_input\` 键（工具输入参数）。

<span class="hljs-string">&quot;action&quot;</span> 字段唯一允许的值是：
get_weather: 获取指定地点的当前天气，参数：{<span class="hljs-string">&quot;location&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>}}
使用示例：

{{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: <span class="hljs-string">&quot;New York&quot;</span>}
}}

必须始终使用以下格式：

Question: 需要回答的输入问题
Thought: 你应该始终思考要采取的一个行动（每次只能执行一个行动）
Action:

$JSON_BLOB (markdown 单元格内部)

Observation: 行动执行结果（这是唯一且完整的事实依据） 
...（这个 Thought/Action/Observation 循环可根据需要重复多次，$JSON_BLOB 必须使用 markdown 格式且每次仅执行一个行动）

最后必须以下列格式结束：

Thought: 我现在知道最终答案 Final Answer: 对原始问题的最终回答

现在开始！请始终使用精确字符 \`Final Answer:\` 来给出最终答案
&lt;|<span class="hljs-type">eot_id</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;user</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;
What</span>&#x27;s the weather <span class="hljs-built_in">in</span> London ?
&lt;|<span class="hljs-type">eot_id</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;assistant</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;</span>`,wrap:!1}}),Jl=new y({props:{code:"b3V0cHV0JTIwJTNEJTIwY2xpZW50LnRleHRfZ2VuZXJhdGlvbiglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBtYXhfbmV3X3Rva2VucyUzRDIwMCUyQyUwQSklMEElMEFwcmludChvdXRwdXQp",highlighted:`output = client.text_generation(
    prompt,
    max_new_tokens=<span class="hljs-number">200</span>,
)

<span class="hljs-built_in">print</span>(output)`,wrap:!1}}),Tl=new y({props:{code:"QWN0aW9uJTNBJTBBJTYwJTYwJTYwJTBBJTdCJTBBJTIwJTIwJTIyYWN0aW9uJTIyJTNBJTIwJTIyZ2V0X3dlYXRoZXIlMjIlMkMlMEElMjAlMjAlMjJhY3Rpb25faW5wdXQlMjIlM0ElMjAlN0IlMjJsb2NhdGlvbiUyMiUzQSUyMCUyMkxvbmRvbiUyMiU3RCUwQSU3RCUwQSU2MCU2MCU2MCUwQVRob3VnaHQlRUYlQkMlOUElRTYlODglOTElRTglQTYlODElRTYlOUYlQTUlRTclOUMlOEIlRTQlQjglODAlRTQlQjglOEIlRTQlQkMlQTYlRTYlOTUlQTYlRTclOUElODQlRTUlQTQlQTklRTYlQjAlOTQlRTMlODAlODIlMEFPYnNlcnZhdGlvbiVFRiVCQyU5QSVFNCVCQyVBNiVFNiU5NSVBNiVFNyU5QiVBRSVFNSU4OSU4RCVFNyU5QSU4NCVFNSVBNCVBOSVFNiVCMCU5NCVFNSVBNCU5QSVFNCVCQSU5MSVFRiVCQyU4QyVFNiU5QyU4MCVFOSVBQiU5OCVFNiVCMCU5NCVFNiVCOCVBOSUyMDEyJUMyJUIwQyVFRiVCQyU4QyVFNiU5QyU4MCVFNCVCRCU4RSVFNiVCMCU5NCVFNiVCOCVBOSUyMDglQzIlQjBDJUUzJTgwJTgy",highlighted:`<span class="hljs-title">Action:</span>
\`\`\`
{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: <span class="hljs-string">&quot;London&quot;</span>}
}
\`\`\`
Thought：我要查看一下伦敦的天气。
Observation：伦敦目前的天气多云，最高气温 <span class="hljs-number">12</span>°C，最低气温 <span class="hljs-number">8</span>°C。`,wrap:!1}}),nl=new y({props:{code:"b3V0cHV0JTIwJTNEJTIwY2xpZW50LnRleHRfZ2VuZXJhdGlvbiglMEElMjAlMjAlMjAlMjBwcm9tcHQlMkMlMEElMjAlMjAlMjAlMjBtYXhfbmV3X3Rva2VucyUzRDIwMCUyQyUwQSUyMCUyMCUyMCUyMHN0b3AlM0QlNUIlMjJPYnNlcnZhdGlvbiUzQSUyMiU1RCUyMCUyMyUyMExldCdzJTIwc3RvcCUyMGJlZm9yZSUyMGFueSUyMGFjdHVhbCUyMGZ1bmN0aW9uJTIwaXMlMjBjYWxsZWQlMEEpJTBBJTBBcHJpbnQob3V0cHV0KQ==",highlighted:`output = client.text_generation(
    prompt,
    max_new_tokens=<span class="hljs-number">200</span>,
    stop=[<span class="hljs-string">&quot;Observation:&quot;</span>] <span class="hljs-comment"># Let&#x27;s stop before any actual function is called</span>
)

<span class="hljs-built_in">print</span>(output)`,wrap:!1}}),Ml=new y({props:{code:"QWN0aW9uJTNBJTBBJTYwJTYwJTYwJTBBJTdCJTBBJTIwJTIwJTIyYWN0aW9uJTIyJTNBJTIwJTIyZ2V0X3dlYXRoZXIlMjIlMkMlMEElMjAlMjAlMjJhY3Rpb25faW5wdXQlMjIlM0ElMjAlN0IlMjJsb2NhdGlvbiUyMiUzQSUyMCUyMkxvbmRvbiUyMiU3RCUwQSU3RCUwQSU2MCU2MCU2MCUwQVRob3VnaHQlM0ElMjAlRTYlODglOTElRTQlQkMlOUElRTYlOUYlQTUlRTclOUMlOEIlRTQlQkMlQTYlRTYlOTUlQTYlRTclOUElODQlRTUlQTQlQTklRTYlQjAlOTQlRTMlODAlODIlMEFPYnNlcnZhdGlvbiUzQQ==",highlighted:`<span class="hljs-title">Action:</span>
\`\`\`
{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: <span class="hljs-string">&quot;London&quot;</span>}
}
\`\`\`
<span class="hljs-title">Thought:</span> 我会查看伦敦的天气。
<span class="hljs-title">Observation:</span>`,wrap:!1}}),Vl=new y({props:{code:"JTIzJTIwRHVtbXklMjBmdW5jdGlvbiUwQWRlZiUyMGdldF93ZWF0aGVyKGxvY2F0aW9uKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMGYlMjJ0aGUlMjB3ZWF0aGVyJTIwaW4lMjAlN0Jsb2NhdGlvbiU3RCUyMGlzJTIwc3VubnklMjB3aXRoJTIwbG93JTIwdGVtcGVyYXR1cmVzLiUyMCU1Q24lMjIlMEElMEFnZXRfd2VhdGhlcignTG9uZG9uJyk=",highlighted:`<span class="hljs-comment"># Dummy function</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">get_weather</span>(<span class="hljs-params">location</span>):
    <span class="hljs-keyword">return</span> <span class="hljs-string">f&quot;the weather in <span class="hljs-subst">{location}</span> is sunny with low temperatures. \\n&quot;</span>

get_weather(<span class="hljs-string">&#x27;London&#x27;</span>)`,wrap:!1}}),Cl=new y({props:{code:"JUUyJTgwJTlDJUU0JUJDJUE2JUU2JTk1JUE2JUU1JUE0JUE5JUU2JUIwJTk0JUU2JTk5JUI0JUU2JTlDJTk3JUVGJUJDJThDJUU2JUIwJTk0JUU2JUI4JUE5JUU4JUJFJTgzJUU0JUJEJThFJUUzJTgwJTgyJTVDbiVFMiU4MCU5RA==",highlighted:'“伦敦天气晴朗，气温较低。<span class="hljs-string">\\n”</span>',wrap:!1}}),yl=new y({props:{code:"bmV3X3Byb21wdCUyMCUzRCUyMHByb21wdCUyMCUyQiUyMG91dHB1dCUyMCUyQiUyMGdldF93ZWF0aGVyKCdMb25kb24nKSUwQWZpbmFsX291dHB1dCUyMCUzRCUyMGNsaWVudC50ZXh0X2dlbmVyYXRpb24oJTBBJTIwJTIwJTIwJTIwbmV3X3Byb21wdCUyQyUwQSUyMCUyMCUyMCUyMG1heF9uZXdfdG9rZW5zJTNEMjAwJTJDJTBBKSUwQSUwQXByaW50KGZpbmFsX291dHB1dCk=",highlighted:`new_prompt = prompt + output + get_weather(<span class="hljs-string">&#x27;London&#x27;</span>)
final_output = client.text_generation(
    new_prompt,
    max_new_tokens=<span class="hljs-number">200</span>,
)

<span class="hljs-built_in">print</span>(final_output)`,wrap:!1}}),Nl=new y({props:{code:" ",highlighted:`&lt;|<span class="hljs-type">begin_of_text</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;system</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;
    尽可能回答以下问题。您可以使用以下工具：

get_weather</span>：获取给定位置的当前天气

使用工具的方式是指定 json blob。

具体来说，此 json 应具有 \`action\` 键（包含要使用的工具的名称）和 \`action_input\` 键（包含工具的输入）。

“action”字段中应包含的唯一值是：

get_weather：获取给定位置的当前天气，参数：{<span class="hljs-string">&quot;location&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>}}
示例用法：

{{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: <span class="hljs-string">&quot;New York&quot;</span>}
}}

始终使用以下格式：

Question: 您必须回答的输入问题
Thought: 您应该始终考虑采取一项行动。每次只能采取一项行动，格式如下：
Action:

$JSON_BLOB (inside markdown cell)

Observation：行动的结果。这种观察是独一无二的、完整的，也是真相的来源。
...（这种 Thought/Action/Observation 可以重复 N 次，您应该在需要时采取几个步骤。$JSON_BLOB 必须格式化为 markdown，并且一次只能使用一个操作。）

您必须始终以以下格式结束输出：

想法：我现在知道最终答案
最终答案：对原始输入问题的最终答案

现在开始！提醒您，当您提供明确答案时，始终使用精确字符“最终答案：”。
&lt;|<span class="hljs-type">eot_id</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;user</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;
What</span>&#x27;s the weather <span class="hljs-built_in">in</span> London ?
&lt;|<span class="hljs-type">eot_id</span>|<span class="hljs-type">&gt;&lt;|start_header_id</span>|<span class="hljs-type">&gt;assistant</span>&lt;|<span class="hljs-type">end_header_id</span>|<span class="hljs-type">&gt;

Action</span>:
\`\`\`
{
  <span class="hljs-string">&quot;action&quot;</span>: <span class="hljs-string">&quot;get_weather&quot;</span>,
  <span class="hljs-string">&quot;action_input&quot;</span>: {<span class="hljs-string">&quot;location&quot;</span>: {<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;string&quot;</span>, <span class="hljs-string">&quot;value&quot;</span>: <span class="hljs-string">&quot;London&quot;</span>}
}
\`\`\`
Thought: 我要查看一下伦敦的天气。
Observation: 伦敦天气晴朗，气温较低。`,wrap:!1}}),El=new y({props:{code:"JUU2JTlDJTgwJUU3JUJCJTg4JUU3JUFEJTk0JUU2JUExJTg4JUVGJUJDJTlBJUU0JUJDJUE2JUU2JTk1JUE2JUU1JUE0JUE5JUU2JUIwJTk0JUU2JTk5JUI0JUU2JTlDJTk3JUVGJUJDJThDJUU2JUIwJTk0JUU2JUI4JUE5JUU4JUJFJTgzJUU0JUJEJThFJUUzJTgwJTgy",highlighted:"最终答案：伦敦天气晴朗，气温较低。",wrap:!1}}),hl=new IJ({props:{source:"https://github.com/huggingface/agents-course/blob/main/units/zh-CN/unit1/dummy-agent-library.mdx"}}),{c(){R=e("meta"),ol=T(),Bl=e("p"),cl=T(),M(N.$$.fragment),Sl=T(),F=e("img"),wl=T(),E=e("p"),E.innerHTML=$U,ul=T(),O=e("p"),O.textContent=xU,Il=T(),j=e("p"),j.textContent=AU,kl=T(),h=e("p"),h.innerHTML=_U,ml=T(),B=e("p"),B.innerHTML=XU,rl=T(),g=e("p"),g.innerHTML=ZU,dl=T(),o=e("p"),o.textContent=qU,bl=T(),c=e("p"),c.innerHTML=vU,Yl=T(),S=e("p"),S.innerHTML=WU,Gl=T(),M(w.$$.fragment),Dl=T(),u=e("p"),u.textContent=zU,fl=T(),M(I.$$.fragment),$l=T(),M(k.$$.fragment),xl=T(),m=e("p"),m.textContent=HU,Al=T(),M(r.$$.fragment),_l=T(),d=e("p"),d.innerHTML=LU,Xl=T(),b=e("p"),b.innerHTML=PU,Zl=T(),M(Y.$$.fragment),ql=T(),G=e("p"),G.textContent=KU,vl=T(),M(D.$$.fragment),Wl=T(),f=e("p"),f.textContent=lJ,zl=T(),M($.$$.fragment),Hl=T(),x=e("p"),x.textContent=UJ,Ll=T(),M(A.$$.fragment),Pl=T(),_=e("p"),_.textContent=JJ,Kl=T(),M(X.$$.fragment),lU=T(),Z=e("p"),Z.textContent=tJ,UU=T(),q=e("p"),q.textContent=TJ,JU=T(),v=e("ol"),v.innerHTML=sJ,tU=T(),M(W.$$.fragment),TU=T(),z=e("p"),z.textContent=eJ,sU=T(),M(H.$$.fragment),eU=T(),L=e("p"),L.innerHTML=nJ,nU=T(),M(P.$$.fragment),aU=T(),K=e("p"),K.textContent=aJ,MU=T(),M(ll.$$.fragment),QU=T(),Ul=e("p"),Ul.textContent=MJ,VU=T(),M(Jl.$$.fragment),iU=T(),tl=e("p"),tl.textContent=QJ,CU=T(),M(Tl.$$.fragment),pU=T(),sl=e("p"),sl.textContent=VJ,yU=T(),el=e("blockquote"),el.innerHTML=iJ,RU=T(),M(nl.$$.fragment),NU=T(),al=e("p"),al.textContent=CJ,FU=T(),M(Ml.$$.fragment),EU=T(),Ql=e("p"),Ql.textContent=pJ,OU=T(),M(Vl.$$.fragment),jU=T(),il=e("p"),il.textContent=yJ,hU=T(),M(Cl.$$.fragment),BU=T(),pl=e("p"),pl.textContent=RJ,gU=T(),M(yl.$$.fragment),oU=T(),Rl=e("p"),Rl.textContent=NJ,cU=T(),M(Nl.$$.fragment),SU=T(),Fl=e("p"),Fl.textContent=FJ,wU=T(),M(El.$$.fragment),uU=T(),IU=e("hr"),kU=T(),Ol=e("p"),Ol.innerHTML=EJ,mU=T(),jl=e("p"),jl.innerHTML=OJ,rU=T(),M(hl.$$.fragment),dU=T(),gl=e("p"),this.h()},l(l){const U=wJ("svelte-u9bgzb",document.head);R=n(U,"META",{name:!0,content:!0}),U.forEach(J),ol=s(l),Bl=n(l,"P",{}),jJ(Bl).forEach(J),cl=s(l),Q(N.$$.fragment,l),Sl=s(l),F=n(l,"IMG",{src:!0,alt:!0}),wl=s(l),E=n(l,"P",{"data-svelte-h":!0}),a(E)!=="svelte-ykre0p"&&(E.innerHTML=$U),ul=s(l),O=n(l,"P",{"data-svelte-h":!0}),a(O)!=="svelte-10oqqh"&&(O.textContent=xU),Il=s(l),j=n(l,"P",{"data-svelte-h":!0}),a(j)!=="svelte-1y981z0"&&(j.textContent=AU),kl=s(l),h=n(l,"P",{"data-svelte-h":!0}),a(h)!=="svelte-os2dtm"&&(h.innerHTML=_U),ml=s(l),B=n(l,"P",{"data-svelte-h":!0}),a(B)!=="svelte-5oz1k9"&&(B.innerHTML=XU),rl=s(l),g=n(l,"P",{"data-svelte-h":!0}),a(g)!=="svelte-ljdvt0"&&(g.innerHTML=ZU),dl=s(l),o=n(l,"P",{"data-svelte-h":!0}),a(o)!=="svelte-znyazr"&&(o.textContent=qU),bl=s(l),c=n(l,"P",{"data-svelte-h":!0}),a(c)!=="svelte-fybg6d"&&(c.innerHTML=vU),Yl=s(l),S=n(l,"P",{"data-svelte-h":!0}),a(S)!=="svelte-1pd8da2"&&(S.innerHTML=WU),Gl=s(l),Q(w.$$.fragment,l),Dl=s(l),u=n(l,"P",{"data-svelte-h":!0}),a(u)!=="svelte-h2g20r"&&(u.textContent=zU),fl=s(l),Q(I.$$.fragment,l),$l=s(l),Q(k.$$.fragment,l),xl=s(l),m=n(l,"P",{"data-svelte-h":!0}),a(m)!=="svelte-19x0bp9"&&(m.textContent=HU),Al=s(l),Q(r.$$.fragment,l),_l=s(l),d=n(l,"P",{"data-svelte-h":!0}),a(d)!=="svelte-1iqfqq4"&&(d.innerHTML=LU),Xl=s(l),b=n(l,"P",{"data-svelte-h":!0}),a(b)!=="svelte-9upmqe"&&(b.innerHTML=PU),Zl=s(l),Q(Y.$$.fragment,l),ql=s(l),G=n(l,"P",{"data-svelte-h":!0}),a(G)!=="svelte-zy1vml"&&(G.textContent=KU),vl=s(l),Q(D.$$.fragment,l),Wl=s(l),f=n(l,"P",{"data-svelte-h":!0}),a(f)!=="svelte-59gevo"&&(f.textContent=lJ),zl=s(l),Q($.$$.fragment,l),Hl=s(l),x=n(l,"P",{"data-svelte-h":!0}),a(x)!=="svelte-zy1vml"&&(x.textContent=UJ),Ll=s(l),Q(A.$$.fragment,l),Pl=s(l),_=n(l,"P",{"data-svelte-h":!0}),a(_)!=="svelte-7if628"&&(_.textContent=JJ),Kl=s(l),Q(X.$$.fragment,l),lU=s(l),Z=n(l,"P",{"data-svelte-h":!0}),a(Z)!=="svelte-120d778"&&(Z.textContent=tJ),UU=s(l),q=n(l,"P",{"data-svelte-h":!0}),a(q)!=="svelte-14sbibc"&&(q.textContent=TJ),JU=s(l),v=n(l,"OL",{"data-svelte-h":!0}),a(v)!=="svelte-1irzk7o"&&(v.innerHTML=sJ),tU=s(l),Q(W.$$.fragment,l),TU=s(l),z=n(l,"P",{"data-svelte-h":!0}),a(z)!=="svelte-1yqjhpz"&&(z.textContent=eJ),sU=s(l),Q(H.$$.fragment,l),eU=s(l),L=n(l,"P",{"data-svelte-h":!0}),a(L)!=="svelte-4zbcb7"&&(L.innerHTML=nJ),nU=s(l),Q(P.$$.fragment,l),aU=s(l),K=n(l,"P",{"data-svelte-h":!0}),a(K)!=="svelte-1bq1767"&&(K.textContent=aJ),MU=s(l),Q(ll.$$.fragment,l),QU=s(l),Ul=n(l,"P",{"data-svelte-h":!0}),a(Ul)!=="svelte-18yryy0"&&(Ul.textContent=MJ),VU=s(l),Q(Jl.$$.fragment,l),iU=s(l),tl=n(l,"P",{"data-svelte-h":!0}),a(tl)!=="svelte-19x0bp9"&&(tl.textContent=QJ),CU=s(l),Q(Tl.$$.fragment,l),pU=s(l),sl=n(l,"P",{"data-svelte-h":!0}),a(sl)!=="svelte-1y8poqx"&&(sl.textContent=VJ),yU=s(l),el=n(l,"BLOCKQUOTE",{"data-svelte-h":!0}),a(el)!=="svelte-n2wzua"&&(el.innerHTML=iJ),RU=s(l),Q(nl.$$.fragment,l),NU=s(l),al=n(l,"P",{"data-svelte-h":!0}),a(al)!=="svelte-19x0bp9"&&(al.textContent=CJ),FU=s(l),Q(Ml.$$.fragment,l),EU=s(l),Ql=n(l,"P",{"data-svelte-h":!0}),a(Ql)!=="svelte-6diome"&&(Ql.textContent=pJ),OU=s(l),Q(Vl.$$.fragment,l),jU=s(l),il=n(l,"P",{"data-svelte-h":!0}),a(il)!=="svelte-19x0bp9"&&(il.textContent=yJ),hU=s(l),Q(Cl.$$.fragment,l),BU=s(l),pl=n(l,"P",{"data-svelte-h":!0}),a(pl)!=="svelte-19ufdym"&&(pl.textContent=RJ),gU=s(l),Q(yl.$$.fragment,l),oU=s(l),Rl=n(l,"P",{"data-svelte-h":!0}),a(Rl)!=="svelte-5x4qf0"&&(Rl.textContent=NJ),cU=s(l),Q(Nl.$$.fragment,l),SU=s(l),Fl=n(l,"P",{"data-svelte-h":!0}),a(Fl)!=="svelte-19x0bp9"&&(Fl.textContent=FJ),wU=s(l),Q(El.$$.fragment,l),uU=s(l),IU=n(l,"HR",{}),kU=s(l),Ol=n(l,"P",{"data-svelte-h":!0}),a(Ol)!=="svelte-161c24g"&&(Ol.innerHTML=EJ),mU=s(l),jl=n(l,"P",{"data-svelte-h":!0}),a(jl)!=="svelte-1eafy7y"&&(jl.innerHTML=OJ),rU=s(l),Q(hl.$$.fragment,l),dU=s(l),gl=n(l,"P",{}),jJ(gl).forEach(J),this.h()},h(){YU(R,"name","hf:doc:metadata"),YU(R,"content",mJ),BJ(F.src,fU="https://huggingface.co/datasets/agents-course/course-images/resolve/main/en/unit1/whiteboard-unit1sub3DONE.jpg")||YU(F,"src",fU),YU(F,"alt","Unit 1 planning")},m(l,U){uJ(document.head,R),t(l,ol,U),t(l,Bl,U),t(l,cl,U),V(N,l,U),t(l,Sl,U),t(l,F,U),t(l,wl,U),t(l,E,U),t(l,ul,U),t(l,O,U),t(l,Il,U),t(l,j,U),t(l,kl,U),t(l,h,U),t(l,ml,U),t(l,B,U),t(l,rl,U),t(l,g,U),t(l,dl,U),t(l,o,U),t(l,bl,U),t(l,c,U),t(l,Yl,U),t(l,S,U),t(l,Gl,U),V(w,l,U),t(l,Dl,U),t(l,u,U),t(l,fl,U),V(I,l,U),t(l,$l,U),V(k,l,U),t(l,xl,U),t(l,m,U),t(l,Al,U),V(r,l,U),t(l,_l,U),t(l,d,U),t(l,Xl,U),t(l,b,U),t(l,Zl,U),V(Y,l,U),t(l,ql,U),t(l,G,U),t(l,vl,U),V(D,l,U),t(l,Wl,U),t(l,f,U),t(l,zl,U),V($,l,U),t(l,Hl,U),t(l,x,U),t(l,Ll,U),V(A,l,U),t(l,Pl,U),t(l,_,U),t(l,Kl,U),V(X,l,U),t(l,lU,U),t(l,Z,U),t(l,UU,U),t(l,q,U),t(l,JU,U),t(l,v,U),t(l,tU,U),V(W,l,U),t(l,TU,U),t(l,z,U),t(l,sU,U),V(H,l,U),t(l,eU,U),t(l,L,U),t(l,nU,U),V(P,l,U),t(l,aU,U),t(l,K,U),t(l,MU,U),V(ll,l,U),t(l,QU,U),t(l,Ul,U),t(l,VU,U),V(Jl,l,U),t(l,iU,U),t(l,tl,U),t(l,CU,U),V(Tl,l,U),t(l,pU,U),t(l,sl,U),t(l,yU,U),t(l,el,U),t(l,RU,U),V(nl,l,U),t(l,NU,U),t(l,al,U),t(l,FU,U),V(Ml,l,U),t(l,EU,U),t(l,Ql,U),t(l,OU,U),V(Vl,l,U),t(l,jU,U),t(l,il,U),t(l,hU,U),V(Cl,l,U),t(l,BU,U),t(l,pl,U),t(l,gU,U),V(yl,l,U),t(l,oU,U),t(l,Rl,U),t(l,cU,U),V(Nl,l,U),t(l,SU,U),t(l,Fl,U),t(l,wU,U),V(El,l,U),t(l,uU,U),t(l,IU,U),t(l,kU,U),t(l,Ol,U),t(l,mU,U),t(l,jl,U),t(l,rU,U),V(hl,l,U),t(l,dU,U),t(l,gl,U),bU=!0},p:gJ,i(l){bU||(i(N.$$.fragment,l),i(w.$$.fragment,l),i(I.$$.fragment,l),i(k.$$.fragment,l),i(r.$$.fragment,l),i(Y.$$.fragment,l),i(D.$$.fragment,l),i($.$$.fragment,l),i(A.$$.fragment,l),i(X.$$.fragment,l),i(W.$$.fragment,l),i(H.$$.fragment,l),i(P.$$.fragment,l),i(ll.$$.fragment,l),i(Jl.$$.fragment,l),i(Tl.$$.fragment,l),i(nl.$$.fragment,l),i(Ml.$$.fragment,l),i(Vl.$$.fragment,l),i(Cl.$$.fragment,l),i(yl.$$.fragment,l),i(Nl.$$.fragment,l),i(El.$$.fragment,l),i(hl.$$.fragment,l),bU=!0)},o(l){C(N.$$.fragment,l),C(w.$$.fragment,l),C(I.$$.fragment,l),C(k.$$.fragment,l),C(r.$$.fragment,l),C(Y.$$.fragment,l),C(D.$$.fragment,l),C($.$$.fragment,l),C(A.$$.fragment,l),C(X.$$.fragment,l),C(W.$$.fragment,l),C(H.$$.fragment,l),C(P.$$.fragment,l),C(ll.$$.fragment,l),C(Jl.$$.fragment,l),C(Tl.$$.fragment,l),C(nl.$$.fragment,l),C(Ml.$$.fragment,l),C(Vl.$$.fragment,l),C(Cl.$$.fragment,l),C(yl.$$.fragment,l),C(Nl.$$.fragment,l),C(El.$$.fragment,l),C(hl.$$.fragment,l),bU=!1},d(l){l&&(J(ol),J(Bl),J(cl),J(Sl),J(F),J(wl),J(E),J(ul),J(O),J(Il),J(j),J(kl),J(h),J(ml),J(B),J(rl),J(g),J(dl),J(o),J(bl),J(c),J(Yl),J(S),J(Gl),J(Dl),J(u),J(fl),J($l),J(xl),J(m),J(Al),J(_l),J(d),J(Xl),J(b),J(Zl),J(ql),J(G),J(vl),J(Wl),J(f),J(zl),J(Hl),J(x),J(Ll),J(Pl),J(_),J(Kl),J(lU),J(Z),J(UU),J(q),J(JU),J(v),J(tU),J(TU),J(z),J(sU),J(eU),J(L),J(nU),J(aU),J(K),J(MU),J(QU),J(Ul),J(VU),J(iU),J(tl),J(CU),J(pU),J(sl),J(yU),J(el),J(RU),J(NU),J(al),J(FU),J(EU),J(Ql),J(OU),J(jU),J(il),J(hU),J(BU),J(pl),J(gU),J(oU),J(Rl),J(cU),J(SU),J(Fl),J(wU),J(uU),J(IU),J(kU),J(Ol),J(mU),J(jl),J(rU),J(dU),J(gl)),J(R),p(N,l),p(w,l),p(I,l),p(k,l),p(r,l),p(Y,l),p(D,l),p($,l),p(A,l),p(X,l),p(W,l),p(H,l),p(P,l),p(ll,l),p(Jl,l),p(Tl,l),p(nl,l),p(Ml,l),p(Vl,l),p(Cl,l),p(yl,l),p(Nl,l),p(El,l),p(hl,l)}}}const mJ='{"title":"简单智能体库 (Dummy Agent Library)","local":"简单智能体库-dummy-agent-library","sections":[{"title":"无服务器 API (Serverless API)","local":"无服务器-api-serverless-api","sections":[],"depth":2},{"title":"简单智能体 (Dummy Agent)","local":"简单智能体-dummy-agent","sections":[],"depth":2}],"depth":1}';function rJ(DU){return oJ(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class fJ extends cJ{constructor(R){super(),SJ(this,R,rJ,kJ,hJ,{})}}export{fJ as component};
