UNPKG

magnitude-core

Version:
38 lines (34 loc) 1.88 kB
/************************************************************************************************* Welcome to Baml! To use this generated code, please run one of the following: $ npm install @boundaryml/baml $ yarn add @boundaryml/baml $ pnpm add @boundaryml/baml *************************************************************************************************/ // This file was generated by BAML: please do not edit it. Instead, edit the // BAML files and re-generate this code using: baml-cli generate // You can install baml-cli with: // $ npm install @boundaryml/baml // /* eslint-disable */ // tslint:disable // @ts-nocheck // biome-ignore format: autogenerated code import { BamlRuntime, BamlCtxManager } from '@boundaryml/baml'; import { getBamlFiles } from './inlinedbaml'; // Create a copy of process.env to avoid mutations const env = { ...process.env }; export const DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME = BamlRuntime.fromFiles('baml_src', getBamlFiles(), env); export const DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX = new BamlCtxManager(DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME); /** * @deprecated resetBamlEnvVars is deprecated and is safe to remove, since environment variables are now lazily loaded on each function call */ export function resetBamlEnvVars(envVars) { if (DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX.allowResets()) { const envVarsToReset = Object.fromEntries(Object.entries(envVars).filter((kv) => kv[1] !== undefined)); DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_RUNTIME.reset('baml_src', getBamlFiles(), envVarsToReset); DO_NOT_USE_DIRECTLY_UNLESS_YOU_KNOW_WHAT_YOURE_DOING_CTX.reset(); } else { throw new Error('BamlError: Cannot reset BAML environment variables while there are active BAML contexts.'); } }