变量 MessagesZodMetaConst

MessagesZodMeta: SchemaMeta<BaseMessage[], Messages>

用于 Zod 状态定义的预构建模式元数据。

示例

import { z } from "zod/v4-mini";
import { MessagesZodState, StateGraph } from "@langchain/langgraph";

const AgentState = z.object({
messages: z.custom<BaseMessage[]>().register(registry, MessagesZodMeta),
});