Browse Source

fix Chinese&English

jjyaoao 7 months ago
parent
commit
ca8125eff5
33 changed files with 76 additions and 154 deletions
  1. 0 4
      docs/chapter1/Chapter1-Introduction-to-Agents.md
  2. 0 4
      docs/chapter1/第一章 初识智能体.md
  3. 0 4
      docs/chapter10/Chapter10-Agent-Communication-Protocols.md
  4. 0 4
      docs/chapter10/第十章 智能体通信协议.md
  5. 0 4
      docs/chapter11/Chapter11-Agentic-RL.md
  6. 0 4
      docs/chapter11/第十一章 Agentic-RL.md
  7. 0 4
      docs/chapter12/Chapter12-Agent-Performance-Evaluation.md
  8. 0 4
      docs/chapter12/第十二章 智能体性能评估.md
  9. 0 4
      docs/chapter13/Chapter13-Intelligent-Travel-Assistant.md
  10. 0 4
      docs/chapter13/第十三章 智能旅行助手.md
  11. 0 4
      docs/chapter14/Chapter14-Automated-Deep-Research-Agent.md
  12. 0 4
      docs/chapter14/第十四章 自动化深度研究智能体.md
  13. 0 4
      docs/chapter15/Chapter15-Building-Cyber-Town.md
  14. 0 4
      docs/chapter15/第十五章 构建赛博小镇.md
  15. 0 4
      docs/chapter16/Chapter16-Graduation-Project.md
  16. 0 4
      docs/chapter16/第十六章 毕业设计.md
  17. 0 4
      docs/chapter2/Chapter2-History-of-Agents.md
  18. 0 4
      docs/chapter2/第二章 智能体发展史.md
  19. 0 4
      docs/chapter3/Chapter3-Fundamentals-of-Large-Language-Models.md
  20. 0 4
      docs/chapter3/第三章 大语言模型基础.md
  21. 0 4
      docs/chapter4/Chapter4-Building-Classic-Agent-Paradigms.md
  22. 0 4
      docs/chapter4/第四章 智能体经典范式构建.md
  23. 0 4
      docs/chapter5/Chapter5-Building-Agents-with-Low-Code-Platforms.md
  24. 0 4
      docs/chapter5/第五章 基于低代码平台的智能体搭建.md
  25. 0 4
      docs/chapter6/Chapter6-Framework-Development-Practice.md
  26. 0 4
      docs/chapter6/第六章 框架开发实践.md
  27. 0 4
      docs/chapter7/Chapter7-Building-Your-Agent-Framework.md
  28. 0 4
      docs/chapter7/第七章 构建你的Agent框架.md
  29. 0 4
      docs/chapter8/Chapter8-Memory-and-Retrieval.md
  30. 0 4
      docs/chapter8/第八章 记忆与检索.md
  31. 0 4
      docs/chapter9/Chapter9-Context-Engineering.md
  32. 0 4
      docs/chapter9/第九章 上下文工程.md
  33. 76 26
      docs/index.html

+ 0 - 4
docs/chapter1/Chapter1-Introduction-to-Agents.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第一章 初识智能体.md">中文</a>
-</div>
-
 # Chapter 1: Introduction to Agents
 
 Welcome to the world of agents! In today's era where the wave of artificial intelligence is sweeping across the globe, **Agents** have become one of the core concepts driving technological transformation and application innovation. Whether your aspiration is to become a researcher or engineer in the AI field, or you hope to deeply understand the cutting edge of technology as an observer, mastering the essence of agents will be an indispensable part of your knowledge system.

+ 0 - 4
docs/chapter1/第一章 初识智能体.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter1-Introduction-to-Agents.md">English</a> | 中文
-</div>
-
 # 第一章 初识智能体
 
 欢迎来到智能体的世界!在人工智能浪潮席卷全球的今天,<strong>智能体(Agent)</strong>已成为驱动技术变革与应用创新的核心概念之一。无论你的志向是成为 AI 领域的研究者、工程师,还是希望深刻理解技术前沿的观察者,掌握智能体的本质,都将是你知识体系中不可或缺的一环。

+ 0 - 4
docs/chapter10/Chapter10-Agent-Communication-Protocols.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十章%20智能体通信协议.md">中文</a>
-</div>
-
 # Chapter 10: Agent Communication Protocols
 
 In previous chapters, we built fully functional standalone agents with reasoning, tool invocation, and memory capabilities. However, when attempting to build more complex AI systems, natural questions arise: **How can agents efficiently interact with the external world? How can multiple agents collaborate with each other?**

