mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 10:06:47 +00:00
To use GPT-3.5-Turbo
This commit is contained in:
parent
a9a064dfa1
commit
93ba79b682
3 changed files with 1304 additions and 1305 deletions
|
@ -126,10 +126,6 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
|||
try {
|
||||
const response = await openai.chat.completions.create({
|
||||
...queryConfig,
|
||||
// return JSON if the model supports it:
|
||||
...(OPENAI_API_MODEL === "gpt-4-1106-preview"
|
||||
? { response_format: { type: "json_object" } }
|
||||
: {}),
|
||||
messages: [
|
||||
{
|
||||
role: "system",
|
||||
|
@ -138,6 +134,9 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
|||
],
|
||||
});
|
||||
|
||||
// Log the raw response for debugging
|
||||
console.log('Raw response:', response);
|
||||
|
||||
const res = response.choices[0].message?.content?.trim() || "{}";
|
||||
return JSON.parse(res).reviews;
|
||||
} catch (error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue