create-agent-chat-app
Version:
Create a LangGraph chat app with one command
20 lines (18 loc) • 394 B
text/typescript
import { BaseMessage } from "@langchain/core/messages";
import {
Annotation,
Messages,
messagesStateReducer,
} from "@langchain/langgraph";
/**
* Main graph state.
*/
export const GraphAnnotation = Annotation.Root({
/**
* The messages in the conversation.
*/
messages: Annotation<BaseMessage[], Messages>({
reducer: messagesStateReducer,
default: () => [],
}),
});