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

import * as z from "zod/v4";
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,
  unknown
> = z.object({
  scores: z.record(z.string(), 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`,
  );
}
