/* * 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"; import { WebSearchAction, WebSearchAction$inboundSchema, WebSearchAction$Outbound, WebSearchAction$outboundSchema, } from "./websearchaction.js"; /** * Web search call item: A web-search tool-call record containing the executed action and status. */ export type WebSearchToolCall = { type: "web_search_call"; id: string; action: WebSearchAction; status: string; }; /** @internal */ export const WebSearchToolCall$inboundSchema: z.ZodType< WebSearchToolCall, z.ZodTypeDef, unknown > = z.object({ type: z.literal("web_search_call"), id: z.string(), action: WebSearchAction$inboundSchema, status: z.string(), }); /** @internal */ export type WebSearchToolCall$Outbound = { type: "web_search_call"; id: string; action: WebSearchAction$Outbound; status: string; }; /** @internal */ export const WebSearchToolCall$outboundSchema: z.ZodType< WebSearchToolCall$Outbound, z.ZodTypeDef, WebSearchToolCall > = z.object({ type: z.literal("web_search_call"), id: z.string(), action: WebSearchAction$outboundSchema, status: z.string(), }); export function webSearchToolCallToJSON( webSearchToolCall: WebSearchToolCall, ): string { return JSON.stringify( WebSearchToolCall$outboundSchema.parse(webSearchToolCall), ); } export function webSearchToolCallFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebSearchToolCall$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebSearchToolCall' from JSON`, ); }