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

14 lines (13 loc) • 865 B
/** * @description Serializes a value for a span attribute: strings pass through, everything else is JSON, with a `String()` fallback for circular structures and `[unserializable]` when even that throws. * @param value {T} - Value to serialize. * @returns {string} The serialized value; never throws. */ export declare function stringify<T>(value: T): string; /** * @description Cuts every string inside a structure down to a per-string character budget, in place, leaving a truncation note on each cut string. Only call it on a copy the caller owns. * @param node {T} - String or structure to shorten. * @param budget {number} - Maximum characters kept per string, note included. * @returns {T | string} The shortened string, or the same structure after its strings were cut. */ export declare function capStrings<T>(node: T, budget: number): T | string;