import { Annotation } from '@langchain/langgraph' import { Occupation } from '@shared/types/IReadingReflectionTask' export const ReadingReflectionState = Annotation.Root({ // 输入任务 bookName: Annotation(), author: Annotation(), description: Annotation(), occupation: Annotation(), tone: Annotation(), wordCount: Annotation(), // 标题:使用简单的覆盖逻辑 title: Annotation({ reducer: (_oldValue, newValue) => newValue, default: () => '' }), // 内容 content: Annotation({ reducer: (_oldValue, newValue) => newValue, default: () => '' }), // 摘要 summary: Annotation({ reducer: (_oldValue, newValue) => newValue, default: () => '' }), // 关键词:数组通常使用追加或替换逻辑 keywords: Annotation({ reducer: (_oldValue, newValue) => newValue, default: () => [] }) })