mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-29 04:24:13 +00:00
fix: use JSON.parse instead of jsonic to parse response in main.ts
This commit fixes an issue where the jsonic library was being used to parse a response in the main.ts file. The jsonic library has been replaced with JSON.parse for more reliable JSON parsing.
This commit is contained in:
parent
b0ef6c864e
commit
1cc4cd48bc
1 changed files with 1 additions and 2 deletions
|
@ -4,7 +4,6 @@ import OpenAI from "openai";
|
|||
import {Octokit} from "@octokit/rest";
|
||||
import parseDiff, {Chunk, File} from "parse-diff";
|
||||
import minimatch from "minimatch";
|
||||
import jsonic from "jsonic";
|
||||
|
||||
const GITHUB_TOKEN: string = core.getInput("GITHUB_TOKEN");
|
||||
const OPENAI_API_KEY: string = core.getInput("OPENAI_API_KEY");
|
||||
|
@ -152,7 +151,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
|||
.replace(/```json/g, "")
|
||||
.replace(/```/g, "");
|
||||
|
||||
return jsonic(cleanupResponse).reviews;
|
||||
return JSON.parse(cleanupResponse).reviews;
|
||||
}
|
||||
|
||||
function createComment(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue