/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export const SearchResultSource = { Session: "session", Knowledge: "knowledge", Pattern: "pattern", Archive: "archive", Fact: "fact", } as const; export type SearchResultSource = OpenEnum; export const SearchResultScope = { Global: "global", Local: "local", } as const; export type SearchResultScope = OpenEnum; export type SearchResult = { id: string; vectorId?: string | undefined; content: string; score: number; source: SearchResultSource; agentWallet: string; userAddress?: string | undefined; threadId?: string | undefined; scope?: SearchResultScope | undefined; haiId?: string | undefined; decayScore: number; accessCount: number; createdAt: number; }; /** @internal */ export const SearchResultSource$inboundSchema: z.ZodMiniType< SearchResultSource, unknown > = openEnums.inboundSchema(SearchResultSource); /** @internal */ export const SearchResultScope$inboundSchema: z.ZodMiniType< SearchResultScope, unknown > = openEnums.inboundSchema(SearchResultScope); /** @internal */ export const SearchResult$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), vectorId: types.optional(types.string()), content: types.string(), score: types.number(), source: SearchResultSource$inboundSchema, agentWallet: types.string(), userAddress: types.optional(types.string()), threadId: types.optional(types.string()), scope: types.optional(SearchResultScope$inboundSchema), haiId: types.optional(types.string()), decayScore: types.number(), accessCount: types.number(), createdAt: types.number(), }); export function searchResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SearchResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SearchResult' from JSON`, ); }