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

16 lines (15 loc) • 962 B
/** * @file Contains the logic for mapping raw evaluation results to the structured EvaluationData type. */ import type { EnhancedEvaluationContext, EvaluationResult, EvaluationData } from "../types/index.js"; /** * Maps a raw `EvaluationResult` to the structured `EvaluationData` format. * This includes calculating derived fields like `isOffTopic` and `alertSeverity`. * * @param result The raw `EvaluationResult` from the evaluator. * @param threshold The score threshold to determine if the evaluation is passing. * @param offTopicThreshold The score below which a response is considered off-topic. * @param highSeverityThreshold The score below which a failing response is high severity. * @returns A structured `EvaluationData` object. */ export declare function mapToEvaluationData(evalContext: EnhancedEvaluationContext, result: EvaluationResult, threshold: number, offTopicThreshold?: number, highSeverityThreshold?: number): EvaluationData;