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: [ {