refactor(ch11): align filenames and update corresponding README sections
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
---
|
||||
|
||||
### 1. `agent_stream.py` (通用流式输出组件)
|
||||
### 1. `s01_agent_stream.py` (通用流式输出组件)
|
||||
|
||||
实现通用的LangGraph事件流监听和可视化输出功能,提供友好的用户交互体验。
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
---
|
||||
|
||||
### 2. `final_mcp_main.py` (官方库实现示例)
|
||||
### 2. `s02_final_mcp_main.py` (官方库实现示例)
|
||||
|
||||
使用官方`langchain_mcp_adapters`库实现的完整MCP应用示例,展示了如何快速集成MCP服务。
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
### 🔔 全局注意事项
|
||||
|
||||
- **学习路径建议**:
|
||||
1. 先学习独立组件:`agent_stream.py` → `final_mcp_main.py`
|
||||
1. 先学习独立组件:`s01_agent_stream.py` → `s02_final_mcp_main.py`
|
||||
2. 再学习组件系统:`transports/base.py` → `transports/http.py` → `transports/stdio.py` → `mcp_client.py` → `mcp_bridge.py` → `mcp_main.py`
|
||||
|
||||
- **环境准备**:
|
||||
@@ -219,7 +219,7 @@
|
||||
- 高德地图MCP服务需要 `AMAP_MAPS_API_KEY` 环境变量配置
|
||||
|
||||
- **运行说明**:
|
||||
- 独立组件可以直接运行:`python final_mcp_main.py`
|
||||
- 独立组件可以直接运行:`python s02_final_mcp_main.py`
|
||||
- 组件系统示例:`python mcp_main.py`
|
||||
- 本地MCP服务需要先启动:`python -m m10_mcp_basics.streamable_http_server`
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from langgraph.graph import StateGraph,MessagesState,START,END
|
||||
from langgraph.prebuilt import ToolNode
|
||||
|
||||
from config import OPENAI_API_KEY,AMAP_MAPS_API_KEY
|
||||
from m11_mcp_advanced.agent_stream import run_agent_with_streaming
|
||||
from m11_mcp_advanced.s01_agent_stream import run_agent_with_streaming
|
||||
from m11_mcp_advanced.mcp_bridge import LangChainMCPAdapter
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from langgraph.graph import StateGraph, MessagesState, START, END
|
||||
from langgraph.prebuilt import ToolNode
|
||||
|
||||
# 复用你的流式输出模块和配置
|
||||
from m11_mcp_advanced.agent_stream import run_agent_with_streaming
|
||||
from m11_mcp_advanced.s01_agent_stream import run_agent_with_streaming
|
||||
from config import OPENAI_API_KEY, AMAP_MAPS_API_KEY
|
||||
|
||||
# === 配置 MCP 服务器 ===
|
||||
Reference in New Issue
Block a user