@blueking/chat-helper 0.0.1-beta.26 → 0.0.1-beta.28
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/dist/agent/type.d.ts +7 -0
- package/dist/agent/use-agent.d.ts +12 -0
- package/dist/event/ag-ui.d.ts +4 -0
- package/dist/event/ag-ui.ts.js +13 -0
- package/dist/event/type.d.ts +8 -3
- package/dist/event/type.ts.js +1 -0
- package/dist/http/transform/agent.ts.js +6 -2
- package/dist/index.d.ts +12 -0
- package/package.json +1 -1
package/dist/agent/type.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { IMessage } from '../message/type';
|
|
2
|
+
export interface ISupportUpload {
|
|
3
|
+
vision: boolean;
|
|
4
|
+
}
|
|
2
5
|
export interface IAgentCommand {
|
|
3
6
|
agentId: number;
|
|
4
7
|
alias?: string;
|
|
@@ -8,6 +11,7 @@ export interface IAgentCommand {
|
|
|
8
11
|
id: string;
|
|
9
12
|
name: string;
|
|
10
13
|
status: string;
|
|
14
|
+
supportUpload?: ISupportUpload;
|
|
11
15
|
}
|
|
12
16
|
export interface IAgentCommandApi {
|
|
13
17
|
agent_id: number;
|
|
@@ -19,6 +23,7 @@ export interface IAgentCommandApi {
|
|
|
19
23
|
name: string;
|
|
20
24
|
selectedText?: null | string;
|
|
21
25
|
status: string;
|
|
26
|
+
support_upload?: ISupportUpload;
|
|
22
27
|
}
|
|
23
28
|
export interface IAgentCommandComponent {
|
|
24
29
|
default?: null | string;
|
|
@@ -68,6 +73,7 @@ export interface IAgentInfo {
|
|
|
68
73
|
};
|
|
69
74
|
promptSetting?: {
|
|
70
75
|
content?: IMessage[];
|
|
76
|
+
supportUpload?: ISupportUpload;
|
|
71
77
|
};
|
|
72
78
|
}
|
|
73
79
|
export interface IAgentInfoApi {
|
|
@@ -87,6 +93,7 @@ export interface IAgentInfoApi {
|
|
|
87
93
|
};
|
|
88
94
|
prompt_setting?: {
|
|
89
95
|
content?: IMessage[];
|
|
96
|
+
support_upload?: ISupportUpload;
|
|
90
97
|
};
|
|
91
98
|
}
|
|
92
99
|
export interface IAgentResourceItem {
|
|
@@ -50,6 +50,9 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
50
50
|
id: string;
|
|
51
51
|
name: string;
|
|
52
52
|
status: string;
|
|
53
|
+
supportUpload?: {
|
|
54
|
+
vision: boolean;
|
|
55
|
+
};
|
|
53
56
|
}[];
|
|
54
57
|
enableChatSession?: boolean;
|
|
55
58
|
openingRemark?: string;
|
|
@@ -295,6 +298,9 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
295
298
|
sessionCode?: string;
|
|
296
299
|
status: MessageStatus;
|
|
297
300
|
})[];
|
|
301
|
+
supportUpload?: {
|
|
302
|
+
vision: boolean;
|
|
303
|
+
};
|
|
298
304
|
};
|
|
299
305
|
}, IAgentInfo | {
|
|
300
306
|
agentName?: string;
|
|
@@ -337,6 +343,9 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
337
343
|
id: string;
|
|
338
344
|
name: string;
|
|
339
345
|
status: string;
|
|
346
|
+
supportUpload?: {
|
|
347
|
+
vision: boolean;
|
|
348
|
+
};
|
|
340
349
|
}[];
|
|
341
350
|
enableChatSession?: boolean;
|
|
342
351
|
openingRemark?: string;
|
|
@@ -582,6 +591,9 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
582
591
|
sessionCode?: string;
|
|
583
592
|
status: MessageStatus;
|
|
584
593
|
})[];
|
|
594
|
+
supportUpload?: {
|
|
595
|
+
vision: boolean;
|
|
596
|
+
};
|
|
585
597
|
};
|
|
586
598
|
}>;
|
|
587
599
|
isInfoLoading: import("vue").Ref<boolean, boolean>;
|
package/dist/event/ag-ui.d.ts
CHANGED
|
@@ -89,6 +89,10 @@ export declare class AGUIProtocol implements ISSEProtocol {
|
|
|
89
89
|
* 处理步骤开始事件
|
|
90
90
|
*/
|
|
91
91
|
handleStepStartedEvent(_event: IStepStartedEvent): void;
|
|
92
|
+
/**
|
|
93
|
+
* 自定义事件 处理临时消息,转换为 AI 文本消息
|
|
94
|
+
*/
|
|
95
|
+
handleTempMessageCustomEvent(event: ICustomEvent): void;
|
|
92
96
|
/**
|
|
93
97
|
* 处理文本消息块事件
|
|
94
98
|
*/
|
package/dist/event/ag-ui.ts.js
CHANGED
|
@@ -69,6 +69,9 @@ import { CustomEventName, EventType } from './type.ts.js';
|
|
|
69
69
|
case CustomEventName.KnowledgeRagEnd:
|
|
70
70
|
this.handleKnowledgeRagEndCustomEvent(event);
|
|
71
71
|
break;
|
|
72
|
+
case CustomEventName.TempMessage:
|
|
73
|
+
this.handleTempMessageCustomEvent(event);
|
|
74
|
+
break;
|
|
72
75
|
default:
|
|
73
76
|
break;
|
|
74
77
|
}
|
|
@@ -186,6 +189,16 @@ import { CustomEventName, EventType } from './type.ts.js';
|
|
|
186
189
|
// console.log('StepStarted:', _event);
|
|
187
190
|
}
|
|
188
191
|
/**
|
|
192
|
+
* 自定义事件 处理临时消息,转换为 AI 文本消息
|
|
193
|
+
*/ handleTempMessageCustomEvent(event) {
|
|
194
|
+
const value = event.value;
|
|
195
|
+
this.messageModule.plusMessage({
|
|
196
|
+
role: MessageRole.Assistant,
|
|
197
|
+
content: value.message,
|
|
198
|
+
status: value.status
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
189
202
|
* 处理文本消息块事件
|
|
190
203
|
*/ handleTextMessageChunkEvent(event) {
|
|
191
204
|
const message = this.messageModule.getCurrentLoadingMessage();
|
package/dist/event/type.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type IMessageApi, type MessageRole } from '../message/type';
|
|
1
|
+
import { type IMessageApi, type MessageRole, type MessageStatus } from '../message/type';
|
|
2
2
|
export declare enum CustomEventName {
|
|
3
3
|
KnowledgeRagEnd = "knowledge_rag_end",
|
|
4
4
|
KnowledgeRagResult = "knowledge_rag_result",
|
|
5
5
|
KnowledgeRagStart = "knowledge_rag_start",
|
|
6
6
|
KnowledgeRagTextContent = "knowledge_rag_text_content",
|
|
7
|
-
ReferenceDocument = "reference_document"
|
|
7
|
+
ReferenceDocument = "reference_document",
|
|
8
|
+
TempMessage = "temp_message"
|
|
8
9
|
}
|
|
9
10
|
export declare enum EventType {
|
|
10
11
|
ActivityDelta = "ACTIVITY_DELTA",
|
|
@@ -70,7 +71,7 @@ export interface IBaseEvent {
|
|
|
70
71
|
export interface ICustomEvent extends IBaseEvent {
|
|
71
72
|
name: CustomEventName;
|
|
72
73
|
type: EventType.Custom;
|
|
73
|
-
value: IKnowledgeRagResultCustomValue | IKnowledgeRagTextContentCustomValue | IReferenceDocumentCustomValue;
|
|
74
|
+
value: IKnowledgeRagResultCustomValue | IKnowledgeRagTextContentCustomValue | IReferenceDocumentCustomValue | ITempMessageCustomValue;
|
|
74
75
|
}
|
|
75
76
|
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;
|
|
76
77
|
export type IKnowledgeRagResultCustomValue = IReferenceDocumentCustomValue;
|
|
@@ -98,6 +99,10 @@ export interface IRawEvent extends IBaseEvent {
|
|
|
98
99
|
source?: string;
|
|
99
100
|
type: EventType.Raw;
|
|
100
101
|
}
|
|
102
|
+
export interface ITempMessageCustomValue {
|
|
103
|
+
message: string;
|
|
104
|
+
status: MessageStatus;
|
|
105
|
+
}
|
|
101
106
|
export type IReferenceDocumentCustomValue = {
|
|
102
107
|
name: string;
|
|
103
108
|
originFileUrl?: string;
|
package/dist/event/type.ts.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
CustomEventName["KnowledgeRagStart"] = "knowledge_rag_start";
|
|
30
30
|
CustomEventName["KnowledgeRagTextContent"] = "knowledge_rag_text_content";
|
|
31
31
|
CustomEventName["ReferenceDocument"] = "reference_document";
|
|
32
|
+
CustomEventName["TempMessage"] = "temp_message";
|
|
32
33
|
})(CustomEventName || (CustomEventName = {}));
|
|
33
34
|
export var EventType;
|
|
34
35
|
(function(EventType) {
|
|
@@ -53,11 +53,15 @@
|
|
|
53
53
|
})),
|
|
54
54
|
content: command.content,
|
|
55
55
|
agentId: command.agent_id,
|
|
56
|
-
status: command.status
|
|
56
|
+
status: command.status,
|
|
57
|
+
supportUpload: command.support_upload
|
|
57
58
|
})),
|
|
58
59
|
enableChatSession: data === null || data === void 0 ? void 0 : (_data_conversation_settings3 = data.conversation_settings) === null || _data_conversation_settings3 === void 0 ? void 0 : _data_conversation_settings3.enable_chat_session
|
|
59
60
|
},
|
|
60
|
-
promptSetting: data === null || data === void 0 ? void 0 : data.prompt_setting
|
|
61
|
+
promptSetting: (data === null || data === void 0 ? void 0 : data.prompt_setting) ? {
|
|
62
|
+
content: data.prompt_setting.content,
|
|
63
|
+
supportUpload: data.prompt_setting.support_upload
|
|
64
|
+
} : undefined,
|
|
61
65
|
agentName: data === null || data === void 0 ? void 0 : data.agent_name,
|
|
62
66
|
chatGroup: (data === null || data === void 0 ? void 0 : data.chat_group) ? {
|
|
63
67
|
enabled: data.chat_group.enabled,
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,9 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
52
52
|
id: string;
|
|
53
53
|
name: string;
|
|
54
54
|
status: string;
|
|
55
|
+
supportUpload?: {
|
|
56
|
+
vision: boolean;
|
|
57
|
+
};
|
|
55
58
|
}[];
|
|
56
59
|
enableChatSession?: boolean;
|
|
57
60
|
openingRemark?: string;
|
|
@@ -297,6 +300,9 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
297
300
|
sessionCode?: string;
|
|
298
301
|
status: import("./message").MessageStatus;
|
|
299
302
|
})[];
|
|
303
|
+
supportUpload?: {
|
|
304
|
+
vision: boolean;
|
|
305
|
+
};
|
|
300
306
|
};
|
|
301
307
|
}, import("./agent").IAgentInfo | {
|
|
302
308
|
agentName?: string;
|
|
@@ -339,6 +345,9 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
339
345
|
id: string;
|
|
340
346
|
name: string;
|
|
341
347
|
status: string;
|
|
348
|
+
supportUpload?: {
|
|
349
|
+
vision: boolean;
|
|
350
|
+
};
|
|
342
351
|
}[];
|
|
343
352
|
enableChatSession?: boolean;
|
|
344
353
|
openingRemark?: string;
|
|
@@ -584,6 +593,9 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
584
593
|
sessionCode?: string;
|
|
585
594
|
status: import("./message").MessageStatus;
|
|
586
595
|
})[];
|
|
596
|
+
supportUpload?: {
|
|
597
|
+
vision: boolean;
|
|
598
|
+
};
|
|
587
599
|
};
|
|
588
600
|
}>;
|
|
589
601
|
isInfoLoading: import("vue").Ref<boolean, boolean>;
|