fix: chatGPT support

This commit is contained in:
iff 2024-11-20 10:01:37 +01:00
parent 7582449616
commit 999a8f1c1e

View file

@ -125,13 +125,14 @@ You run the command `{last_command}` and get the following error message: `{erro
let content = &json["choices"][0]["message"]["content"];
let suggestion: AISuggest = {
let str = {
let str = content.as_str();
if str.is_none() {
return None;
}
str.unwrap()
str.unwrap().trim_start_matches("```").trim_end_matches("```")
} ;
let json = serde_json::from_str(str);
if json.is_err() {