chore: fix formatting issues in main.ts file

This commit is contained in:
Will Hohyon Ryu 2024-03-07 19:06:50 -08:00
parent 271056abf4
commit 977935fd5e

View file

@ -128,8 +128,9 @@ async function getAIResponse(prompt: string): Promise<Array<{
presence_penalty: 0,
};
try {
const response = await openai.chat.completions.create({
const response =
await openai.chat.completions.create(
{
...queryConfig,
// return JSON if the model supports it:
...(OPENAI_API_MODEL === "gpt-4-1106-preview"
@ -144,11 +145,9 @@ async function getAIResponse(prompt: string): Promise<Array<{
});
const res = response.choices[0].message?.content?.trim() || "{}";
console.log("GPT response:")
console.log(res);
return parseJsonForChatGPTResponse(res).reviews;
} catch (error) {
console.error("Error:", error);
return null;
}
}
function createComment(