+ 0 - 4
docs/chapter10/第十章 智能体通信协议.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter10-Agent-Communication-Protocols.md">English</a> | 中文
-</div>
-
 # 第十章 智能体通信协议
 
 在前面的章节中,我们构建了功能完备的单体智能体,它们具备推理、工具调用和记忆能力。然而,当我们尝试构建更复杂的 AI 系统时,自然会有疑问:<strong>如何让智能体与外部世界高效交互?如何让多个智能体相互协作?</strong>

+ 0 - 4
docs/chapter11/Chapter11-Agentic-RL.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十一章%20Agentic-RL.md">中文</a>
-</div>
-
 # Chapter 11 Agentic-RL
 
 ## 11.1 From LLM Training to Agentic RL

+ 0 - 4
docs/chapter11/第十一章 Agentic-RL.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter11-Agentic-RL.md">English</a> | 中文
-</div>
-
 # 第十一章 Agentic-RL
 
 ## 11.1 从 LLM 训练到 Agentic RL

+ 0 - 4
docs/chapter12/Chapter12-Agent-Performance-Evaluation.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十二章%20智能体性能评估.md">中文</a>
-</div>
-
 # Chapter 12: Agent Performance Evaluation
 
 In previous chapters, we built the core functionality of the HelloAgents framework, implementing various agent paradigms, tool systems, memory mechanisms, and reinforcement learning training. When building agent systems, we also need to solve a core problem: **How to objectively evaluate agent performance?** Specifically, we need to answer the following questions:

+ 0 - 4
docs/chapter12/第十二章 智能体性能评估.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter12-Agent-Performance-Evaluation.md">English</a> | 中文
-</div>
-
 # 第十二章 智能体性能评估
 
 在前面的章节中,我们构建了 HelloAgents 框架的核心功能,实现了多种智能体范式、工具系统、记忆机制和强化学习训练等。在构建智能体系统时,我们还需要解决一个核心问题:<strong>如何客观地评估智能体的性能?</strong> 具体来说,我们需要回答以下问题:

+ 0 - 4
docs/chapter13/Chapter13-Intelligent-Travel-Assistant.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十三章%20智能旅行助手.md">中文</a>
-</div>
-
 # Chapter 13 Intelligent Travel Assistant
 
 In previous chapters, we built the HelloAgents framework from scratch, implementing core functionalities including various agent paradigms, tool systems, memory mechanisms, protocol communication, and performance evaluation. Starting from this chapter, we will enter a completely new phase: **integrating all learned knowledge to build complete practical applications.**

+ 0 - 4
docs/chapter13/第十三章 智能旅行助手.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter13-Intelligent-Travel-Assistant.md">English</a> | 中文
-</div>
-
 # 第十三章 智能旅行助手
 
 在前面的章节中,我们从零开始构建了 HelloAgents 框架,实现了多种智能体范式、工具系统、记忆机制、协议通信和性能评估等核心功能。从本章开始,我们将进入一个全新的阶段:<strong>将所学知识融会贯通,构建完整的实用应用。</strong>

+ 0 - 4
docs/chapter14/Chapter14-Automated-Deep-Research-Agent.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十四章%20自动化深度研究智能体.md">中文</a>
-</div>
-
 # Chapter 14: Automated Deep Research Agent
 
 In Chapter 13's travel assistant project, we experienced how to apply HelloAgents to a multi-agent product. In this chapter, we continue forward, focusing on **knowledge-intensive applications**: **building an agent assistant that can automatically execute deep research tasks.**

+ 0 - 4
docs/chapter14/第十四章 自动化深度研究智能体.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter14-Automated-Deep-Research-Agent.md">English</a> | 中文
-</div>
-
 # 第十四章 自动化深度研究智能体
 
 在第十三章的旅行助手项目中,我们体验了如何将 HelloAgents 应用于一个多智能体产品。本章我们继续向前,聚焦「知识密集型应用」:<strong>构建一个能够自动化执行深度研究任务的智能体助手。</strong>

+ 0 - 4
docs/chapter15/Chapter15-Building-Cyber-Town.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十五章%20构建赛博小镇.md">中文</a>
-</div>
-
 # Chapter 15: Building Cyber Town
 
 In this chapter, we will explore a brand new direction: **combining agent technology with game engines to build an AI town full of vitality**.

+ 0 - 4
docs/chapter15/第十五章 构建赛博小镇.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter15-Building-Cyber-Town.md">English</a> | 中文
-</div>
-
 # 第十五章 构建赛博小镇
 
 这一章,我们将探索一个全新的方向:<strong>将智能体技术与游戏引擎结合,构建一个充满生命力的 AI 小镇</strong>。

+ 0 - 4
docs/chapter16/Chapter16-Graduation-Project.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第十六章%20毕业设计.md">中文</a>
-</div>
-
 # Chapter 16: Graduation Project - Building Your Own Multi-Agent Application
 
 Congratulations on reaching the final chapter of the Hello-Agents tutorial! In the previous 15 chapters, we built the HelloAgents framework from scratch and learned about core agent concepts, multiple paradigms, tool systems, memory mechanisms, communication protocols, reinforcement learning training, and performance evaluation. In Chapters 13-15, we also demonstrated how to integrate all learned knowledge through three complete practical projects (Intelligent Travel Assistant, Automated Deep Research Agent, and Cyber Town).

+ 0 - 4
docs/chapter16/第十六章 毕业设计.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter16-Graduation-Project.md">English</a> | 中文
-</div>
-
 # 第十六章 毕业设计:构建属于你的多智能体应用
 
 恭喜你来到 Hello-Agents 教程的最后一章!在前面的 15 章中,我们从零开始构建了 HelloAgents 框架,学习了智能体的核心概念、多种范式、工具系统、记忆机制、通信协议、强化学习训练和性能评估等知识。在第 13-15 章中,我们还通过三个完整的实战项目(智能旅行助手、自动化深度研究智能体、赛博小镇)展示了如何将所学知识融会贯通。

+ 0 - 4
docs/chapter2/Chapter2-History-of-Agents.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第二章 智能体发展史.md">中文</a>
-</div>
-
 # Chapter 2: History of Agents
 
 To deeply understand why modern agents present their current form and the origins of their core design philosophies, this chapter will trace back through history: starting from the classical era of artificial intelligence, exploring how the earliest "intelligence" was defined within rule systems of logic and symbols; then witnessing the major shift from single, centralized intelligence models to distributed, collaborative intelligence thinking; and finally understanding how the "learning" paradigm completely transformed the way agents acquire capabilities, giving birth to the modern agents we see today.

+ 0 - 4
docs/chapter2/第二章 智能体发展史.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter2-History-of-Agents.md">English</a> | 中文
-</div>
-
 # 第二章 智能体发展史
 
 为了深刻理解现代智能体为何呈现出如今的形态,以及其核心设计思想的由来,本章将回溯历史:从人工智能领域的古典时代出发,探寻最早的“智能”如何在逻辑与符号的规则体系中被定义;继而见证从单一、集中的智能模型到分布式、协作式智能思想的重大转折;最终理解“学习”范式如何彻底改变了智能体获取能力的方式,并催生出我们今天所见的现代智能体。

+ 0 - 4
docs/chapter3/Chapter3-Fundamentals-of-Large-Language-Models.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第三章 大语言模型基础.md">中文</a>
-</div>
-
 # Chapter 3: Fundamentals of Large Language Models
 
 The first two chapters introduced the definition and development history of agents. This chapter will focus entirely on large language models themselves to answer a key question: How do modern agents work? We will start from the basic definition of language models, and through learning these principles, lay a solid foundation for understanding how LLMs acquire powerful knowledge reserves and reasoning capabilities.

+ 0 - 4
docs/chapter3/第三章 大语言模型基础.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter3-Fundamentals-of-Large-Language-Models.md">English</a> | 中文
-</div>
-
 # 第三章 大语言模型基础
 
 前两章分别介绍了智能体的定义和发展历史,本章将完全聚焦于大语言模型本身解答一个关键问题:现代智能体是如何工作的?我们将从语言模型的基本定义出发,通过对这些原理的学习,为理解LLM如何获得强大的知识储备与推理能力打下坚实的基础。

+ 0 - 4
docs/chapter4/Chapter4-Building-Classic-Agent-Paradigms.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第四章%20智能体经典范式构建.md">中文</a>
-</div>
-
 # Chapter 4: Building Classic Agent Paradigms
 
 In the previous chapter, we deeply explored large language models as the "brain" of modern agents. We learned about their internal Transformer architecture, methods for interacting with them, and their capability boundaries. Now, it's time to transform this theoretical knowledge into practice and build agents with our own hands.

