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(