@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
9 lines (8 loc) • 1 kB
TypeScript
import type { LangfuseAttributePolicy, SpanAttributes } from "../types/index.js";
/**
* @description Applies the Langfuse exporter's policy to a span's attributes as they are sent to Langfuse: fills environment and release when the span has none, removes input and output when `redactIO` is set or the span was started in a `setLangfuseContext({ redactIO: true })` scope, masks input, output and metadata when a mask is configured, and drops the `neurolink.langfuse.redact_io` marker. Nothing else is touched: other attributes, events and the status message go to Langfuse as they are, and no other exporter sees the policy.
* @param attributes {SpanAttributes} - Attributes of the span being exported.
* @param policy {LangfuseAttributePolicy} - Environment, release, redaction and mask settings.
* @returns {SpanAttributes} A new attribute record; the input is not modified.
*/
export declare function protectAttributes(attributes: SpanAttributes, policy: LangfuseAttributePolicy): SpanAttributes;