重构内容: - agent.py 替代 agent_v3.py,所有配置从 config.yaml 加载 - tools/ 目录自动扫描,丢.py文件即注册新工具 - skills/ 目录自动扫描,丢.yaml文件即注册新技能 - config.yaml 统一管理模型参数、MCP服务器、路由关键词 - MCP支持多服务器配置 + 确定性路由关键词 - 删除旧版 step1_basic_fc.py 和 agent_v3.py
19 lines
525 B
Python
19 lines
525 B
Python
"""天气查询工具"""
|
||
from langchain_core.tools import tool
|
||
|
||
|
||
@tool
|
||
def get_weather(city: str) -> str:
|
||
"""查询指定城市的天气信息"""
|
||
weather_data = {
|
||
"北京": "晴天,气温22°C,北风3级",
|
||
"上海": "多云,气温25°C,东风2级",
|
||
"深圳": "阵雨,气温28°C,南风4级",
|
||
"黄庄": "晴转多云,气温23°C,微风",
|
||
}
|
||
return weather_data.get(city, f"暂无{city}的天气数据")
|
||
|
||
|
||
# 暴露工具列表供自动扫描
|
||
TOOLS = [get_weather]
|