Files
read_book/src/main/services/ai/state/readingReflectionState.ts
寒寒 36cf521851 feat(desktop): 优化一些逻辑
1. 优化通知配置

2. 优化命名规范

3. 优化代码逻辑
2026-01-10 23:37:28 +08:00

37 lines
985 B
TypeScript

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