This commit is contained in:
2026-05-08 11:44:42 +08:00
parent b08127031c
commit abf1f1ebea
249 changed files with 39411 additions and 887 deletions

View File

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