/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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"; /** * History tool definition: Enables the internal conversation-history retrieval tool for semantic lookup of past interactions. */ export type HistoryToolDefinition = { type: "history"; }; /** @internal */ export const HistoryToolDefinition$inboundSchema: z.ZodType< HistoryToolDefinition, z.ZodTypeDef, unknown > = z.object({ type: z.literal("history"), }); /** @internal */ export type HistoryToolDefinition$Outbound = { type: "history"; }; /** @internal */ export const HistoryToolDefinition$outboundSchema: z.ZodType< HistoryToolDefinition$Outbound, z.ZodTypeDef, HistoryToolDefinition > = z.object({ type: z.literal("history"), }); export function historyToolDefinitionToJSON( historyToolDefinition: HistoryToolDefinition, ): string { return JSON.stringify( HistoryToolDefinition$outboundSchema.parse(historyToolDefinition), ); } export function historyToolDefinitionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HistoryToolDefinition$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HistoryToolDefinition' from JSON`, ); }