mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-20 09:36:47 +00:00
Revert "To use GPT-3.5-Turbo"
This commit is contained in:
parent
51778299b4
commit
6c1d717d9f
3 changed files with 1305 additions and 1304 deletions
2600
dist/index.js
vendored
2600
dist/index.js
vendored
File diff suppressed because it is too large
Load diff
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -126,6 +126,10 @@ 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",
|
||||
|
@ -134,9 +138,6 @@ 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