/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 5bf4edba1096
 */
import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { smartUnion } from "../../types/smartUnion.js";
import { BuiltInConnectors$inboundSchema, BuiltInConnectors$outboundSchema, } from "./builtinconnectors.js";
/** @internal */
export const ToolReferenceChunkTool$inboundSchema = smartUnion([BuiltInConnectors$inboundSchema, z.string()]);
/** @internal */
export const ToolReferenceChunkTool$outboundSchema = smartUnion([BuiltInConnectors$outboundSchema, z.string()]);
export function toolReferenceChunkToolToJSON(toolReferenceChunkTool) {
    return JSON.stringify(ToolReferenceChunkTool$outboundSchema.parse(toolReferenceChunkTool));
}
export function toolReferenceChunkToolFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolReferenceChunkTool$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolReferenceChunkTool' from JSON`);
}
/** @internal */
export const ToolReferenceChunk$inboundSchema = z.object({
    type: z.literal("tool_reference").default("tool_reference"),
    tool: smartUnion([BuiltInConnectors$inboundSchema, z.string()]),
    title: z.string(),
    url: z.nullable(z.string()).optional(),
    favicon: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
});
/** @internal */
export const ToolReferenceChunk$outboundSchema = z.object({
    type: z.literal("tool_reference").default("tool_reference"),
    tool: smartUnion([BuiltInConnectors$outboundSchema, z.string()]),
    title: z.string(),
    url: z.nullable(z.string()).optional(),
    favicon: z.nullable(z.string()).optional(),
    description: z.nullable(z.string()).optional(),
});
export function toolReferenceChunkToJSON(toolReferenceChunk) {
    return JSON.stringify(ToolReferenceChunk$outboundSchema.parse(toolReferenceChunk));
}
export function toolReferenceChunkFromJSON(jsonString) {
    return safeParse(jsonString, (x) => ToolReferenceChunk$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolReferenceChunk' from JSON`);
}
//# sourceMappingURL=toolreferencechunk.js.map