We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62fdb56 commit f238c27Copy full SHA for f238c27
src/main.ts
@@ -156,7 +156,11 @@ async function getAIResponse(prompt: string): Promise<Array<{
156
}
157
158
const res = response.choices[0].message?.content?.trim() || "{}";
159
- return JSON.parse(res).reviews;
+ if (res.startsWith("```json")) {
160
+ return JSON.parse(res.slice(7, -3)).reviews
161
+ } else {
162
+ return JSON.parse(res).reviews;
163
+ }
164
} catch (error) {
165
console.error("Error:", error, response?.choices[0].message?.content);
166
return null;
0 commit comments