/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type ClassificationTargetResult = {
  scores: { [k: string]: number };
};

/** @internal */
export const ClassificationTargetResult$inboundSchema: z.ZodType<
  ClassificationTargetResult,
  z.ZodTypeDef,
  unknown
> = z.object({
  scores: z.record(z.number()),
});

export function classificationTargetResultFromJSON(
  jsonString: string,
): SafeParseResult<ClassificationTargetResult, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => ClassificationTargetResult$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'ClassificationTargetResult' from JSON`,
  );
}
