fix:基本实现相关功能
This commit is contained in:
36
src/main/services/ai/state/readingReflectionState.ts
Normal file
36
src/main/services/ai/state/readingReflectionState.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { Annotation } from '@langchain/langgraph'
|
||||
import { Occupation } from '@shared/types/reflections'
|
||||
|
||||
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: () => []
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user