feat: update openai

This commit is contained in:
max_richter 2024-06-21 11:42:27 +02:00
parent 13d23d4f80
commit cb5eeb40fd

View File

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