@blueking/chat-helper 0.0.12-beta.6 → 0.0.12-beta.7
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
|
+
}, 15000);
|
|
310
310
|
}
|
|
311
311
|
});
|
|
312
312
|
}
|
package/dist/event/ag-ui.d.ts
CHANGED
package/dist/event/ag-ui.ts.js
CHANGED
|
@@ -49,14 +49,7 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
49
49
|
/**
|
|
50
50
|
* 处理活动快照事件
|
|
51
51
|
* 记录活动的完整状态
|
|
52
|
-
*/ handleActivitySnapshotEvent(
|
|
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
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
52
|
+
*/ handleActivitySnapshotEvent(_event) {}
|
|
60
53
|
/**
|
|
61
54
|
* 处理自定义事件
|
|
62
55
|
*/ handleCustomEvent(event) {
|
|
@@ -425,14 +418,23 @@ import { CustomEventName, EventType, FlowTaskState, RunFinishedOutcomeType } fro
|
|
|
425
418
|
/**
|
|
426
419
|
* 处理工具调用结果事件
|
|
427
420
|
*/ handleToolCallResultEvent(event) {
|
|
428
|
-
this.messageModule.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
421
|
+
const message = this.messageModule.getCurrentLoadingMessage();
|
|
422
|
+
if ((message === null || message === void 0 ? void 0 : message.role) === MessageRole.Interrupt) {
|
|
423
|
+
// 如果是中断消息,则更新消息内容
|
|
424
|
+
message.content.result = JSON.parse(event.content);
|
|
425
|
+
message.content.outcome.type = RunFinishedOutcomeType.Success;
|
|
426
|
+
message.status = MessageStatus.Complete;
|
|
427
|
+
} else {
|
|
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
|
+
}
|
|
436
438
|
}
|
|
437
439
|
/**
|
|
438
440
|
* 处理工具调用开始事件
|
package/dist/message/type.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ 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"
|
|
6
|
-
Interrupt = "interrupt"
|
|
5
|
+
ReferenceDocument = "reference_document"
|
|
7
6
|
}
|
|
8
7
|
export declare enum MessageRole {
|
|
9
8
|
Activity = "activity",
|
package/dist/message/type.ts.js
CHANGED
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
ActivityType["FlowAgent"] = "flow_agent";
|
|
28
28
|
ActivityType["KnowledgeRag"] = "knowledge_rag";
|
|
29
29
|
ActivityType["ReferenceDocument"] = "reference_document";
|
|
30
|
-
ActivityType["Interrupt"] = "interrupt";
|
|
31
30
|
})(ActivityType || (ActivityType = {}));
|
|
32
31
|
export var MessageRole;
|
|
33
32
|
(function(MessageRole) {
|