/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { AgentMemoryCompactItem, AgentMemoryCompactItem$inboundSchema, } from "./agent-memory-compact-item.js"; import { AgentMemoryContextUsage, AgentMemoryContextUsage$inboundSchema, } from "./agent-memory-context-usage.js"; import { AgentMemoryLoopEnvelope, AgentMemoryLoopEnvelope$inboundSchema, } from "./agent-memory-loop-envelope.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type AgentMemoryContextResponse = { loop: AgentMemoryLoopEnvelope; contextId: string; prompt: string | null; items: Array; totals: { [k: string]: number }; contextUsage: AgentMemoryContextUsage; omitted: { [k: string]: number }; raw?: { [k: string]: Array } | undefined; }; /** @internal */ export const AgentMemoryContextResponse$inboundSchema: z.ZodMiniType< AgentMemoryContextResponse, unknown > = z.object({ loop: AgentMemoryLoopEnvelope$inboundSchema, contextId: types.string(), prompt: types.nullable(types.string()), items: z.array(AgentMemoryCompactItem$inboundSchema), totals: z.record(z.string(), types.number()), contextUsage: AgentMemoryContextUsage$inboundSchema, omitted: z.record(z.string(), types.number()), raw: types.optional(z.record(z.string(), z.array(z.any()))), }); export function agentMemoryContextResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentMemoryContextResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentMemoryContextResponse' from JSON`, ); }