/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Annotation for citing a file within a specific container (like a code interpreter sandbox). Used when the model references files generated within tool executions. */ export type ContainerFileCitation = { /** * The annotation type identifier for container file citations. */ type: "container_file_citation"; /** * The ID of the container (e.g., code interpreter container) where the file resides. */ containerId: string; /** * The character index where the cited text ends in the output. */ endIndex: number; /** * The ID of the file within the container being cited. */ fileId: string; /** * The name of the file being cited. */ filename: string; /** * The character index where the cited text begins in the output. */ startIndex: number; }; /** @internal */ export const ContainerFileCitation$inboundSchema: z.ZodType< ContainerFileCitation, z.ZodTypeDef, unknown > = z.object({ type: z.literal("container_file_citation"), container_id: z.string(), end_index: z.number().int(), file_id: z.string(), filename: z.string(), start_index: z.number().int(), }).transform((v) => { return remap$(v, { "container_id": "containerId", "end_index": "endIndex", "file_id": "fileId", "start_index": "startIndex", }); }); /** @internal */ export type ContainerFileCitation$Outbound = { type: "container_file_citation"; container_id: string; end_index: number; file_id: string; filename: string; start_index: number; }; /** @internal */ export const ContainerFileCitation$outboundSchema: z.ZodType< ContainerFileCitation$Outbound, z.ZodTypeDef, ContainerFileCitation > = z.object({ type: z.literal("container_file_citation"), containerId: z.string(), endIndex: z.number().int(), fileId: z.string(), filename: z.string(), startIndex: z.number().int(), }).transform((v) => { return remap$(v, { containerId: "container_id", endIndex: "end_index", fileId: "file_id", startIndex: "start_index", }); }); export function containerFileCitationToJSON( containerFileCitation: ContainerFileCitation, ): string { return JSON.stringify( ContainerFileCitation$outboundSchema.parse(containerFileCitation), ); } export function containerFileCitationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ContainerFileCitation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ContainerFileCitation' from JSON`, ); }