From cb5eeb40fd7a2601f3dd5d4e07f3379d95ccd8e3 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 21 Jun 2024 11:42:27 +0200 Subject: [PATCH] feat: update openai --- lib/openai.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/openai.ts b/lib/openai.ts index bdede9b..fe174bc 100644 --- a/lib/openai.ts +++ b/lib/openai.ts @@ -85,7 +85,7 @@ export async function createGenres( title = "unknown", ) { if (!openAI) return; - const chatCompletion = await openAI.createChatCompletion({ + const chatCompletion = await openAI.chat.completions.create({ model: "gpt-3.5-turbo", messages: [ { @@ -114,7 +114,7 @@ export async function createKeywords( title = "unknown", ) { if (!openAI) return; - const chatCompletion = await openAI.createChatCompletion({ + const chatCompletion = await openAI.chat.completions.create({ model: "gpt-3.5-turbo", messages: [ { @@ -142,7 +142,7 @@ export const getMovieRecommendations = (keywords: string, exclude: string[]) => cacheFunction({ fn: async () => { if (!openAI) return; - const chatCompletion = await openAI.createChatCompletion({ + const chatCompletion = await openAI.chat.completions.create({ model: "gpt-3.5-turbo", messages: [ { @@ -186,7 +186,7 @@ respond with a plain unordered list each item starting with the year the movie w export async function createTags(content: string) { if (!openAI) return; - const chatCompletion = await openAI.createChatCompletion({ + const chatCompletion = await openAI.chat.completions.create({ model: "gpt-3.5-turbo", messages: [ {