@twilio-alpha/assistants-eval
Version:
promptfoo extension for writing AI evaluations for Twilio AI Assistants
23 lines • 537 B
JavaScript
/**
* Fetches the process.env parameter key otherwise throws an error
* @param key
*/
export const getRequiredEnv = (key) => {
const value = process.env[key];
if (!value) {
throw new Error(`Required environment variable ${key} was not found`);
}
return value;
};
/**
* Fetches the process.env parameter key if found
* @param key
*/
export const getOptionalEnv = (key) => {
const value = process.env[key];
if (!value) {
return null;
}
return value;
};
//# sourceMappingURL=envs.js.map