fix clean json response
This commit is contained in:
+6
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user