Skip to content

Commit

Permalink
fix: remove ``` from chatGPT response
Browse files Browse the repository at this point in the history
  • Loading branch information
OnFireByte committed Aug 17, 2023
1 parent 7c15aa3 commit e7e57ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/chatgpt/chatgpt.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export class ChatgptService {
},
);

let content = resp.data.choices[0].message.content;
content = content.replace('```json', '').replace('```', '');

const res: ChatGPTData = JSON.parse(resp.data.choices[0].message.content);

return res;
Expand Down

0 comments on commit e7e57ae

Please sign in to comment.