/* * 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"; /** * A content item from a vector store file. */ export type FileContentItem = { /** * The content type. */ type: "text"; /** * The text content. */ text: string; }; /** @internal */ export const FileContentItem$inboundSchema: z.ZodType< FileContentItem, z.ZodTypeDef, unknown > = z.object({ type: z.literal("text"), text: z.string(), }); /** @internal */ export type FileContentItem$Outbound = { type: "text"; text: string; }; /** @internal */ export const FileContentItem$outboundSchema: z.ZodType< FileContentItem$Outbound, z.ZodTypeDef, FileContentItem > = z.object({ type: z.literal("text"), text: z.string(), }); export function fileContentItemToJSON( fileContentItem: FileContentItem, ): string { return JSON.stringify(FileContentItem$outboundSchema.parse(fileContentItem)); } export function fileContentItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FileContentItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FileContentItem' from JSON`, ); }