/* * 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"; /** * Input text content item: Plain text content to send to the model. */ export type InputText = { /** * The content type identifier for text input. */ type: "input_text"; /** * The text content to send to the model. */ text: string; }; /** @internal */ export const InputText$inboundSchema: z.ZodType< InputText, z.ZodTypeDef, unknown > = z.object({ type: z.literal("input_text"), text: z.string(), }); /** @internal */ export type InputText$Outbound = { type: "input_text"; text: string; }; /** @internal */ export const InputText$outboundSchema: z.ZodType< InputText$Outbound, z.ZodTypeDef, InputText > = z.object({ type: z.literal("input_text"), text: z.string(), }); export function inputTextToJSON(inputText: InputText): string { return JSON.stringify(InputText$outboundSchema.parse(inputText)); } export function inputTextFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InputText$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InputText' from JSON`, ); }