feat(MED-97): fix new OpenAI() throws error when key is missing in env

This commit is contained in:
2025-09-26 17:01:56 +03:00
parent 6bdf5fbf12
commit f794a66147

View File

@@ -1,9 +1,8 @@
import OpenAI from 'openai'; import OpenAI from 'openai';
export const isValidOpenAiEnv = async () => { export const isValidOpenAiEnv = async () => {
const client = new OpenAI();
try { try {
const client = new OpenAI();
await client.models.list(); await client.models.list();
return true; return true;
} catch (e) { } catch (e) {