-
Notifications
You must be signed in to change notification settings - Fork 363
Open
Description
Privileged issue
- I am a LangGraph.js maintainer, or was asked directly by a LangGraph.js maintainer to create an issue here.
Issue Content
Currently, in order to set a default for a state key when using zod schemas, I have to do something like this:
import * as z from "zod";
import { registry } from "@langchain/langgraph/zod";
const schema = z.object({
foo: z.string().register(registry, {
default: () => "bar"
})
});
const graph = new StateGraph(schema);But I should be able to set defaults inside of a zod schema using the native method:
import * as z from "zod";
import { StateGraph } from "@langchain/langgraph";
const schema = z.object({
foo: z.string().default("bar")
});
const graph = new StateGraph(schema);Metadata
Metadata
Assignees
Labels
No labels