Update main.ts

This commit is contained in:
Vishwanath Kulkarni 2024-09-30 21:10:17 -07:00 committed by GitHub
parent b880c37060
commit 0e3773963a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -127,7 +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" ...(OPENAI_API_MODEL === "gpt-3.5-turbo-16k"
? { response_format: { type: "json_object" } } ? { response_format: { type: "json_object" } }
: {}), : {}),
messages: [ messages: [