@blueking/chat-helper 0.0.12-beta.7 → 0.0.12-beta.9
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.
|
@@ -306,7 +306,7 @@ import { SessionStatus } from '../session/type.ts.js';
|
|
|
306
306
|
// 如果会话不匹配,则不继续轮询
|
|
307
307
|
if (sessionCode !== ((_mediator_session = mediator.session) === null || _mediator_session === void 0 ? void 0 : (_mediator_session_current = _mediator_session.current) === null || _mediator_session_current === void 0 ? void 0 : (_mediator_session_current_value = _mediator_session_current.value) === null || _mediator_session_current_value === void 0 ? void 0 : _mediator_session_current_value.sessionCode)) return;
|
|
308
308
|
pollResumeSession(sessionCode);
|
|
309
|
-
},
|
|
309
|
+
}, 10000);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}
|
package/dist/event/ag-ui.d.ts
CHANGED
package/dist/event/ag-ui.ts.js
CHANGED
|
@@ -49,7 +49,15 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
49
49
|
/**
|
|
50
50
|
* 处理活动快照事件
|
|
51
51
|
* 记录活动的完整状态
|
|
52
|
-
*/ handleActivitySnapshotEvent(
|
|
52
|
+
*/ handleActivitySnapshotEvent(event) {
|
|
53
|
+
const message = this.messageModule.getCurrentLoadingMessage();
|
|
54
|
+
if (event.activityType === ActivityType.Interrupt) {
|
|
55
|
+
if ((message === null || message === void 0 ? void 0 : message.role) === MessageRole.Interrupt) {
|
|
56
|
+
message.content = event.content;
|
|
57
|
+
message.status = MessageStatus.Complete;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
53
61
|
/**
|
|
54
62
|
* 处理自定义事件
|
|
55
63
|
*/ handleCustomEvent(event) {
|
|
@@ -418,23 +426,14 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
418
426
|
/**
|
|
419
427
|
* 处理工具调用结果事件
|
|
420
428
|
*/ handleToolCallResultEvent(event) {
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
this.messageModule.plusMessage({
|
|
430
|
-
role: MessageRole.Tool,
|
|
431
|
-
content: event.content,
|
|
432
|
-
duration: event.duration,
|
|
433
|
-
status: event.isError ? MessageStatus.Error : MessageStatus.Complete,
|
|
434
|
-
toolCallId: event.toolCallId,
|
|
435
|
-
messageId: event.messageId
|
|
436
|
-
});
|
|
437
|
-
}
|
|
429
|
+
this.messageModule.plusMessage({
|
|
430
|
+
role: MessageRole.Tool,
|
|
431
|
+
content: event.content,
|
|
432
|
+
duration: event.duration,
|
|
433
|
+
status: event.isError ? MessageStatus.Error : MessageStatus.Complete,
|
|
434
|
+
toolCallId: event.toolCallId,
|
|
435
|
+
messageId: event.messageId
|
|
436
|
+
});
|
|
438
437
|
}
|
|
439
438
|
/**
|
|
440
439
|
* 处理工具调用开始事件
|
package/dist/message/type.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import type { IFlowAgentResultCustomValue, IRunFinishedEvent } from '../event/ty
|
|
|
2
2
|
export declare enum ActivityType {
|
|
3
3
|
FlowAgent = "flow_agent",
|
|
4
4
|
KnowledgeRag = "knowledge_rag",
|
|
5
|
-
ReferenceDocument = "reference_document"
|
|
5
|
+
ReferenceDocument = "reference_document",
|
|
6
|
+
Interrupt = "interrupt"
|
|
6
7
|
}
|
|
7
8
|
export declare enum MessageRole {
|
|
8
9
|
Activity = "activity",
|
package/dist/message/type.ts.js
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
ActivityType["FlowAgent"] = "flow_agent";
|
|
28
28
|
ActivityType["KnowledgeRag"] = "knowledge_rag";
|
|
29
29
|
ActivityType["ReferenceDocument"] = "reference_document";
|
|
30
|
+
ActivityType["Interrupt"] = "interrupt";
|
|
30
31
|
})(ActivityType || (ActivityType = {}));
|
|
31
32
|
export var MessageRole;
|
|
32
33
|
(function(MessageRole) {
|