@our-llm/shared 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/workflow-events.ts +9 -10
- package/workflow.types.ts +10 -4
package/package.json
CHANGED
package/workflow-events.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// 工作流开始事件的 data
|
|
18
18
|
export interface WorkflowStartData {
|
|
19
19
|
t: string // threadId
|
|
20
|
-
ti
|
|
20
|
+
ti?: string // title (会话标题,默认为工作流名称,新对话会有,追问会话就不会再有了)
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
// 节点开始事件的 data
|
|
@@ -33,18 +33,17 @@ export interface NodeEndData {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
// 简化后的消息格式(与后端 SimpleMessage 保持一致)
|
|
36
|
+
// 支持有序的内容部件
|
|
37
|
+
export type SimpleMessagePart =
|
|
38
|
+
| { type: 'text'; text: string }
|
|
39
|
+
| { type: 'image'; url: string }
|
|
40
|
+
| { type: 'video'; url: string }
|
|
41
|
+
| { type: 'document'; filename: string; url: string }
|
|
42
|
+
|
|
36
43
|
export interface SimpleMessage {
|
|
37
44
|
type: 'human' | 'ai' | 'system'
|
|
38
|
-
|
|
39
|
-
| string
|
|
40
|
-
| Array<
|
|
41
|
-
| { type: 'text'; text: string }
|
|
42
|
-
| { type: 'image_url'; image_url: { url: string } }
|
|
43
|
-
>
|
|
45
|
+
parts: SimpleMessagePart[]
|
|
44
46
|
id?: string
|
|
45
|
-
images?: string[]
|
|
46
|
-
videos?: string[]
|
|
47
|
-
documents?: Array<{ filename: string; url: string }>
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
export interface LoadingData {
|
package/workflow.types.ts
CHANGED
|
@@ -75,6 +75,8 @@ export interface BrainNodeConfig extends NodeConfig {
|
|
|
75
75
|
humanMessageScript?: string // 可选的用户消息脚本,接收 context 参数(包含 variables 和 messages),返回 string[] 用于构造 HumanMessage[]
|
|
76
76
|
/** 联网搜索配置 */
|
|
77
77
|
webSearch?: WebSearchConfig
|
|
78
|
+
/** 静默模式:为 true 时不产生 UI 消息,仅将结果存储在 variables 中 */
|
|
79
|
+
silent?: boolean
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
// 条件判断节点配置
|
|
@@ -186,10 +188,14 @@ export interface Workflow extends WorkflowConfig {
|
|
|
186
188
|
|
|
187
189
|
// 工作流执行输入的消息内容部件类型
|
|
188
190
|
export type WorkflowMessagePart =
|
|
189
|
-
| {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
191
|
+
| {
|
|
192
|
+
type: 'text'
|
|
193
|
+
text: string
|
|
194
|
+
document?: { filename: string; url: string } // 表示这条消息是文档解析消息
|
|
195
|
+
}
|
|
196
|
+
| { type: 'image'; url: string }
|
|
197
|
+
| { type: 'file' | 'audio' | 'video'; url: string }
|
|
198
|
+
| { type: 'document'; url: string; filename: string; mimeType: string }
|
|
193
199
|
|
|
194
200
|
// 工作流执行输入的消息类型(content 为数组,支持多模态内容)
|
|
195
201
|
export interface WorkflowMessage {
|