+ 0 - 4
docs/chapter4/第四章 智能体经典范式构建.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter4-Building-Classic-Agent-Paradigms.md">English</a> | 中文
-</div>
-
 # 第四章 智能体经典范式构建
 
 在上一章中,我们深入探讨了作为现代智能体“大脑”的大语言模型。我们了解了其内部的Transformer架构、与之交互的方法,以及它的能力边界。现在,是时候将这些理论知识转化为实践,亲手构建智能体了。

+ 0 - 4
docs/chapter5/Chapter5-Building-Agents-with-Low-Code-Platforms.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第五章%20基于低代码平台的智能体搭建.md">中文</a>
-</div>
-
 # Chapter 5: Building Agents with Low-Code Platforms
 
 In the previous chapter, by writing Python code, we implemented various classic agent workflows from scratch, including ReAct, Plan-and-Solve, and Reflection. This process laid a solid technical foundation for us and gave us a deep understanding of the internal mechanisms of agents. However, for a rapidly developing field, pure code development is not always the most efficient choice, especially in scenarios where ideas need to be quickly validated or non-professional developers want to participate in building.

+ 0 - 4
docs/chapter5/第五章 基于低代码平台的智能体搭建.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter5-Building-Agents-with-Low-Code-Platforms.md">English</a> | 中文
-</div>
-
 # 第五章 基于低代码平台的智能体搭建
 
 在前一章中,通过编写 Python 代码,从零开始实现了 ReAct、Plan-and-Solve 和 Reflection 多种经典的智能体工作流。这个过程为我们打下了坚实的技术基础,让我们深刻理解了智能体内部的运作机理。然而,对于一个快速发展的领域而言,纯代码的开发模式并非总是最高效的选择,尤其是在需要快速验证想法、或者非专业开发者希望参与构建的场景中。

+ 0 - 4
docs/chapter6/Chapter6-Framework-Development-Practice.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第六章%20框架开发实践.md">中文</a>
-</div>
-
 # Chapter 6 Framework Development Practice
 
 In Chapter 4, we implemented the core workflows of several agents such as ReAct, Plan-and-Solve, and Reflection by writing native code. This process gave us an understanding of the internal execution logic of agents. Subsequently, in Chapter 5, we switched to the "user" perspective and experienced the convenience and efficiency brought by low-code platforms.

+ 0 - 4
docs/chapter6/第六章 框架开发实践.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter6-Framework-Development-Practice.md">English</a> | 中文
-</div>
-
 # 第六章 框架开发实践
 
 在第四章中,我们通过编写原生代码,实现了 ReAct、Plan-and-Solve 和 Reflection 这几种智能体的核心工作流。这个过程让我们对智能体的内在执行逻辑有了理解。随后,在第五章,我们切换到“使用者”的视角,体验了低代码平台带来的便捷与高效。

+ 0 - 4
docs/chapter7/Chapter7-Building-Your-Agent-Framework.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第七章%20构建你的Agent框架.md">中文</a>
-</div>
-
 # Chapter 7 Building Your Agent Framework
 
 In the previous chapters, we explained the fundamentals of agents and experienced the development convenience brought by mainstream frameworks. Starting from this chapter, we will enter a more challenging and valuable stage: **building an agent framework from scratch—HelloAgents**.

+ 0 - 4
docs/chapter7/第七章 构建你的Agent框架.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter7-Building-Your-Agent-Framework.md">English</a> | 中文
-</div>
-
 # 第七章 构建你的智能体框架
 
 在前面的章节中,我们讲解了智能体的基础知识,并体验了主流框架带来的开发便利。从本章开始,我们将进入一个更具挑战也更有价值的阶段:**从零开始,逐步构建一个智能体框架——HelloAgents**。

+ 0 - 4
docs/chapter8/Chapter8-Memory-and-Retrieval.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第八章%20记忆与检索.md">中文</a>
-</div>
-
 # Chapter 8 Memory and Retrieval
 
 In previous chapters, we built the basic architecture of the HelloAgents framework, implementing various agent paradigms and tool systems. However, our framework still lacks a critical capability: **memory**. If an agent cannot remember previous interactions or learn from historical experiences, its performance will be greatly limited in continuous conversations or complex tasks.

