@blueking/chat-helper 0.0.3 → 0.0.4
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.
|
@@ -67,7 +67,7 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
67
67
|
task_name: string;
|
|
68
68
|
task_outputs: string[];
|
|
69
69
|
task_state: import("../event").FlowTaskState;
|
|
70
|
-
} | {
|
|
70
|
+
}[] | {
|
|
71
71
|
content: string;
|
|
72
72
|
referenceDocument: {
|
|
73
73
|
name: string;
|
|
@@ -366,7 +366,7 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
366
366
|
task_name: string;
|
|
367
367
|
task_outputs: string[];
|
|
368
368
|
task_state: import("../event").FlowTaskState;
|
|
369
|
-
} | {
|
|
369
|
+
}[] | {
|
|
370
370
|
content: string;
|
|
371
371
|
referenceDocument: {
|
|
372
372
|
name: string;
|
package/dist/event/ag-ui.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { ISSEProtocol } from '../http/fetch';
|
|
|
6
6
|
* @param message - 消息模块
|
|
7
7
|
*/
|
|
8
8
|
export declare class AGUIProtocol implements ISSEProtocol {
|
|
9
|
-
|
|
9
|
+
messageModule: IMessageModule;
|
|
10
10
|
private onDoneCallback?;
|
|
11
11
|
private onErrorCallback?;
|
|
12
12
|
private onMessageCallback?;
|
package/dist/event/ag-ui.ts.js
CHANGED
|
@@ -96,7 +96,7 @@ import { CustomEventName, EventType, FlowTaskState } from './type.ts.js';
|
|
|
96
96
|
const value = event.value;
|
|
97
97
|
this.messageModule.plusMessage({
|
|
98
98
|
role: MessageRole.Assistant,
|
|
99
|
-
content: value.task_outputs.join('\n'),
|
|
99
|
+
content: value.map((item)=>item.task_outputs.join('\n')).join('\n'),
|
|
100
100
|
status: MessageStatus.Complete
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -116,13 +116,13 @@ import { CustomEventName, EventType, FlowTaskState } from './type.ts.js';
|
|
|
116
116
|
this.messageModule.plusMessage({
|
|
117
117
|
role: MessageRole.Activity,
|
|
118
118
|
activityType: ActivityType.FlowAgent,
|
|
119
|
-
content: {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
content: value.map((item)=>({
|
|
120
|
+
nodes: {},
|
|
121
|
+
task_id: Number(item.task_id),
|
|
122
|
+
task_name: '',
|
|
123
|
+
task_outputs: [],
|
|
124
|
+
task_state: FlowTaskState.Created
|
|
125
|
+
})),
|
|
126
126
|
status: MessageStatus.Streaming
|
|
127
127
|
});
|
|
128
128
|
}
|
package/dist/event/type.d.ts
CHANGED
|
@@ -115,9 +115,9 @@ export interface ICustomEvent extends IBaseEvent {
|
|
|
115
115
|
value: IFlowAgentEndCustomValue | IFlowAgentResultCustomValue | IFlowAgentStartCustomValue | IKnowledgeRagResultCustomValue | IKnowledgeRagTextContentCustomValue | IReferenceDocumentCustomValue | ITempMessageCustomValue;
|
|
116
116
|
}
|
|
117
117
|
export type IEvent = IActivityDeltaEvent | IActivitySnapshotEvent | ICustomEvent | IMessagesSnapshotEvent | IRawEvent | IRunErrorEvent | IRunFinishedEvent | IRunStartedEvent | IStateDeltaEvent | IStateSnapshotEvent | IStepFinishedEvent | IStepStartedEvent | ITextMessageChunkEvent | ITextMessageContentEvent | ITextMessageEndEvent | ITextMessageStartEvent | IThinkingEndEvent | IThinkingStartEvent | IThinkingTextMessageContentEvent | IThinkingTextMessageEndEvent | IThinkingTextMessageStartEvent | IToolCallArgsEvent | IToolCallChunkEvent | IToolCallEndEvent | IToolCallResultEvent | IToolCallStartEvent;
|
|
118
|
-
export
|
|
118
|
+
export type IFlowAgentEndCustomValue = {
|
|
119
119
|
task_outputs: string[];
|
|
120
|
-
}
|
|
120
|
+
}[];
|
|
121
121
|
export interface IFlowAgentNode {
|
|
122
122
|
/** 耗时(s) */
|
|
123
123
|
elapsed_time: number;
|
|
@@ -128,16 +128,16 @@ export interface IFlowAgentNode {
|
|
|
128
128
|
/** 节点状态 */
|
|
129
129
|
state: FlowNodeState;
|
|
130
130
|
}
|
|
131
|
-
export
|
|
131
|
+
export type IFlowAgentResultCustomValue = {
|
|
132
132
|
nodes: Record<string, IFlowAgentNode>;
|
|
133
133
|
task_id: number;
|
|
134
134
|
task_name: string;
|
|
135
135
|
task_outputs: string[];
|
|
136
136
|
task_state: FlowTaskState;
|
|
137
|
-
}
|
|
138
|
-
export
|
|
137
|
+
}[];
|
|
138
|
+
export type IFlowAgentStartCustomValue = {
|
|
139
139
|
task_id: string;
|
|
140
|
-
}
|
|
140
|
+
}[];
|
|
141
141
|
export type IKnowledgeRagResultCustomValue = IReferenceDocumentCustomValue;
|
|
142
142
|
export interface IKnowledgeRagTextContentCustomValue {
|
|
143
143
|
cover: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
70
70
|
task_name: string;
|
|
71
71
|
task_outputs: string[];
|
|
72
72
|
task_state: import("./event").FlowTaskState;
|
|
73
|
-
} | {
|
|
73
|
+
}[] | {
|
|
74
74
|
content: string;
|
|
75
75
|
referenceDocument: {
|
|
76
76
|
name: string;
|
|
@@ -369,7 +369,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
369
369
|
task_name: string;
|
|
370
370
|
task_outputs: string[];
|
|
371
371
|
task_state: import("./event").FlowTaskState;
|
|
372
|
-
} | {
|
|
372
|
+
}[] | {
|
|
373
373
|
content: string;
|
|
374
374
|
referenceDocument: {
|
|
375
375
|
name: string;
|
|
@@ -647,7 +647,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
647
647
|
task_name: string;
|
|
648
648
|
task_outputs: string[];
|
|
649
649
|
task_state: import("./event").FlowTaskState;
|
|
650
|
-
} | {
|
|
650
|
+
}[] | {
|
|
651
651
|
content: string;
|
|
652
652
|
referenceDocument: {
|
|
653
653
|
name: string;
|
|
@@ -894,7 +894,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
894
894
|
task_name: string;
|
|
895
895
|
task_outputs: string[];
|
|
896
896
|
task_state: import("./event").FlowTaskState;
|
|
897
|
-
} | {
|
|
897
|
+
}[] | {
|
|
898
898
|
content: string;
|
|
899
899
|
referenceDocument: {
|
|
900
900
|
name: string;
|
|
@@ -1161,7 +1161,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1161
1161
|
task_name: string;
|
|
1162
1162
|
task_outputs: string[];
|
|
1163
1163
|
task_state: import("./event").FlowTaskState;
|
|
1164
|
-
} | {
|
|
1164
|
+
}[] | {
|
|
1165
1165
|
content: string;
|
|
1166
1166
|
referenceDocument: {
|
|
1167
1167
|
name: string;
|
|
@@ -1408,7 +1408,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1408
1408
|
task_name: string;
|
|
1409
1409
|
task_outputs: string[];
|
|
1410
1410
|
task_state: import("./event").FlowTaskState;
|
|
1411
|
-
} | {
|
|
1411
|
+
}[] | {
|
|
1412
1412
|
content: string;
|
|
1413
1413
|
referenceDocument: {
|
|
1414
1414
|
name: string;
|
|
@@ -1676,7 +1676,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1676
1676
|
task_name: string;
|
|
1677
1677
|
task_outputs: string[];
|
|
1678
1678
|
task_state: import("./event").FlowTaskState;
|
|
1679
|
-
} | {
|
|
1679
|
+
}[] | {
|
|
1680
1680
|
content: string;
|
|
1681
1681
|
referenceDocument: {
|
|
1682
1682
|
name: string;
|
|
@@ -1923,7 +1923,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1923
1923
|
task_name: string;
|
|
1924
1924
|
task_outputs: string[];
|
|
1925
1925
|
task_state: import("./event").FlowTaskState;
|
|
1926
|
-
} | {
|
|
1926
|
+
}[] | {
|
|
1927
1927
|
content: string;
|
|
1928
1928
|
referenceDocument: {
|
|
1929
1929
|
name: string;
|
|
@@ -2190,7 +2190,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2190
2190
|
task_name: string;
|
|
2191
2191
|
task_outputs: string[];
|
|
2192
2192
|
task_state: import("./event").FlowTaskState;
|
|
2193
|
-
} | {
|
|
2193
|
+
}[] | {
|
|
2194
2194
|
content: string;
|
|
2195
2195
|
referenceDocument: {
|
|
2196
2196
|
name: string;
|
|
@@ -2437,7 +2437,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2437
2437
|
task_name: string;
|
|
2438
2438
|
task_outputs: string[];
|
|
2439
2439
|
task_state: import("./event").FlowTaskState;
|
|
2440
|
-
} | {
|
|
2440
|
+
}[] | {
|
|
2441
2441
|
content: string;
|
|
2442
2442
|
referenceDocument: {
|
|
2443
2443
|
name: string;
|
|
@@ -2721,7 +2721,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2721
2721
|
task_name: string;
|
|
2722
2722
|
task_outputs: string[];
|
|
2723
2723
|
task_state: import("./event").FlowTaskState;
|
|
2724
|
-
} | {
|
|
2724
|
+
}[] | {
|
|
2725
2725
|
content: string;
|
|
2726
2726
|
referenceDocument: {
|
|
2727
2727
|
name: string;
|
|
@@ -2965,7 +2965,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2965
2965
|
task_name: string;
|
|
2966
2966
|
task_outputs: string[];
|
|
2967
2967
|
task_state: import("./event").FlowTaskState;
|
|
2968
|
-
} | {
|
|
2968
|
+
}[] | {
|
|
2969
2969
|
content: string;
|
|
2970
2970
|
referenceDocument: {
|
|
2971
2971
|
name: string;
|
|
@@ -3214,7 +3214,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
3214
3214
|
task_name: string;
|
|
3215
3215
|
task_outputs: string[];
|
|
3216
3216
|
task_state: import("./event").FlowTaskState;
|
|
3217
|
-
} | {
|
|
3217
|
+
}[] | {
|
|
3218
3218
|
content: string;
|
|
3219
3219
|
referenceDocument: {
|
|
3220
3220
|
name: string;
|
|
@@ -3459,7 +3459,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
3459
3459
|
task_name: string;
|
|
3460
3460
|
task_outputs: string[];
|
|
3461
3461
|
task_state: import("./event").FlowTaskState;
|
|
3462
|
-
} | {
|
|
3462
|
+
}[] | {
|
|
3463
3463
|
content: string;
|
|
3464
3464
|
referenceDocument: {
|
|
3465
3465
|
name: string;
|
|
@@ -14,7 +14,7 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
14
14
|
task_name: string;
|
|
15
15
|
task_outputs: string[];
|
|
16
16
|
task_state: import("..").FlowTaskState;
|
|
17
|
-
} | {
|
|
17
|
+
}[] | {
|
|
18
18
|
content: string;
|
|
19
19
|
referenceDocument: {
|
|
20
20
|
name: string;
|
|
@@ -258,7 +258,7 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
258
258
|
task_name: string;
|
|
259
259
|
task_outputs: string[];
|
|
260
260
|
task_state: import("..").FlowTaskState;
|
|
261
|
-
} | {
|
|
261
|
+
}[] | {
|
|
262
262
|
content: string;
|
|
263
263
|
referenceDocument: {
|
|
264
264
|
name: string;
|
|
@@ -507,7 +507,7 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
507
507
|
task_name: string;
|
|
508
508
|
task_outputs: string[];
|
|
509
509
|
task_state: import("..").FlowTaskState;
|
|
510
|
-
} | {
|
|
510
|
+
}[] | {
|
|
511
511
|
content: string;
|
|
512
512
|
referenceDocument: {
|
|
513
513
|
name: string;
|
|
@@ -752,7 +752,7 @@ export declare const useMessage: (mediator: IMediatorModule) => {
|
|
|
752
752
|
task_name: string;
|
|
753
753
|
task_outputs: string[];
|
|
754
754
|
task_state: import("..").FlowTaskState;
|
|
755
|
-
} | {
|
|
755
|
+
}[] | {
|
|
756
756
|
content: string;
|
|
757
757
|
referenceDocument: {
|
|
758
758
|
name: string;
|
|
@@ -30,7 +30,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
30
30
|
task_name: string;
|
|
31
31
|
task_outputs: string[];
|
|
32
32
|
task_state: import("..").FlowTaskState;
|
|
33
|
-
} | {
|
|
33
|
+
}[] | {
|
|
34
34
|
content: string;
|
|
35
35
|
referenceDocument: {
|
|
36
36
|
name: string;
|
|
@@ -277,7 +277,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
277
277
|
task_name: string;
|
|
278
278
|
task_outputs: string[];
|
|
279
279
|
task_state: import("..").FlowTaskState;
|
|
280
|
-
} | {
|
|
280
|
+
}[] | {
|
|
281
281
|
content: string;
|
|
282
282
|
referenceDocument: {
|
|
283
283
|
name: string;
|
|
@@ -544,7 +544,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
544
544
|
task_name: string;
|
|
545
545
|
task_outputs: string[];
|
|
546
546
|
task_state: import("..").FlowTaskState;
|
|
547
|
-
} | {
|
|
547
|
+
}[] | {
|
|
548
548
|
content: string;
|
|
549
549
|
referenceDocument: {
|
|
550
550
|
name: string;
|
|
@@ -791,7 +791,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
791
791
|
task_name: string;
|
|
792
792
|
task_outputs: string[];
|
|
793
793
|
task_state: import("..").FlowTaskState;
|
|
794
|
-
} | {
|
|
794
|
+
}[] | {
|
|
795
795
|
content: string;
|
|
796
796
|
referenceDocument: {
|
|
797
797
|
name: string;
|
|
@@ -1059,7 +1059,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1059
1059
|
task_name: string;
|
|
1060
1060
|
task_outputs: string[];
|
|
1061
1061
|
task_state: import("..").FlowTaskState;
|
|
1062
|
-
} | {
|
|
1062
|
+
}[] | {
|
|
1063
1063
|
content: string;
|
|
1064
1064
|
referenceDocument: {
|
|
1065
1065
|
name: string;
|
|
@@ -1306,7 +1306,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1306
1306
|
task_name: string;
|
|
1307
1307
|
task_outputs: string[];
|
|
1308
1308
|
task_state: import("..").FlowTaskState;
|
|
1309
|
-
} | {
|
|
1309
|
+
}[] | {
|
|
1310
1310
|
content: string;
|
|
1311
1311
|
referenceDocument: {
|
|
1312
1312
|
name: string;
|
|
@@ -1573,7 +1573,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1573
1573
|
task_name: string;
|
|
1574
1574
|
task_outputs: string[];
|
|
1575
1575
|
task_state: import("..").FlowTaskState;
|
|
1576
|
-
} | {
|
|
1576
|
+
}[] | {
|
|
1577
1577
|
content: string;
|
|
1578
1578
|
referenceDocument: {
|
|
1579
1579
|
name: string;
|
|
@@ -1820,7 +1820,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1820
1820
|
task_name: string;
|
|
1821
1821
|
task_outputs: string[];
|
|
1822
1822
|
task_state: import("..").FlowTaskState;
|
|
1823
|
-
} | {
|
|
1823
|
+
}[] | {
|
|
1824
1824
|
content: string;
|
|
1825
1825
|
referenceDocument: {
|
|
1826
1826
|
name: string;
|