import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
import { z } from "zod/v4";
const clarkErrorDataSchema = z.object({
    responseMetadata: z.object({
        status: z.number(),
        message: z.string(),
        success: z.boolean(),
        error: z.object({
            code: z.string(),
            message: z.string(),
        }),
    }),
});
export const clarkFailedResponseHandler = createJsonErrorResponseHandler({
    errorSchema: clarkErrorDataSchema,
    errorToMessage: (data) => data.responseMetadata.error.message,
});
//# sourceMappingURL=clark-error-handler.js.map