mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
chore: cleanup
This commit is contained in:
parent
0275ef5ec1
commit
5dc7f92c9e
1 changed files with 5 additions and 6 deletions
|
|
@ -125,15 +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() {
|
str?;
|
||||||
return None;
|
str.unwrap()
|
||||||
}
|
.trim_start_matches("```")
|
||||||
str.unwrap().trim_start_matches("```").trim_end_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() {
|
||||||
return None;
|
return None;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue