Initial commit: PodcastYes — AI podcast platform
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import OpenAI from "openai";
|
||||
|
||||
let client: OpenAI | null = null;
|
||||
|
||||
/** Lazily-constructed OpenAI client (used for GPT-4 scripts and DALL·E art). */
|
||||
export function openai(): OpenAI {
|
||||
if (!client) {
|
||||
const apiKey = process.env.OPENAI_API_KEY;
|
||||
if (!apiKey) throw new Error("OPENAI_API_KEY is not set");
|
||||
client = new OpenAI({ apiKey });
|
||||
}
|
||||
return client;
|
||||
}
|
||||
|
||||
export const SCRIPT_MODEL = process.env.OPENAI_SCRIPT_MODEL ?? "gpt-4o";
|
||||
export const ART_MODEL = process.env.OPENAI_ART_MODEL ?? "dall-e-3";
|
||||
Reference in New Issue
Block a user