+ 0 - 4
docs/chapter8/第八章 记忆与检索.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter8-Memory-and-Retrieval.md">English</a> | 中文
-</div>
-
 # 第八章 记忆与检索
 
 在前面的章节中,我们构建了HelloAgents框架的基础架构,实现了多种智能体范式和工具系统。不过,我们的框架还缺少一个关键能力:<strong>记忆</strong>。如果智能体无法记住之前的交互内容,也无法从历史经验中学习,那么在连续对话或复杂任务中,其表现将受到极大限制。

+ 0 - 4
docs/chapter9/Chapter9-Context-Engineering.md

@@ -1,7 +1,3 @@
-<div align="right">
-  English | <a href="./第九章%20上下文工程.md">中文</a>
-</div>
-
 # Chapter 9 Context Engineering
 
 In previous chapters, we have introduced memory systems and RAG for agents. However, to enable agents to stably "think" and "act" in real complex scenarios, memory and retrieval alone are not enough—we need an engineering methodology to continuously and systematically construct appropriate "context" for the model. This is the theme of this chapter: Context Engineering. It focuses on "how to assemble and optimize input context in a reusable, measurable, and evolvable way before each model call", thereby improving correctness, robustness, and efficiency<sup>[1][2]</sup>.

+ 0 - 4
docs/chapter9/第九章 上下文工程.md

@@ -1,7 +1,3 @@
-<div align="right">
-  <a href="./Chapter9-Context-Engineering.md">English</a> | 中文
-</div>
-
 # 第九章 上下文工程
 
 在前面的章节中,我们已经为智能体引入了记忆系统与RAG。然而,要让智能体在真实复杂场景中稳定地“思考”与“行动”,仅有记忆与检索还不够——我们需要一套工程化方法,持续、系统地为模型构造恰当的“上下文”。这就是本章的主题:上下文工程(Context Engineering)。它关注的是“在每一次模型调用前,如何以可复用、可度量、可演进的方式,拼装并优化输入上下文”,从而提升正确性、鲁棒性与效率<sup>[1][2]</sup>。

+ 76 - 26
docs/index.html

@@ -94,49 +94,99 @@
 
     <!-- 语言切换脚本 -->
     <script>
