@blueking/chat-helper 0.0.12-beta.3 → 0.0.12-beta.5
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,14 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
49
49
|
/**
|
|
50
50
|
* 处理活动快照事件
|
|
51
51
|
* 记录活动的完整状态
|
|
52
|
-
*/ handleActivitySnapshotEvent(
|
|
52
|
+
*/ handleActivitySnapshotEvent(event) {
|
|
53
|
+
if (event.activityType === ActivityType.Interrupt) {
|
|
54
|
+
const interruptMessage = this.messageModule.getMessageByMessageId(event.messageId);
|
|
55
|
+
if (interruptMessage.role === MessageRole.Interrupt) {
|
|
56
|
+
interruptMessage.content = event.content;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
53
60
|
/**
|
|
54
61
|
* 处理自定义事件
|
|
55
62
|
*/ handleCustomEvent(event) {
|
|
@@ -418,23 +425,14 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
418
425
|
/**
|
|
419
426
|
* 处理工具调用结果事件
|
|
420
427
|
*/ 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
|
-
}
|
|
428
|
+
this.messageModule.plusMessage({
|
|
429
|
+
role: MessageRole.Tool,
|
|
430
|
+
content: event.content,
|
|
431
|
+
duration: event.duration,
|
|
432
|
+
status: event.isError ? MessageStatus.Error : MessageStatus.Complete,
|
|
433
|
+
toolCallId: event.toolCallId,
|
|
434
|
+
messageId: event.messageId
|
|
435
|
+
});
|
|
438
436
|
}
|
|
439
437
|
/**
|
|
440
438
|
* 处理工具调用开始事件
|
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) {
|