/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d60db7a5753c */ 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 { ToolMetadata, ToolMetadata$inboundSchema, ToolMetadata$Outbound, ToolMetadata$outboundSchema, } from "./toolmetadata.js"; import { WriteActionParameter, WriteActionParameter$inboundSchema, WriteActionParameter$Outbound, WriteActionParameter$outboundSchema, } from "./writeactionparameter.js"; export type ToolInfo = { /** * The manifest for a tool that can be used to augment Glean Assistant. */ metadata?: ToolMetadata | undefined; /** * Parameters supported by the tool. */ parameters?: { [k: string]: WriteActionParameter } | undefined; }; /** @internal */ export const ToolInfo$inboundSchema: z.ZodType< ToolInfo, z.ZodTypeDef, unknown > = z.object({ metadata: ToolMetadata$inboundSchema.optional(), parameters: z.record(WriteActionParameter$inboundSchema).optional(), }); /** @internal */ export type ToolInfo$Outbound = { metadata?: ToolMetadata$Outbound | undefined; parameters?: { [k: string]: WriteActionParameter$Outbound } | undefined; }; /** @internal */ export const ToolInfo$outboundSchema: z.ZodType< ToolInfo$Outbound, z.ZodTypeDef, ToolInfo > = z.object({ metadata: ToolMetadata$outboundSchema.optional(), parameters: z.record(WriteActionParameter$outboundSchema).optional(), }); export function toolInfoToJSON(toolInfo: ToolInfo): string { return JSON.stringify(ToolInfo$outboundSchema.parse(toolInfo)); } export function toolInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ToolInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ToolInfo' from JSON`, ); }