@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
33 lines (32 loc) • 2.97 kB
TypeScript
import { LangfuseExporter } from "../../../../observability/exporters/langfuseExporter.js";
import type { ObservabilityConfig } from "../../../../types/index.js";
/**
* @description Tells whether a setting says "off": `false`, or the text `false`, `0`, `off` or `no` in any case.
* @param value {unknown} - A config value or an environment variable.
* @returns {boolean} `true` for an explicit off setting; `false` for anything else, an unset value included.
*/
export declare function isOff(value: unknown): boolean;
/**
* @description Resolves the environment name the OTLP resource reports as `deployment.environment`: the config value, then `LANGFUSE_TRACING_ENVIRONMENT`, `LANGFUSE_ENVIRONMENT` and `PUBLIC_APP_ENVIRONMENT`. Langfuse traces are labelled from the config value and `LANGFUSE_TRACING_ENVIRONMENT` alone, as before.
* @param config {ObservabilityConfig | undefined} - Observability options.
* @returns {string | undefined} The environment name, or `undefined` when none is set.
*/
export declare function resolveEnvironment(config?: ObservabilityConfig): string | undefined;
/**
* @description Resolves the release the OTLP resource reports as `service.version`: the config value, then `LANGFUSE_RELEASE` and `PUBLIC_APP_VERSION`. Langfuse traces are labelled from the config value and `LANGFUSE_RELEASE` alone, as before.
* @param config {ObservabilityConfig | undefined} - Observability options.
* @returns {string | undefined} The release identifier, or `undefined` when none is set.
*/
export declare function resolveRelease(config?: ObservabilityConfig): string | undefined;
/**
* @description Decides whether Langfuse export is on. Off when `config.langfuse` is `false` or an options object with `enabled: false`. On for `true` and for an options object with `enabled: true` or with both keys. Any other options object, and no options at all with both keys in the environment, is on unless `LANGFUSE_ENABLED` is `false`, `0`, `off` or `no`: the switch governs the keys wherever they come from the environment, so an options object that leaves them there (only a mask or an environment name) obeys it too, while keys or `enabled: true` given in code are an explicit choice and win over it.
* @param config {ObservabilityConfig | undefined} - Observability options.
* @returns {boolean} `true` when a Langfuse exporter should be created.
*/
export declare function isLangfuseEnabled(config?: ObservabilityConfig): boolean;
/**
* @description Builds and starts a Langfuse exporter from config, falling back to the `LANGFUSE_*` environment variables.
* @param config {ObservabilityConfig | undefined} - Observability options; `langfuse` may carry keys, base URL, environment, release, mask and batching.
* @returns {LangfuseExporter | null} The exporter, or `null` (after a warning) when the public or secret key is missing.
*/
export declare function createLangfuseExporter(config?: ObservabilityConfig): LangfuseExporter | null;