@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
63 lines (62 loc) • 1.61 kB
TypeScript
/**
* @file Langfuse Adapter
* Integration with Langfuse for LLM observability
*/
import type { LangfuseAdapterConfig, LangfuseClient } from "../../types/index.js";
/**
* Langfuse adapter for evaluation observability
*/
export declare class LangfuseAdapter {
private _config;
private _unsubscribers;
private _traceIdMap;
constructor(config: LangfuseAdapterConfig);
/**
* Start listening to evaluation events
*/
start(): void;
/**
* Stop listening to events
*/
stop(): void;
/**
* Send scorer score to Langfuse
*/
private _sendScorerScore;
/**
* Send pipeline scores to Langfuse
*/
private _sendPipelineScores;
/**
* Manually send a score to Langfuse
*/
sendScore(name: string, value: number, options?: {
traceId?: string;
comment?: string;
metadata?: Record<string, unknown>;
}): Promise<void>;
/**
* Shutdown the adapter and flush any pending data
*/
shutdown(): Promise<void>;
}
/**
* Create a Langfuse adapter
*/
export declare function createLangfuseAdapter(config: LangfuseAdapterConfig): LangfuseAdapter;
/**
* Create and start a Langfuse adapter
*/
export declare function startLangfuseAdapter(config: LangfuseAdapterConfig): LangfuseAdapter;
/**
* Helper: Create a mock Langfuse client for testing
*/
export declare function createMockLangfuseClient(): LangfuseClient & {
scores: Array<{
name: string;
value: number;
traceId?: string;
comment?: string;
metadata?: Record<string, unknown>;
}>;
};