// Environment variable names for API key export const API_KEY_ENV_VARS = ['AIML_API_KEY']; export const BASE_URL_ENV_VARS = ['AIML_API_BASE']; // SDK identification headers export const AIMLAPI_HEADERS = { 'HTTP-Referer': 'github.com/aimlapi/aimlapi-sdk-node', 'X-Title': 'AI/ML API Node SDK (OpenAI)', } as const; /** * Get the first non-empty value from environment variables */ export function getEnv(...names: string[]): string | undefined { for (const name of names) { const value = process.env[name]; if (value && value !== '') { return value; } } return undefined; } /** * Check if a value is a valid Uploadable type */ export function isUploadable(value: unknown): boolean { if (value instanceof Uint8Array || value instanceof ArrayBuffer) { return true; } if (typeof value === 'string') { return true; } if ( value !== null && typeof value === 'object' && 'stream' in value && typeof (value as { stream: unknown }).stream === 'object' ) { return true; } return false; }