Change name of open AI setup function

This commit is contained in:
Filip Sodić 2025-04-28 22:45:27 +02:00
parent e3588fae5e
commit 5c39bcd874

View File

@ -14,8 +14,8 @@ import OpenAI from 'openai';
import { SubscriptionStatus } from '../payment/plans';
import { ensureArgsSchemaOrThrowHttpError } from '../server/validation';
const openAi = getOpenAi();
function getOpenAi(): OpenAI {
const openAi = setUpOpenAi();
function setUpOpenAi(): OpenAI {
if (process.env.OPENAI_API_KEY) {
return new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
} else {