From 84b3fd064c646ca1cac4707af765823567754519 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Wed, 13 May 2026 10:39:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=20JSON=20=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E5=AD=97=E7=AC=A6=E4=B8=B2=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E6=9C=89=E6=95=88=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/providers/openai.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/openai.rs b/src/providers/openai.rs index 6a6d99a..5f256bb 100644 --- a/src/providers/openai.rs +++ b/src/providers/openai.rs @@ -137,11 +137,11 @@ impl OpenAIProvider { Value::String(raw) => { // If the string is already valid JSON, keep it as-is // Otherwise, ensure it's a proper JSON string - if serde_json::from_str::(raw).is_ok() { + if serde_json::from_str::(&raw).is_ok() { Value::String(raw) } else { // Invalid JSON string - wrap it as a proper JSON string - serde_json::to_string(&raw).unwrap_or_else(|_| "null".to_string()) + Value::String(serde_json::to_string(&raw).unwrap_or_else(|_| "null".to_string())) } } value => Value::String(