/* * 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"; /** * Content item in a search result. */ export type VectorSearchResultContent = { /** * The content type identifier for text content. */ type: "text"; /** * The text content of the search result. */ text: string; }; /** @internal */ export const VectorSearchResultContent$inboundSchema: z.ZodType< VectorSearchResultContent, z.ZodTypeDef, unknown > = z.object({ type: z.literal("text"), text: z.string(), }); /** @internal */ export type VectorSearchResultContent$Outbound = { type: "text"; text: string; }; /** @internal */ export const VectorSearchResultContent$outboundSchema: z.ZodType< VectorSearchResultContent$Outbound, z.ZodTypeDef, VectorSearchResultContent > = z.object({ type: z.literal("text"), text: z.string(), }); export function vectorSearchResultContentToJSON( vectorSearchResultContent: VectorSearchResultContent, ): string { return JSON.stringify( VectorSearchResultContent$outboundSchema.parse(vectorSearchResultContent), ); } export function vectorSearchResultContentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => VectorSearchResultContent$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'VectorSearchResultContent' from JSON`, ); }