UNPKG

@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

54 lines (53 loc) • 4.21 kB
import { SpanStatus } from "../types/index.js"; /** @description Langfuse OTLP ingestion endpoint path. */ export declare const TRACES_PATH = "/api/public/otel/v1/traces"; /** @description Langfuse health endpoint path. */ export declare const HEALTH_PATH = "/api/public/health"; /** @description Langfuse Cloud base URL used when none is configured. */ export declare const DEFAULT_BASE_URL = "https://cloud.langfuse.com"; /** @description Milliseconds a fetched Langfuse prompt is served from the cache before it is refreshed in the background. */ export declare const DEFAULT_PROMPT_CACHE_TTL_MS = 60000; /** @description Milliseconds a Langfuse prompt fetch waits before the fallback is used. */ export declare const DEFAULT_PROMPT_TIMEOUT_MS = 2000; /** @description Prompt cache entries kept per process; the least recently fetched is evicted beyond it. */ export declare const MAX_CACHED_PROMPTS = 500; /** @description Trace metadata keys `setLangfuseContext` writes for a prompt; an inner prompt drops the inherited ones. */ export declare const PROMPT_METADATA_KEYS: Set<string>; /** @description Spans buffered before an automatic flush. */ export declare const DEFAULT_FLUSH_AT = 15; /** @description Milliseconds between scheduled flushes. */ export declare const DEFAULT_FLUSH_INTERVAL_MS = 5000; /** @description Milliseconds before an export request is aborted. */ export declare const DEFAULT_TIMEOUT_MS = 30000; /** @description Milliseconds a flush or shutdown waits for delivery before it abandons what is still in flight. */ export declare const DEFAULT_FLUSH_BUDGET_MS = 3000; /** @description Maximum spans sent in one export request. */ export declare const MAX_SPANS_PER_REQUEST = 500; /** @description Export requests to Langfuse in flight at once. Spans that end while every one is busy wait in the buffer. */ export declare const MAX_CONCURRENT_DELIVERIES = 4; /** @description Spans that may wait for a delivery slot. Beyond it the oldest waiting spans are dropped and counted, so a Langfuse that stops answering cannot hold an unbounded backlog in memory. */ export declare const MAX_QUEUED_SPANS = 10000; /** @description Milliseconds between warn-level logs about waiting spans dropped for lack of a delivery slot. */ export declare const QUEUE_DROP_WARN_INTERVAL_MS = 60000; /** @description Milliseconds between error-level logs about spans dropped because Langfuse rejected the credentials. */ export declare const CREDENTIALS_WARN_INTERVAL_MS = 60000; /** @description Longest `Retry-After` a 429 or 503 from Langfuse is waited out before the retry. */ export declare const MAX_EXPORT_RETRY_AFTER_MS = 60000; /** @description Maximum serialized bytes sent in one export request. */ export declare const MAX_BYTES_PER_REQUEST = 3500000; /** @description Placeholder that replaces a value fully removed by the user's mask. */ export declare const FULLY_MASKED = "<fully masked>"; /** @description Span attributes holding trace and observation input or output, which the Langfuse exporter's mask and `redactIO` apply to. */ export declare const CONTENT_KEYS: Set<string>; /** @description Span attribute marking a span started inside a `setLangfuseContext({ redactIO: true })` scope; the Langfuse exporter leaves its input and output out and does not send the marker. */ export declare const REDACT_IO_ATTRIBUTE = "neurolink.langfuse.redact_io"; /** @description Attribute prefixes whose values are metadata entries. */ export declare const METADATA_PREFIXES: string[]; /** @description Observation types that hold no model, usage or cost in Langfuse. GenAI model and usage keys on them are left out of the Langfuse export, so a request's generation stays its only priced record. */ export declare const UNPRICED_OBSERVATION_TYPES: ReadonlySet<string>; /** @description GenAI attributes Langfuse reads a model name from. */ export declare const MODEL_ATTRIBUTE_KEYS: ReadonlySet<string>; /** @description Prefix of the GenAI attributes Langfuse reads usage and cost from. */ export declare const USAGE_ATTRIBUTE_PREFIX = "gen_ai.usage."; /** @description OTLP numeric status code for each span status. */ export declare const OTLP_STATUS_CODES: Record<SpanStatus, number>;