/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { ClosedEnum } from "../types/enums.js"; /** * Advisory attachment kind. The SDK/server do not reject unsupported model combinations. */ export const AttachmentType = { Image: "image", Audio: "audio", Video: "video", Pdf: "pdf", File: "file", Text: "text", Json: "json", Url: "url", } as const; /** * Advisory attachment kind. The SDK/server do not reject unsupported model combinations. */ export type AttachmentType = ClosedEnum; export const Detail = { Auto: "auto", Low: "low", High: "high", } as const; export type Detail = ClosedEnum; export type Attachment = { /** * Advisory attachment kind. The SDK/server do not reject unsupported model combinations. */ type?: AttachmentType | undefined; url?: string | undefined; uri?: string | undefined; /** * Data URL, plain text content, or provider-ready encoded payload. */ data?: string | undefined; base64?: string | undefined; mimeType?: string | undefined; contentType?: string | undefined; name?: string | undefined; filename?: string | undefined; text?: string | undefined; content?: string | undefined; detail?: Detail | undefined; metadata?: { [k: string]: any } | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const AttachmentType$outboundSchema: z.ZodMiniEnum< typeof AttachmentType > = z.enum(AttachmentType); /** @internal */ export const Detail$outboundSchema: z.ZodMiniEnum = z.enum( Detail, ); /** @internal */ export type Attachment$Outbound = { type?: string | undefined; url?: string | undefined; uri?: string | undefined; data?: string | undefined; base64?: string | undefined; mimeType?: string | undefined; contentType?: string | undefined; name?: string | undefined; filename?: string | undefined; text?: string | undefined; content?: string | undefined; detail?: string | undefined; metadata?: { [k: string]: any } | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const Attachment$outboundSchema: z.ZodMiniType< Attachment$Outbound, Attachment > = z.catchall( z.object({ type: z.optional(AttachmentType$outboundSchema), url: z.optional(z.string()), uri: z.optional(z.string()), data: z.optional(z.string()), base64: z.optional(z.string()), mimeType: z.optional(z.string()), contentType: z.optional(z.string()), name: z.optional(z.string()), filename: z.optional(z.string()), text: z.optional(z.string()), content: z.optional(z.string()), detail: z.optional(Detail$outboundSchema), metadata: z.optional(z.record(z.string(), z.any())), }), z.any(), ); export function attachmentToJSON(attachment: Attachment): string { return JSON.stringify(Attachment$outboundSchema.parse(attachment)); }