UNPKG

parea-ai

Version:

Client SDK library to connect to Parea AI.

22 lines (21 loc) 1.13 kB
import { ExperimentStatsSchema } from '../types'; /** * Generates a random name by combining an adjective and a noun. * @returns A string containing a randomly generated name in the format "adjective-noun". */ export declare function genRandomName(): string; /** * Calculates the average of an array of numbers and returns it as a string. * @param values - An array of numbers to calculate the average from. * @param isCost - A boolean indicating whether the values represent cost (defaults to false). * @returns A string representation of the average, with either 2 or 5 decimal places depending on isCost. */ export declare function calculateAvgAsString(values: number[] | undefined, isCost?: boolean): string; /** * Calculates average statistics for an experiment based on its trace stats. * @param experimentStats - An object containing experiment statistics, including trace stats. * @returns An object with average values for various metrics (latency, tokens, cost, and scores). */ export declare function calculateAvgStdForExperiment(experimentStats: ExperimentStatsSchema): { [key: string]: string; };