mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-20 09:36:47 +00:00
Update main.ts
Always enforce json mode
This commit is contained in:
parent
a9a064dfa1
commit
8dcc039385
1 changed files with 1 additions and 3 deletions
|
@ -127,9 +127,7 @@ async function getAIResponse(prompt: string): Promise<Array<{
|
||||||
const response = await openai.chat.completions.create({
|
const response = await openai.chat.completions.create({
|
||||||
...queryConfig,
|
...queryConfig,
|
||||||
// return JSON if the model supports it:
|
// return JSON if the model supports it:
|
||||||
...(OPENAI_API_MODEL === "gpt-4-1106-preview"
|
response_format: { type: "json_object" },
|
||||||
? { response_format: { type: "json_object" } }
|
|
||||||
: {}),
|
|
||||||
messages: [
|
messages: [
|
||||||
{
|
{
|
||||||
role: "system",
|
role: "system",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue