@langgraph-js/sdk
Version:
The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces
14 lines (13 loc) • 594 B
TypeScript
import { AnnotationRoot, StateDefinition } from "@langchain/langgraph";
/**
* create state for langgraph
* @example
* export const GraphState = createState(createReactAgentAnnotation(), ModelState, SwarmState).build({
* current_plan: createDefaultAnnotation<Plan | null>(() => null),
* title: createDefaultAnnotation<string>(() => ""),
*});
*/
export declare const createState: <T extends readonly AnnotationRoot<any>[]>(...parents: T) => {
build: <D extends StateDefinition>(state?: D) => any;
};
export declare const createDefaultAnnotation: <T>(defaultValue: () => T) => any;