mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
fix: chatGPT support
This commit is contained in:
parent
7582449616
commit
999a8f1c1e
1 changed files with 2 additions and 1 deletions
|
|
@ -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 content = &json["choices"][0]["message"]["content"];
|
||||||
|
|
||||||
|
|
||||||
let suggestion: AISuggest = {
|
let suggestion: AISuggest = {
|
||||||
let str = {
|
let str = {
|
||||||
let str = content.as_str();
|
let str = content.as_str();
|
||||||
if str.is_none() {
|
if str.is_none() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
str.unwrap()
|
str.unwrap().trim_start_matches("```").trim_end_matches("```")
|
||||||
} ;
|
} ;
|
||||||
let json = serde_json::from_str(str);
|
let json = serde_json::from_str(str);
|
||||||
if json.is_err() {
|
if json.is_err() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue