/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2968f713b76f */ 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"; import { Chat, Chat$inboundSchema } from "./chat.js"; export type ChatResult = { /** * A historical representation of a series of chat messages a user had with Glean Assistant. */ chat?: Chat | undefined; /** * An opaque token that represents this particular Chat. To be used for `/feedback` reporting. */ trackingToken?: string | undefined; }; /** @internal */ export const ChatResult$inboundSchema: z.ZodType< ChatResult, z.ZodTypeDef, unknown > = z.object({ chat: Chat$inboundSchema.optional(), trackingToken: z.string().optional(), }); export function chatResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ChatResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ChatResult' from JSON`, ); }