Files
agent-chat-ui/agent/types.ts
bracesproul 3f4aad48e6 split up
2025-02-27 15:41:47 -08:00

12 lines
494 B
TypeScript

import { MessagesAnnotation, Annotation } from "@langchain/langgraph";
import { uiMessageReducer } from "@langchain/langgraph-sdk/react-ui/types";
export const GenerativeUIAnnotation = Annotation.Root({
messages: MessagesAnnotation.spec["messages"],
ui: Annotation({ default: () => [], reducer: uiMessageReducer }),
timestamp: Annotation<number>,
next: Annotation<"stockbroker" | "weather" | "generalInput">(),
});
export type GenerativeUIState = typeof GenerativeUIAnnotation.State;