@blueking/chat-helper 0.0.5 → 0.0.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.
- package/dist/agent/type.d.ts +16 -0
- package/dist/agent/use-agent.d.ts +14 -0
- package/dist/http/fetch/index.ts.js +2 -2
- package/dist/http/transform/agent.ts.js +8 -1
- package/dist/http/transform/session.ts.js +6 -6
- package/dist/index.d.ts +18 -4
- package/dist/session/type.d.ts +2 -2
- package/dist/session/use-session.d.ts +4 -4
- package/package.json +1 -1
package/dist/agent/type.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export interface IAgentCommandComponentApi {
|
|
|
58
58
|
}
|
|
59
59
|
export interface IAgentInfo {
|
|
60
60
|
agentName?: string;
|
|
61
|
+
relatedSkills?: IRelatedSkill[];
|
|
61
62
|
resources?: IAgentResourceItem[];
|
|
62
63
|
saasUrl?: string;
|
|
63
64
|
chatGroup?: {
|
|
@@ -78,6 +79,7 @@ export interface IAgentInfo {
|
|
|
78
79
|
}
|
|
79
80
|
export interface IAgentInfoApi {
|
|
80
81
|
agent_name: string;
|
|
82
|
+
related_skills?: IRelatedSkillApi[];
|
|
81
83
|
resources?: IAgentResourceItem[];
|
|
82
84
|
saas_url?: string;
|
|
83
85
|
chat_group?: {
|
|
@@ -103,6 +105,20 @@ export interface IAgentResourceItem {
|
|
|
103
105
|
name: string;
|
|
104
106
|
type: string;
|
|
105
107
|
}
|
|
108
|
+
export interface IRelatedSkill {
|
|
109
|
+
description: string;
|
|
110
|
+
icon: string;
|
|
111
|
+
id: number;
|
|
112
|
+
skill_code: string;
|
|
113
|
+
skill_name: string;
|
|
114
|
+
}
|
|
115
|
+
export interface IRelatedSkillApi {
|
|
116
|
+
description: string;
|
|
117
|
+
icon: string;
|
|
118
|
+
id: number;
|
|
119
|
+
skill_code: string;
|
|
120
|
+
skill_name: string;
|
|
121
|
+
}
|
|
106
122
|
/** @deprecated 后端已改为扁平列表 IAgentResourceItem[],不再使用分组结构 */
|
|
107
123
|
export interface IAgentResources {
|
|
108
124
|
command?: IAgentResourceItem[];
|
|
@@ -11,6 +11,13 @@ import type { IAgentInfo } from './type';
|
|
|
11
11
|
export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtocol) => {
|
|
12
12
|
info: import("vue").Ref<{
|
|
13
13
|
agentName?: string;
|
|
14
|
+
relatedSkills?: {
|
|
15
|
+
description: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
id: number;
|
|
18
|
+
skill_code: string;
|
|
19
|
+
skill_name: string;
|
|
20
|
+
}[];
|
|
14
21
|
resources?: {
|
|
15
22
|
code: string;
|
|
16
23
|
icon: null | string;
|
|
@@ -310,6 +317,13 @@ export declare const useAgent: (mediator: IMediatorModule, protocol: ISSEProtoco
|
|
|
310
317
|
};
|
|
311
318
|
}, IAgentInfo | {
|
|
312
319
|
agentName?: string;
|
|
320
|
+
relatedSkills?: {
|
|
321
|
+
description: string;
|
|
322
|
+
icon: string;
|
|
323
|
+
id: number;
|
|
324
|
+
skill_code: string;
|
|
325
|
+
skill_name: string;
|
|
326
|
+
}[];
|
|
313
327
|
resources?: {
|
|
314
328
|
code: string;
|
|
315
329
|
icon: null | string;
|
|
@@ -104,6 +104,8 @@ export { resolveRequestValue } from './resolve-request-value.ts.js';
|
|
|
104
104
|
if (!extraHeadersFn && !extraDataFn) return;
|
|
105
105
|
client.interceptors.request.use((config)=>{
|
|
106
106
|
let result = config;
|
|
107
|
+
var _config_method;
|
|
108
|
+
const method = ((_config_method = config.method) !== null && _config_method !== void 0 ? _config_method : 'GET').toUpperCase();
|
|
107
109
|
if (extraHeadersFn) {
|
|
108
110
|
const extra = resolveRequestValue(extraHeadersFn);
|
|
109
111
|
if (extra && Object.keys(extra).length > 0) {
|
|
@@ -114,8 +116,6 @@ export { resolveRequestValue } from './resolve-request-value.ts.js';
|
|
|
114
116
|
});
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
|
-
var _config_method;
|
|
118
|
-
const method = ((_config_method = config.method) !== null && _config_method !== void 0 ? _config_method : 'GET').toUpperCase();
|
|
119
119
|
if (extraDataFn) {
|
|
120
120
|
const extra = resolveRequestValue(extraDataFn);
|
|
121
121
|
if (extra && Object.keys(extra).length > 0) {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @param data API 返回的 agent 信息数据
|
|
28
28
|
* @returns 前端使用的 agent 信息数据
|
|
29
29
|
*/ export const transferAgentInfoApi2AgentInfo = (data)=>{
|
|
30
|
-
var _data_conversation_settings, _data_conversation_settings1, _data_conversation_settings_commands, _data_conversation_settings2, _data_conversation_settings3;
|
|
30
|
+
var _data_conversation_settings, _data_conversation_settings1, _data_conversation_settings_commands, _data_conversation_settings2, _data_conversation_settings3, _data_related_skills;
|
|
31
31
|
return {
|
|
32
32
|
conversationSettings: {
|
|
33
33
|
openingRemark: data === null || data === void 0 ? void 0 : (_data_conversation_settings = data.conversation_settings) === null || _data_conversation_settings === void 0 ? void 0 : _data_conversation_settings.opening_remark,
|
|
@@ -63,6 +63,13 @@
|
|
|
63
63
|
supportUpload: data.prompt_setting.support_upload
|
|
64
64
|
} : undefined,
|
|
65
65
|
agentName: data === null || data === void 0 ? void 0 : data.agent_name,
|
|
66
|
+
relatedSkills: data === null || data === void 0 ? void 0 : (_data_related_skills = data.related_skills) === null || _data_related_skills === void 0 ? void 0 : _data_related_skills.map((skill)=>({
|
|
67
|
+
id: skill.id,
|
|
68
|
+
skill_name: skill.skill_name,
|
|
69
|
+
skill_code: skill.skill_code,
|
|
70
|
+
description: skill.description,
|
|
71
|
+
icon: skill.icon
|
|
72
|
+
})),
|
|
66
73
|
chatGroup: (data === null || data === void 0 ? void 0 : data.chat_group) ? {
|
|
67
74
|
enabled: data.chat_group.enabled,
|
|
68
75
|
staff: data.chat_group.staff,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @param data API 返回的 session 数据
|
|
28
28
|
* @returns 前端使用的 session 数据
|
|
29
29
|
*/ export const transferSessionApi2Session = (data)=>{
|
|
30
|
-
var _data_session_property, _data_session_property1;
|
|
30
|
+
var _data_session_property, _data_session_property1, _data_session_property2;
|
|
31
31
|
return {
|
|
32
32
|
sessionCode: data.session_code,
|
|
33
33
|
sessionContentCount: data.session_content_count,
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
isTemporary: data.is_temporary,
|
|
36
36
|
model: data.model,
|
|
37
37
|
comment: data.comment,
|
|
38
|
-
labels: data.labels,
|
|
39
38
|
rate: data.rate,
|
|
40
39
|
updatedAt: data.updated_at,
|
|
41
40
|
createdAt: data.created_at,
|
|
@@ -47,7 +46,8 @@
|
|
|
47
46
|
} : undefined,
|
|
48
47
|
sessionProperty: {
|
|
49
48
|
isAutoClear: (_data_session_property = data.session_property) === null || _data_session_property === void 0 ? void 0 : _data_session_property.is_auto_clear,
|
|
50
|
-
isAutoCalcPrompt: (_data_session_property1 = data.session_property) === null || _data_session_property1 === void 0 ? void 0 : _data_session_property1.is_auto_clac_prompt
|
|
49
|
+
isAutoCalcPrompt: (_data_session_property1 = data.session_property) === null || _data_session_property1 === void 0 ? void 0 : _data_session_property1.is_auto_clac_prompt,
|
|
50
|
+
labels: (_data_session_property2 = data.session_property) === null || _data_session_property2 === void 0 ? void 0 : _data_session_property2.labels
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
};
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
* @param data 前端使用的 session 数据
|
|
57
57
|
* @returns API 使用的 session 数据
|
|
58
58
|
*/ export const transferSession2SessionApi = (data)=>{
|
|
59
|
-
var _data_sessionProperty, _data_sessionProperty1;
|
|
59
|
+
var _data_sessionProperty, _data_sessionProperty1, _data_sessionProperty2;
|
|
60
60
|
return {
|
|
61
61
|
session_code: data.sessionCode,
|
|
62
62
|
session_content_count: data.sessionContentCount,
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
is_temporary: data.isTemporary,
|
|
65
65
|
model: data.model,
|
|
66
66
|
comment: data.comment,
|
|
67
|
-
labels: data.labels,
|
|
68
67
|
rate: data.rate,
|
|
69
68
|
updated_at: data.updatedAt,
|
|
70
69
|
created_at: data.createdAt,
|
|
@@ -76,7 +75,8 @@
|
|
|
76
75
|
} : undefined,
|
|
77
76
|
session_property: {
|
|
78
77
|
is_auto_clear: (_data_sessionProperty = data.sessionProperty) === null || _data_sessionProperty === void 0 ? void 0 : _data_sessionProperty.isAutoClear,
|
|
79
|
-
is_auto_clac_prompt: (_data_sessionProperty1 = data.sessionProperty) === null || _data_sessionProperty1 === void 0 ? void 0 : _data_sessionProperty1.isAutoCalcPrompt
|
|
78
|
+
is_auto_clac_prompt: (_data_sessionProperty1 = data.sessionProperty) === null || _data_sessionProperty1 === void 0 ? void 0 : _data_sessionProperty1.isAutoCalcPrompt,
|
|
79
|
+
labels: (_data_sessionProperty2 = data.sessionProperty) === null || _data_sessionProperty2 === void 0 ? void 0 : _data_sessionProperty2.labels
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
14
14
|
agent: {
|
|
15
15
|
info: import("vue").Ref<{
|
|
16
16
|
agentName?: string;
|
|
17
|
+
relatedSkills?: {
|
|
18
|
+
description: string;
|
|
19
|
+
icon: string;
|
|
20
|
+
id: number;
|
|
21
|
+
skill_code: string;
|
|
22
|
+
skill_name: string;
|
|
23
|
+
}[];
|
|
17
24
|
resources?: {
|
|
18
25
|
code: string;
|
|
19
26
|
icon: null | string;
|
|
@@ -313,6 +320,13 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
313
320
|
};
|
|
314
321
|
}, import("./agent").IAgentInfo | {
|
|
315
322
|
agentName?: string;
|
|
323
|
+
relatedSkills?: {
|
|
324
|
+
description: string;
|
|
325
|
+
icon: string;
|
|
326
|
+
id: number;
|
|
327
|
+
skill_code: string;
|
|
328
|
+
skill_name: string;
|
|
329
|
+
}[];
|
|
316
330
|
resources?: {
|
|
317
331
|
code: string;
|
|
318
332
|
icon: null | string;
|
|
@@ -628,7 +642,6 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
628
642
|
comment?: string;
|
|
629
643
|
createdAt?: string;
|
|
630
644
|
isTemporary?: boolean;
|
|
631
|
-
labels?: string[];
|
|
632
645
|
model?: string;
|
|
633
646
|
rate?: number;
|
|
634
647
|
sessionCode: string;
|
|
@@ -1136,13 +1149,13 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1136
1149
|
sessionProperty?: {
|
|
1137
1150
|
isAutoCalcPrompt?: boolean;
|
|
1138
1151
|
isAutoClear?: boolean;
|
|
1152
|
+
labels?: string[];
|
|
1139
1153
|
};
|
|
1140
1154
|
}[], import("./session").ISession<unknown, unknown>[] | {
|
|
1141
1155
|
anchorPathResources?: unknown;
|
|
1142
1156
|
comment?: string;
|
|
1143
1157
|
createdAt?: string;
|
|
1144
1158
|
isTemporary?: boolean;
|
|
1145
|
-
labels?: string[];
|
|
1146
1159
|
model?: string;
|
|
1147
1160
|
rate?: number;
|
|
1148
1161
|
sessionCode: string;
|
|
@@ -1650,6 +1663,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1650
1663
|
sessionProperty?: {
|
|
1651
1664
|
isAutoCalcPrompt?: boolean;
|
|
1652
1665
|
isAutoClear?: boolean;
|
|
1666
|
+
labels?: string[];
|
|
1653
1667
|
};
|
|
1654
1668
|
}[]>;
|
|
1655
1669
|
current: import("vue").Ref<{
|
|
@@ -1657,7 +1671,6 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
1657
1671
|
comment?: string;
|
|
1658
1672
|
createdAt?: string;
|
|
1659
1673
|
isTemporary?: boolean;
|
|
1660
|
-
labels?: string[];
|
|
1661
1674
|
model?: string;
|
|
1662
1675
|
rate?: number;
|
|
1663
1676
|
sessionCode: string;
|
|
@@ -2165,13 +2178,13 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2165
2178
|
sessionProperty?: {
|
|
2166
2179
|
isAutoCalcPrompt?: boolean;
|
|
2167
2180
|
isAutoClear?: boolean;
|
|
2181
|
+
labels?: string[];
|
|
2168
2182
|
};
|
|
2169
2183
|
}, import("./session").ISession<unknown, unknown> | {
|
|
2170
2184
|
anchorPathResources?: unknown;
|
|
2171
2185
|
comment?: string;
|
|
2172
2186
|
createdAt?: string;
|
|
2173
2187
|
isTemporary?: boolean;
|
|
2174
|
-
labels?: string[];
|
|
2175
2188
|
model?: string;
|
|
2176
2189
|
rate?: number;
|
|
2177
2190
|
sessionCode: string;
|
|
@@ -2679,6 +2692,7 @@ export declare const useChatHelper: (options: IUseChatHelperOptions) => {
|
|
|
2679
2692
|
sessionProperty?: {
|
|
2680
2693
|
isAutoCalcPrompt?: boolean;
|
|
2681
2694
|
isAutoClear?: boolean;
|
|
2695
|
+
labels?: string[];
|
|
2682
2696
|
};
|
|
2683
2697
|
}>;
|
|
2684
2698
|
isCurrentLoading: import("vue").Ref<boolean, boolean>;
|
package/dist/session/type.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export interface ISession<ITool = unknown, IAnchorPathResources = unknown> {
|
|
|
4
4
|
comment?: string;
|
|
5
5
|
createdAt?: string;
|
|
6
6
|
isTemporary?: boolean;
|
|
7
|
-
labels?: string[];
|
|
8
7
|
model?: string;
|
|
9
8
|
rate?: number;
|
|
10
9
|
sessionCode: string;
|
|
@@ -25,6 +24,7 @@ export interface ISession<ITool = unknown, IAnchorPathResources = unknown> {
|
|
|
25
24
|
sessionProperty?: {
|
|
26
25
|
isAutoCalcPrompt?: boolean;
|
|
27
26
|
isAutoClear?: boolean;
|
|
27
|
+
labels?: string[];
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export interface ISessionApi<IToolApi = unknown, IAnchorPathResourcesApi = unknown> {
|
|
@@ -32,7 +32,6 @@ export interface ISessionApi<IToolApi = unknown, IAnchorPathResourcesApi = unkno
|
|
|
32
32
|
comment?: string;
|
|
33
33
|
created_at?: string;
|
|
34
34
|
is_temporary?: boolean;
|
|
35
|
-
labels?: string[];
|
|
36
35
|
model?: string;
|
|
37
36
|
rate?: number;
|
|
38
37
|
session_code: string;
|
|
@@ -53,6 +52,7 @@ export interface ISessionApi<IToolApi = unknown, IAnchorPathResourcesApi = unkno
|
|
|
53
52
|
session_property?: {
|
|
54
53
|
is_auto_clac_prompt?: boolean;
|
|
55
54
|
is_auto_clear?: boolean;
|
|
55
|
+
labels?: string[];
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
export interface ISessionFeedback {
|
|
@@ -11,7 +11,6 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
11
11
|
comment?: string;
|
|
12
12
|
createdAt?: string;
|
|
13
13
|
isTemporary?: boolean;
|
|
14
|
-
labels?: string[];
|
|
15
14
|
model?: string;
|
|
16
15
|
rate?: number;
|
|
17
16
|
sessionCode: string;
|
|
@@ -519,13 +518,13 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
519
518
|
sessionProperty?: {
|
|
520
519
|
isAutoCalcPrompt?: boolean;
|
|
521
520
|
isAutoClear?: boolean;
|
|
521
|
+
labels?: string[];
|
|
522
522
|
};
|
|
523
523
|
}[], ISession<unknown, unknown>[] | {
|
|
524
524
|
anchorPathResources?: unknown;
|
|
525
525
|
comment?: string;
|
|
526
526
|
createdAt?: string;
|
|
527
527
|
isTemporary?: boolean;
|
|
528
|
-
labels?: string[];
|
|
529
528
|
model?: string;
|
|
530
529
|
rate?: number;
|
|
531
530
|
sessionCode: string;
|
|
@@ -1033,6 +1032,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1033
1032
|
sessionProperty?: {
|
|
1034
1033
|
isAutoCalcPrompt?: boolean;
|
|
1035
1034
|
isAutoClear?: boolean;
|
|
1035
|
+
labels?: string[];
|
|
1036
1036
|
};
|
|
1037
1037
|
}[]>;
|
|
1038
1038
|
current: import("vue").Ref<{
|
|
@@ -1040,7 +1040,6 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1040
1040
|
comment?: string;
|
|
1041
1041
|
createdAt?: string;
|
|
1042
1042
|
isTemporary?: boolean;
|
|
1043
|
-
labels?: string[];
|
|
1044
1043
|
model?: string;
|
|
1045
1044
|
rate?: number;
|
|
1046
1045
|
sessionCode: string;
|
|
@@ -1548,13 +1547,13 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
1548
1547
|
sessionProperty?: {
|
|
1549
1548
|
isAutoCalcPrompt?: boolean;
|
|
1550
1549
|
isAutoClear?: boolean;
|
|
1550
|
+
labels?: string[];
|
|
1551
1551
|
};
|
|
1552
1552
|
}, ISession<unknown, unknown> | {
|
|
1553
1553
|
anchorPathResources?: unknown;
|
|
1554
1554
|
comment?: string;
|
|
1555
1555
|
createdAt?: string;
|
|
1556
1556
|
isTemporary?: boolean;
|
|
1557
|
-
labels?: string[];
|
|
1558
1557
|
model?: string;
|
|
1559
1558
|
rate?: number;
|
|
1560
1559
|
sessionCode: string;
|
|
@@ -2062,6 +2061,7 @@ export declare const useSession: (mediator: IMediatorModule) => {
|
|
|
2062
2061
|
sessionProperty?: {
|
|
2063
2062
|
isAutoCalcPrompt?: boolean;
|
|
2064
2063
|
isAutoClear?: boolean;
|
|
2064
|
+
labels?: string[];
|
|
2065
2065
|
};
|
|
2066
2066
|
}>;
|
|
2067
2067
|
isCurrentLoading: import("vue").Ref<boolean, boolean>;
|