fix clean json response

This commit is contained in:
2026-07-03 12:24:40 +07:00
parent 8a4e882dc1
commit 08f19f17a2
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -545,10 +545,12 @@ julia> clean_json_response(text)
```
"""
function clean_json_response(text::String)
text = replace(text, '{' => "")
text = replace(text, '}' => "")
text = replace(text, "```" => "")
text = replace(text, "json" => "")
removelist = ["{", "}", "```", "json"]
for i in removelist
while occursin(i, text)
text = replace(text, i => "")
end
end
text = '{' * text * '}'
return text
end