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

28 lines (27 loc) • 1.51 kB
import type { ExporterHealthStatus, ExportResult, LangfuseExporterConfig, SpanData } from "../../types/index.js"; import { BaseExporter } from "./baseExporter.js"; /** * @description Exporter that delivers observation spans to Langfuse's OTLP/HTTP JSON endpoint (`POST /api/public/otel/v1/traces`), which keeps native observation types and identity on every observation. Spans are queued without blocking and sent in batches; failed requests are retried with backoff when the failure is transient (429, 5xx, network). */ export declare class LangfuseExporter extends BaseExporter { private readonly langfuse; private readonly authorization; private readonly baseUrl; private readonly policy; private readonly inflight; /** * @description Creates an exporter for one Langfuse project. * @param config {LangfuseExporterConfig} - Credentials, endpoint, environment, release, masking and batching options. `environment` and `release` fall back to `LANGFUSE_TRACING_ENVIRONMENT` and `LANGFUSE_RELEASE`, and only fill spans that do not carry them already. */ constructor(langfuse: LangfuseExporterConfig); initialize(): Promise<void>; exportSpan(span: SpanData): Promise<ExportResult>; exportBatch(spans: SpanData[]): Promise<ExportResult>; flush(): Promise<void>; private exportQuietly; shutdown(): Promise<void>; healthCheck(): Promise<ExporterHealthStatus>; protected ping(): Promise<void>; private deliver; private post; }