refactor: query_weather bash→Rust builtin, 删除旧 skill
QWeather 天气查询从外部 bash 脚本重构为 Rust 原生 builtin 工具: - ed25519-dalek 替代 openssl JWT 签名 - reqwest + tokio::join! 并发查询替代串行 curl - serde_json 直接解析替代 python3 子进程 - city_id 内存缓存 (HashMap, 1h TTL) - 支持 3/7/10/15/30d 逐日 + 24/72/168h 逐时预报 - 删除 resources/skills/query_weather/ (builtin 优先级更高)
This commit is contained in:
@@ -9,6 +9,11 @@ impl BuiltinRegistry {
|
||||
match name {
|
||||
"get_current_datetime" => Some(execute_datetime()),
|
||||
"manage_memos" => Some(handle_memos(args_json).await),
|
||||
"query_weather" => {
|
||||
let params: serde_json::Value =
|
||||
serde_json::from_str(args_json).unwrap_or_default();
|
||||
Some(super::weather::execute(params).await)
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -30,6 +35,7 @@ impl BuiltinRegistry {
|
||||
parameters: serde_json::json!({"type":"object","properties":{"action":{"type":"string","enum":["add","list","delete"]},"content":{"type":"string"},"id":{"type":"integer"}}}),
|
||||
timeout_secs: 10,
|
||||
},
|
||||
super::weather::spec(),
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user