use serde::de::DeserializeOwned; use crate::error::PlatformAgentError; pub fn parse_json_output(raw_text: &str) -> Result where T: DeserializeOwned, { serde_json::from_str(raw_text).map_err(|error| { PlatformAgentError::OutputParse(format!("解析 Agent JSON 输出失败:{error}")) }) }