+        // 章节文件名映射
+        const chapterMapping = {
+            // 中文 -> 英文
+            'zh2en': {
+                'README.md': 'README_EN.md',
+                '前言.md': 'Preface.md',
+                '第一章 初识智能体.md': 'Chapter1-Introduction-to-Agents.md',
+                '第二章 智能体发展史.md': 'Chapter2-History-of-Agents.md',
+                '第三章 大语言模型基础.md': 'Chapter3-Fundamentals-of-Large-Language-Models.md',
+                '第四章 智能体经典范式构建.md': 'Chapter4-Building-Classic-Agent-Paradigms.md',
+                '第五章 基于低代码平台的智能体搭建.md': 'Chapter5-Building-Agents-with-Low-Code-Platforms.md',
+                '第六章 框架开发实践.md': 'Chapter6-Framework-Development-Practice.md',
+                '第七章 构建你的Agent框架.md': 'Chapter7-Building-Your-Agent-Framework.md',
+                '第八章 记忆与检索.md': 'Chapter8-Memory-and-Retrieval.md',
+                '第九章 上下文工程.md': 'Chapter9-Context-Engineering.md',
+                '第十章 智能体通信协议.md': 'Chapter10-Agent-Communication-Protocols.md',
+                '第十一章 Agentic-RL.md': 'Chapter11-Agentic-RL.md',
+                '第十二章 智能体性能评估.md': 'Chapter12-Agent-Performance-Evaluation.md',
+                '第十三章 智能旅行助手.md': 'Chapter13-Intelligent-Travel-Assistant.md',
+                '第十四章 自动化深度研究智能体.md': 'Chapter14-Automated-Deep-Research-Agent.md',
+                '第十五章 构建赛博小镇.md': 'Chapter15-Building-Cyber-Town.md',
+                '第十六章 毕业设计.md': 'Chapter16-Graduation-Project.md'
+            },
+            // 英文 -> 中文
+            'en2zh': {
+                'README_EN.md': 'README.md',
+                'Preface.md': '前言.md',
+                'Chapter1-Introduction-to-Agents.md': '第一章 初识智能体.md',
+                'Chapter2-History-of-Agents.md': '第二章 智能体发展史.md',
+                'Chapter3-Fundamentals-of-Large-Language-Models.md': '第三章 大语言模型基础.md',
+                'Chapter4-Building-Classic-Agent-Paradigms.md': '第四章 智能体经典范式构建.md',
+                'Chapter5-Building-Agents-with-Low-Code-Platforms.md': '第五章 基于低代码平台的智能体搭建.md',
+                'Chapter6-Framework-Development-Practice.md': '第六章 框架开发实践.md',
+                'Chapter7-Building-Your-Agent-Framework.md': '第七章 构建你的Agent框架.md',
+                'Chapter8-Memory-and-Retrieval.md': '第八章 记忆与检索.md',
+                'Chapter9-Context-Engineering.md': '第九章 上下文工程.md',
+                'Chapter10-Agent-Communication-Protocols.md': '第十章 智能体通信协议.md',
+                'Chapter11-Agentic-RL.md': '第十一章 Agentic-RL.md',
+                'Chapter12-Agent-Performance-Evaluation.md': '第十二章 智能体性能评估.md',
+                'Chapter13-Intelligent-Travel-Assistant.md': '第十三章 智能旅行助手.md',
+                'Chapter14-Automated-Deep-Research-Agent.md': '第十四章 自动化深度研究智能体.md',
+                'Chapter15-Building-Cyber-Town.md': '第十五章 构建赛博小镇.md',
+                'Chapter16-Graduation-Project.md': '第十六章 毕业设计.md'
+            }
+        };
+
         function switchLanguage() {
             const currentHash = window.location.hash;
             const langBtn = document.getElementById('langBtn');
 
             // 检测当前语言
             if (currentHash.includes('/en/')) {
-                // 从英文切换到中文 (移除 /en/ 前缀)
-                let newHash = currentHash.replace('/en/', '/');
-                // 将英文文件名转换为中文文件名
-                newHash = newHash.replace('/README_EN.md', '/README.md');
-                newHash = newHash.replace('/Preface.md', '/前言.md');
-                // 将 Chapter*.md 转换为 第*章 *.md (需要根据实际文件名映射)
-                // 这里简化处理,直接跳转到首页
-                if (newHash.includes('Chapter')) {
+                // 从英文切换到中文
+                let newHash = currentHash.replace('#/', '').replace('en/', '');
+
+                // 提取文件名
+                const parts = newHash.split('/');
+                const filename = parts[parts.length - 1];
+
+                // 查找对应的中文文件名
+                if (chapterMapping.en2zh[filename]) {
+                    parts[parts.length - 1] = chapterMapping.en2zh[filename];
+                    newHash = '#/' + parts.join('/');
+                } else {
                     newHash = '#/';
                 }
-                window.location.hash = newHash || '#/';
+
+                window.location.hash = newHash;
                 langBtn.textContent = 'English';
-                // 更新分页按钮文本
                 window.$docsify.pagination.previousText = '上一章节';
                 window.$docsify.pagination.nextText = '下一章节';
             } else {
-                // 从中文切换到英文 (添加 /en/ 前缀)
-                let newHash;
-                if (currentHash === '' || currentHash === '#/' || currentHash === '#') {
+                // 从中文切换到英文
+                let path = currentHash.replace('#/', '');
+
+                if (path === '' || path === '/') {
                     // 首页
-                    newHash = '#/en/README.md';
+                    window.location.hash = '#/en/README_EN.md';
                 } else {
-                    // 其他页面,添加 /en/ 前缀
-                    const path = currentHash.replace('#/', '');
-                    // 将中文文件名转换为英文文件名
-                    let enPath = path.replace('README.md', 'README_EN.md');
-                    enPath = enPath.replace('前言.md', 'Preface.md');
-                    // 将 第*章 *.md 转换为 Chapter*.md (需要根据实际文件名映射)
-                    // 这里简化处理,直接跳转到英文首页
-                    if (enPath.includes('第') && enPath.includes('章')) {
-                        enPath = 'README_EN.md';
+                    // 提取文件名
+                    const parts = path.split('/');
+                    const filename = parts[parts.length - 1];
+
+                    // 查找对应的英文文件名
+                    if (chapterMapping.zh2en[filename]) {
+                        parts[parts.length - 1] = chapterMapping.zh2en[filename];
+                        window.location.hash = '#/en/' + parts.join('/');
+                    } else {
+                        window.location.hash = '#/en/README_EN.md';
                     }
-                    newHash = '#/en/' + enPath;
                 }
-                window.location.hash = newHash;
+
                 langBtn.textContent = '中文';
-                // 更新分页按钮文本
                 window.$docsify.pagination.previousText = 'Previous';
                 window.$docsify.pagination.nextText = 'Next';
             }