/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EvalLeaderboardRunGroup = { /** * The group's model. */ model: string; /** * The group's targeted task, or null for the per-model covers-everything group that unrestricted runs (no task_ids) rank in — those runs cover every task of their version. */ taskId: string | null; /** * 1 is the group's newest completed run. Ranks order runs within a group but are not slot indexes: under truncation a group's surviving ranks may be non-contiguous. */ rank: number; /** * The run holding this rank; the full run object is in `data`. */ runId: string; }; /** @internal */ export const EvalLeaderboardRunGroup$inboundSchema: z.ZodType< EvalLeaderboardRunGroup, z.ZodTypeDef, unknown > = z.object({ model: z.string(), task_id: z.nullable(z.string()), rank: z.number().int(), run_id: z.string(), }).transform((v) => { return remap$(v, { "task_id": "taskId", "run_id": "runId", }); }); /** @internal */ export type EvalLeaderboardRunGroup$Outbound = { model: string; task_id: string | null; rank: number; run_id: string; }; /** @internal */ export const EvalLeaderboardRunGroup$outboundSchema: z.ZodType< EvalLeaderboardRunGroup$Outbound, z.ZodTypeDef, EvalLeaderboardRunGroup > = z.object({ model: z.string(), taskId: z.nullable(z.string()), rank: z.number().int(), runId: z.string(), }).transform((v) => { return remap$(v, { taskId: "task_id", runId: "run_id", }); }); export function evalLeaderboardRunGroupToJSON( evalLeaderboardRunGroup: EvalLeaderboardRunGroup, ): string { return JSON.stringify( EvalLeaderboardRunGroup$outboundSchema.parse(evalLeaderboardRunGroup), ); } export function evalLeaderboardRunGroupFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EvalLeaderboardRunGroup$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EvalLeaderboardRunGroup' from JSON`, ); }