@blueking/ai-ui-sdk 0.1.2-beta.1 → 0.1.2-beta.3
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/components/render-aside/index.vue.css +9 -9
- package/dist/components/render-aside/index.vue.js +1 -1
- package/dist/components/render-auto-height-textarea/index.vue.css +11 -11
- package/dist/components/render-auto-height-textarea/index.vue.js +1 -1
- package/dist/components/render-collapse/index.vue.css +2 -2
- package/dist/components/render-collapse/index.vue.js +1 -1
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.css +3 -3
- package/dist/components/render-dataset/components/edit-dataset-data/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/index.vue.css +4 -4
- package/dist/components/render-dataset/components/operation-record/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.css +1 -1
- package/dist/components/render-dataset/components/operation-record/table/index.vue.js +1 -1
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.css +2 -2
- package/dist/components/render-dataset/components/operation-record/view-op-result/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset/dataset-form.script.vue.js +3 -3
- package/dist/components/render-dataset/components/plus-dataset/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.css +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/footer.vue.js +1 -1
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.css +2 -2
- package/dist/components/render-dataset/components/plus-dataset-data/form/index.vue.js +1 -1
- package/dist/components/render-dataset/components/source-type-icon/index.vue.css +3 -3
- package/dist/components/render-dataset/components/source-type-icon/index.vue.js +1 -1
- package/dist/components/render-dataset/index.vue.css +1 -1
- package/dist/components/render-dataset/index.vue.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.css +1 -1
- package/dist/components/render-dataset-detail-origin-data/components/table/index.vue.js +1 -1
- package/dist/components/render-dataset-detail-origin-data/index.vue.css +3 -3
- package/dist/components/render-dataset-detail-origin-data/index.vue.js +1 -1
- package/dist/components/render-dataset-list/components/main.vue.css +3 -3
- package/dist/components/render-dataset-list/components/main.vue.js +1 -1
- package/dist/components/render-dataset-list/components/table.script.vue.js.js +1 -1
- package/dist/components/render-expand-collapse/index.vue.css +3 -3
- package/dist/components/render-expand-collapse/index.vue.js +1 -1
- package/dist/components/render-file-card/index.vue.css +11 -11
- package/dist/components/render-file-card/index.vue.js +1 -1
- package/dist/components/render-file-type-icon/index.vue.css +5 -5
- package/dist/components/render-file-type-icon/index.vue.js +1 -1
- package/dist/components/render-header/index.vue.css +5 -5
- package/dist/components/render-header/index.vue.js +1 -1
- package/dist/components/render-router-tab/index.vue.css +3 -3
- package/dist/components/render-router-tab/index.vue.js +1 -1
- package/dist/hooks/use-chat.d.ts +2 -2
- package/dist/hooks/use-chat.ts.js +71 -45
- package/dist/hooks/use-dataset-http.d.ts +1 -1
- package/dist/hooks/use-dataset-http.ts.js +60 -19
- package/dist/hooks/use-session-http.d.ts +1 -1
- package/dist/hooks/use-session-http.ts.js +37 -11
- package/dist/http/helper/agent.ts.js +4 -1
- package/dist/http/helper/dataset.ts.js +2 -6
- package/dist/http/helper/session.d.ts +10 -0
- package/dist/http/helper/session.ts.js +33 -3
- package/dist/types/agent.d.ts +7 -0
- package/package.json +1 -1
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
|
-
.router-tab[data-v-
|
2
|
+
.router-tab[data-v-zqfysrnk] {
|
3
3
|
margin-top: 2px;
|
4
4
|
height: 42px;
|
5
5
|
background: #FFFFFF;
|
6
6
|
box-shadow: 0 2px 4px 0 #1919290d;
|
7
7
|
padding: 0 45px;
|
8
8
|
}
|
9
|
-
.router-tab a[data-v-
|
9
|
+
.router-tab a[data-v-zqfysrnk] {
|
10
10
|
padding: 0 8px;
|
11
11
|
margin-right: 24px;
|
12
12
|
font-size: 14px;
|
@@ -15,7 +15,7 @@
|
|
15
15
|
color: #4D4F56;
|
16
16
|
box-sizing: border-box;
|
17
17
|
}
|
18
|
-
.router-tab a.router-link-exact-active[data-v-
|
18
|
+
.router-tab a.router-link-exact-active[data-v-zqfysrnk] {
|
19
19
|
color: #3A84FF;
|
20
20
|
border-bottom: 2px solid #3A84FF;
|
21
21
|
}
|
package/dist/hooks/use-chat.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { SessionContentRole, SessionContentStatus } from '../types/enum';
|
2
|
-
import type {
|
2
|
+
import type { ChatCallbacks, ISession, ISessionContent, ISessionPrompt } from '../types/session';
|
3
3
|
type SessionContentsMap = {
|
4
4
|
[key: string]: ISessionContent[];
|
5
5
|
};
|
@@ -833,7 +833,6 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
833
833
|
data?: Record<string, any>;
|
834
834
|
headers?: Record<string, string>;
|
835
835
|
}) => void;
|
836
|
-
sendChat: (content: BasicChatContent | ShortcutChatContent, callback?: () => void) => void;
|
837
836
|
stopChat: (sessionCode: string) => void;
|
838
837
|
plusSessionContent: (sessionCode: string, sessionContent: ISessionContent) => Promise<ISessionContent>;
|
839
838
|
updateSessionContent: (sessionContent: ISessionContent) => boolean;
|
@@ -846,6 +845,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
|
|
846
845
|
deleteSessionContents: (sessionCode: string, contentIds: number[]) => Promise<number>;
|
847
846
|
handleStartChat: (sessionCode: string) => Promise<void>;
|
848
847
|
handleErrorChat: (sessionCode: string, message: string, code?: string) => Promise<void>;
|
848
|
+
handleCompleteRole: (sessionCode: string, prompts: ISessionPrompt[]) => Promise<void>;
|
849
849
|
reGenerateChat: (sessionCode: string, sessionContent: ISessionContent, sessionIndex: number) => void;
|
850
850
|
reSendChat: (sessionCode: string, sessionContent: ISessionContent, sessionIndex: number) => Promise<void>;
|
851
851
|
deleteChat: (index: number, sessionCode: string) => void;
|
@@ -55,27 +55,51 @@ function _object_spread(target) {
|
|
55
55
|
}
|
56
56
|
return target;
|
57
57
|
}
|
58
|
+
function ownKeys(object, enumerableOnly) {
|
59
|
+
var keys = Object.keys(object);
|
60
|
+
if (Object.getOwnPropertySymbols) {
|
61
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
62
|
+
if (enumerableOnly) {
|
63
|
+
symbols = symbols.filter(function(sym) {
|
64
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
65
|
+
});
|
66
|
+
}
|
67
|
+
keys.push.apply(keys, symbols);
|
68
|
+
}
|
69
|
+
return keys;
|
70
|
+
}
|
71
|
+
function _object_spread_props(target, source) {
|
72
|
+
source = source != null ? source : {};
|
73
|
+
if (Object.getOwnPropertyDescriptors) {
|
74
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
75
|
+
} else {
|
76
|
+
ownKeys(Object(source)).forEach(function(key) {
|
77
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
78
|
+
});
|
79
|
+
}
|
80
|
+
return target;
|
81
|
+
}
|
58
82
|
import { computed, ref } from 'vue';
|
59
83
|
import { ChatHelper } from '../common/chart-helper.ts.js';
|
60
|
-
import {
|
84
|
+
import { throttle } from '../common/util.ts.js';
|
61
85
|
import { getHtmlContentFromDocuments, removeReferenceDoc } from './use-reference-doc.ts.js';
|
62
86
|
import { useSessionHttp } from './use-session-http.ts.js';
|
63
87
|
import { getHtmlContentFromThink, isThinking, removeThink } from './use-think.ts.js';
|
64
|
-
import { transferSessionContent2SessionPrompt } from '../http/helper/session.ts.js';
|
88
|
+
import { transferSessionContent2SessionPrompt, transferSessionPrompt2SessionContent } from '../http/helper/session.ts.js';
|
65
89
|
import { HttpErrorCode, SessionContentRole, SessionContentStatus } from '../types/enum.ts.js';
|
66
90
|
// ai 聊天
|
67
91
|
export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions })=>{
|
68
92
|
// 用 ref 存储 requestOptions,使其可更新
|
69
93
|
const currentRequestOptions = ref(requestOptions);
|
70
94
|
// 创建一个变量保存当前的API实现
|
71
|
-
let apiImpl = useSessionHttp(currentRequestOptions.value.url);
|
95
|
+
let apiImpl = useSessionHttp(currentRequestOptions.value.url, currentRequestOptions.value.headers);
|
72
96
|
// 更新 requestOptions 的方法
|
73
97
|
function updateRequestOptions(newOptions) {
|
74
98
|
// 合并新旧配置
|
75
99
|
currentRequestOptions.value = _object_spread({}, currentRequestOptions.value, newOptions);
|
76
100
|
// 如果 URL 变更,重新获取 API
|
77
101
|
if (newOptions.url) {
|
78
|
-
apiImpl = useSessionHttp(currentRequestOptions.value.url);
|
102
|
+
apiImpl = useSessionHttp(currentRequestOptions.value.url, currentRequestOptions.value.headers);
|
79
103
|
}
|
80
104
|
}
|
81
105
|
const startMessage = '内容正在生成中...';
|
@@ -84,6 +108,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
84
108
|
const sessionLoadingMap = ref({});
|
85
109
|
const sessionContents = ref([]);
|
86
110
|
const sessionContentsMap = {};
|
111
|
+
const sessionWaitingPromptsMap = {};
|
87
112
|
// 通过计算得到的会话列表
|
88
113
|
const calculatedSessionContents = computed(()=>{
|
89
114
|
const calculatedSessionContents = [];
|
@@ -348,7 +373,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
348
373
|
const content = getHtmlContentFromDocuments(documents);
|
349
374
|
sessionContent.content = cover ? content : sessionContent.content + content;
|
350
375
|
yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
|
351
|
-
|
376
|
+
yield handleReferenceDoc === null || handleReferenceDoc === void 0 ? void 0 : handleReferenceDoc(sessionCode, sessionContent);
|
352
377
|
});
|
353
378
|
return _handleReferenceDocChat.apply(this, arguments);
|
354
379
|
}
|
@@ -364,7 +389,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
364
389
|
// 更新 db
|
365
390
|
yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
|
366
391
|
// 调用cb
|
367
|
-
|
392
|
+
yield handleThink === null || handleThink === void 0 ? void 0 : handleThink(sessionCode, sessionContent);
|
368
393
|
});
|
369
394
|
return _handleThinkChat.apply(this, arguments);
|
370
395
|
}
|
@@ -385,7 +410,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
385
410
|
// 更新 db
|
386
411
|
yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
|
387
412
|
// 调用cb
|
388
|
-
|
413
|
+
yield handleText === null || handleText === void 0 ? void 0 : handleText(sessionCode, sessionContent);
|
389
414
|
});
|
390
415
|
return _handleTextChat.apply(this, arguments);
|
391
416
|
}
|
@@ -413,7 +438,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
413
438
|
// 更新 db
|
414
439
|
yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
|
415
440
|
// 调用cb
|
416
|
-
|
441
|
+
yield handleEnd === null || handleEnd === void 0 ? void 0 : handleEnd(sessionCode, sessionContent);
|
417
442
|
}
|
418
443
|
});
|
419
444
|
return _handleEndChat.apply(this, arguments);
|
@@ -435,7 +460,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
435
460
|
sessionContent.role = SessionContentRole.TokenExpired;
|
436
461
|
if ((_currentSession_value = currentSession.value) === null || _currentSession_value === void 0 ? void 0 : (_currentSession_value_sessionProperty = _currentSession_value.sessionProperty) === null || _currentSession_value_sessionProperty === void 0 ? void 0 : _currentSession_value_sessionProperty.isAutoClear) {
|
437
462
|
var _currentSession_value1;
|
438
|
-
yield
|
463
|
+
yield plusSessionContent(sessionCode, {
|
439
464
|
sessionCode,
|
440
465
|
role: SessionContentRole.System,
|
441
466
|
content: '由于Token超限,已自动清理会话,后续会话不会携带先前的会话信息'
|
@@ -450,10 +475,36 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
450
475
|
// 更新 db
|
451
476
|
yield throttleModifySessionContentApi(sessionContent.id, sessionContent);
|
452
477
|
// 调用cb
|
453
|
-
|
478
|
+
yield handleError === null || handleError === void 0 ? void 0 : handleError(sessionCode, sessionContent, code);
|
454
479
|
});
|
455
480
|
return _handleErrorChat.apply(this, arguments);
|
456
481
|
}
|
482
|
+
function handleCompleteRole(sessionCode, prompts) {
|
483
|
+
return _handleCompleteRole.apply(this, arguments);
|
484
|
+
}
|
485
|
+
function _handleCompleteRole() {
|
486
|
+
_handleCompleteRole = // 完成角色演绎
|
487
|
+
_async_to_generator(function*(sessionCode, prompts) {
|
488
|
+
let isPaused = false;
|
489
|
+
sessionWaitingPromptsMap[sessionCode] = [];
|
490
|
+
for (const prompt of prompts){
|
491
|
+
if (isPaused) {
|
492
|
+
sessionWaitingPromptsMap[sessionCode].push(prompt);
|
493
|
+
} else {
|
494
|
+
const sessionContent = _object_spread_props(_object_spread({}, transferSessionPrompt2SessionContent(prompt)), {
|
495
|
+
sessionCode,
|
496
|
+
status: SessionContentStatus.Success
|
497
|
+
});
|
498
|
+
yield plusSessionContent(sessionCode, sessionContent);
|
499
|
+
// 遇到 pause 就暂停
|
500
|
+
if (sessionContent.role === SessionContentRole.Pause) {
|
501
|
+
isPaused = true;
|
502
|
+
}
|
503
|
+
}
|
504
|
+
}
|
505
|
+
});
|
506
|
+
return _handleCompleteRole.apply(this, arguments);
|
507
|
+
}
|
457
508
|
// 重新生成对话 仅支持重新生成 ai 的回复
|
458
509
|
function reGenerateChat(sessionCode, sessionContent, sessionIndex) {
|
459
510
|
if (sessionContent.role !== SessionContentRole.Ai) {
|
@@ -469,6 +520,15 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
469
520
|
}
|
470
521
|
// 聊天
|
471
522
|
function chat({ sessionCode, url, data, headers }) {
|
523
|
+
const sessionWaitingPrompts = sessionWaitingPromptsMap[sessionCode];
|
524
|
+
if ((sessionWaitingPrompts === null || sessionWaitingPrompts === void 0 ? void 0 : sessionWaitingPrompts.length) > 0) {
|
525
|
+
handleCompleteRole(sessionCode, sessionWaitingPrompts);
|
526
|
+
} else {
|
527
|
+
streamChat(sessionCode, data, url, headers);
|
528
|
+
}
|
529
|
+
}
|
530
|
+
// stream 聊天
|
531
|
+
function streamChat(sessionCode, data, url, headers) {
|
472
532
|
var _currentRequestOptions_value;
|
473
533
|
const sessionContent = getLastSessionContentBySessionCode(sessionCode);
|
474
534
|
// 发送请求
|
@@ -513,40 +573,6 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
513
573
|
});
|
514
574
|
return _reSendChat.apply(this, arguments);
|
515
575
|
}
|
516
|
-
// 发送聊天
|
517
|
-
function sendChat(content, callback) {
|
518
|
-
var _currentSession_value, _currentRequestOptions_value, _currentSession_value1, _currentSession_value2, _currentRequestOptions_value1;
|
519
|
-
if (!((_currentSession_value = currentSession.value) === null || _currentSession_value === void 0 ? void 0 : _currentSession_value.sessionCode) || !((_currentRequestOptions_value = currentRequestOptions.value) === null || _currentRequestOptions_value === void 0 ? void 0 : _currentRequestOptions_value.url) || currentSessionLoading.value) {
|
520
|
-
return;
|
521
|
-
}
|
522
|
-
const { message, cite, shortcut } = content;
|
523
|
-
let input = '';
|
524
|
-
if (shortcut) {
|
525
|
-
input = processPromptTemplate(shortcut.prompt, cite);
|
526
|
-
} else {
|
527
|
-
input = cite ? `${message}: "${cite}"` : message;
|
528
|
-
}
|
529
|
-
sessionContents.value.push({
|
530
|
-
sessionCode: (_currentSession_value1 = currentSession.value) === null || _currentSession_value1 === void 0 ? void 0 : _currentSession_value1.sessionCode,
|
531
|
-
content: message,
|
532
|
-
role: SessionContentRole.User,
|
533
|
-
status: SessionContentStatus.Success,
|
534
|
-
cite
|
535
|
-
});
|
536
|
-
// 发送请求
|
537
|
-
chatHelper.stream({
|
538
|
-
sessionCode: (_currentSession_value2 = currentSession.value) === null || _currentSession_value2 === void 0 ? void 0 : _currentSession_value2.sessionCode,
|
539
|
-
url: currentRequestOptions.value.url,
|
540
|
-
headers: (_currentRequestOptions_value1 = currentRequestOptions.value) === null || _currentRequestOptions_value1 === void 0 ? void 0 : _currentRequestOptions_value1.headers,
|
541
|
-
data: {
|
542
|
-
inputs: {
|
543
|
-
chat_history: prompts.value.slice(0, prompts.value.length - 1),
|
544
|
-
input
|
545
|
-
}
|
546
|
-
}
|
547
|
-
});
|
548
|
-
callback === null || callback === void 0 ? void 0 : callback();
|
549
|
-
}
|
550
576
|
/**
|
551
577
|
* 删除聊天内容
|
552
578
|
* @param index 要删除的聊天内容索引
|
@@ -577,7 +603,6 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
577
603
|
prompts,
|
578
604
|
currentSessionLoading,
|
579
605
|
chat,
|
580
|
-
sendChat,
|
581
606
|
stopChat,
|
582
607
|
plusSessionContent,
|
583
608
|
updateSessionContent,
|
@@ -590,6 +615,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
|
|
590
615
|
deleteSessionContents,
|
591
616
|
handleStartChat,
|
592
617
|
handleErrorChat,
|
618
|
+
handleCompleteRole,
|
593
619
|
reGenerateChat,
|
594
620
|
reSendChat,
|
595
621
|
deleteChat,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { IComponent, IDatasetApi, IDatasetDataApi, IDatasetDataForm, IDatasetDataParam, IDatasetForm, IDatasetInfo, IDatasetListParam, IOperatRecordParam, ISchema, IUserInfoForm } from '@/types/dataset';
|
2
|
-
export declare const useDatasetHttp: (apiPrefix?: string) => {
|
2
|
+
export declare const useDatasetHttp: (apiPrefix?: string, headers?: Record<string, string>) => {
|
3
3
|
getCompanyList: () => Promise<import("@/types/dataset").ICompany[]>;
|
4
4
|
getDatasetMineInfo: () => Promise<IDatasetInfo>;
|
5
5
|
getComponentList: () => Promise<IComponent[]>;
|
@@ -3,62 +3,100 @@ import { transferCompanyApi2Company, transferCompanyParticipantApi2CompanyPartic
|
|
3
3
|
const datasetPerfix = 'dataset/v1';
|
4
4
|
const metaPerfix = 'meta/v1';
|
5
5
|
// 数据集相关接口
|
6
|
-
export const useDatasetHttp = (apiPrefix)=>{
|
6
|
+
export const useDatasetHttp = (apiPrefix, headers)=>{
|
7
7
|
// meta相关接口
|
8
8
|
// 获取公司列表
|
9
|
-
const getCompanyList = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/company
|
9
|
+
const getCompanyList = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/company/`, null, {
|
10
|
+
headers
|
11
|
+
}).then((data)=>data.map(transferCompanyApi2Company));
|
10
12
|
// 获取组件列表
|
11
|
-
const getComponentList = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/component
|
13
|
+
const getComponentList = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/component/`, null, {
|
14
|
+
headers
|
15
|
+
});
|
12
16
|
// 查询操作记录列表
|
13
|
-
const getOperateRecordList = (param)=>fetch.post(`${apiPrefix}/${metaPerfix}/operate_record/list/`, transferOperatRecordParam2OperatRecordParamApi(param)
|
17
|
+
const getOperateRecordList = (param)=>fetch.post(`${apiPrefix}/${metaPerfix}/operate_record/list/`, transferOperatRecordParam2OperatRecordParamApi(param), {
|
18
|
+
headers
|
19
|
+
}).then(({ count, results })=>({
|
14
20
|
count,
|
15
21
|
results: results.map(transferOperatRecordApi2OperatRecord)
|
16
22
|
}));
|
17
23
|
// 获取来源团队-组件和参与方列表
|
18
24
|
const getCompanyParticipantList = (fuzzy)=>fetch.get(`${apiPrefix}/${metaPerfix}/company/participant_list/`, {
|
19
25
|
fuzzy
|
26
|
+
}, {
|
27
|
+
headers
|
20
28
|
}).then(({ list, company_names })=>({
|
21
29
|
companyNames: company_names,
|
22
30
|
list: transferCompanyParticipantApi2CompanyParticipantList(list)
|
23
31
|
}));
|
24
32
|
// 平台用户-更新用户信息
|
25
|
-
const registerUser = (data)=>fetch.post(`${apiPrefix}/${metaPerfix}/user/register/`, transferUserInfoForm2UserInfoFormApi(data)
|
33
|
+
const registerUser = (data)=>fetch.post(`${apiPrefix}/${metaPerfix}/user/register/`, transferUserInfoForm2UserInfoFormApi(data), {
|
34
|
+
headers
|
35
|
+
});
|
26
36
|
// 平台用户-获取用户信息
|
27
|
-
const getUserInfo = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/user
|
37
|
+
const getUserInfo = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/user/`, null, {
|
38
|
+
headers
|
39
|
+
}).then(transferUserInfoApi2UserInfo);
|
28
40
|
// 平台用户-退出登录
|
29
|
-
const logout = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/user/logout
|
41
|
+
const logout = ()=>fetch.get(`${apiPrefix}/${metaPerfix}/user/logout/`, null, {
|
42
|
+
headers
|
43
|
+
});
|
30
44
|
// dateset相关接口
|
31
45
|
// 获取数据集数据信息
|
32
|
-
const getDatasetMineInfo = ()=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset/mine_info
|
46
|
+
const getDatasetMineInfo = ()=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset/mine_info/`, null, {
|
47
|
+
headers
|
48
|
+
});
|
33
49
|
// 获取数据集列表
|
34
|
-
const getDatasetList = (query)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset/list/`, transferDatasetListParam2DatasetListParamApi(query)
|
50
|
+
const getDatasetList = (query)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset/list/`, transferDatasetListParam2DatasetListParamApi(query), {
|
51
|
+
headers
|
52
|
+
}).then(({ count, results })=>({
|
35
53
|
count,
|
36
54
|
results: results.map(transferDatasetApi2Dataset)
|
37
55
|
}));
|
38
56
|
// 获取数据集
|
39
|
-
const getDataset = (id)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset/${id}
|
57
|
+
const getDataset = (id)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset/${id}/`, null, {
|
58
|
+
headers
|
59
|
+
}).then(transferDatasetApi2Dataset);
|
40
60
|
// 创建数据集
|
41
|
-
const createDataset = (data)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset/`, transferDatasetForm2DatasetFormApi(data)
|
61
|
+
const createDataset = (data)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset/`, transferDatasetForm2DatasetFormApi(data), {
|
62
|
+
headers
|
63
|
+
}).then(transferDatasetApi2Dataset);
|
42
64
|
// 更新数据集
|
43
|
-
const updateDataset = (data, id)=>fetch.patch(`${apiPrefix}/${datasetPerfix}/dataset/${id}/`, transferDatasetForm2DatasetFormApi(data)
|
65
|
+
const updateDataset = (data, id)=>fetch.patch(`${apiPrefix}/${datasetPerfix}/dataset/${id}/`, transferDatasetForm2DatasetFormApi(data), {
|
66
|
+
headers
|
67
|
+
}).then(transferDatasetApi2Dataset);
|
44
68
|
// 删除数据集
|
45
|
-
const deleteDataset = (id)=>fetch.delete(`${apiPrefix}/${datasetPerfix}/dataset/${id}
|
69
|
+
const deleteDataset = (id)=>fetch.delete(`${apiPrefix}/${datasetPerfix}/dataset/${id}/`, null, {
|
70
|
+
headers
|
71
|
+
});
|
46
72
|
// 获取数据集数据列表
|
47
|
-
const getDatasetDataList = (query)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset_item/`, transferDatasetDataParam2DatasetDataParamApi(query)
|
73
|
+
const getDatasetDataList = (query)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset_item/`, transferDatasetDataParam2DatasetDataParamApi(query), {
|
74
|
+
headers
|
75
|
+
}).then(({ count, results })=>({
|
48
76
|
count,
|
49
77
|
results: results.map(transferDatasetDataApi2DatasetData)
|
50
78
|
}));
|
51
79
|
// 创建数据集数据
|
52
|
-
const createDatasetData = (data)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset_item/`, transferDatasetDataForm2DatasetDataFormApi(data)
|
80
|
+
const createDatasetData = (data)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset_item/`, transferDatasetDataForm2DatasetDataFormApi(data), {
|
81
|
+
headers
|
82
|
+
}).then(transferCreateDatasetDataResultApi2CreateDatasetDataResult);
|
53
83
|
// 更新数据集数据
|
54
|
-
const updateDatasetData = (data, id)=>fetch.patch(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}/`, transferDatasetDataForm2DatasetDataFormApi(data)
|
84
|
+
const updateDatasetData = (data, id)=>fetch.patch(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}/`, transferDatasetDataForm2DatasetDataFormApi(data), {
|
85
|
+
headers
|
86
|
+
}).then(transferDatasetDataApi2DatasetData);
|
55
87
|
// 删除数据集数据
|
56
|
-
const deleteDatasetData = (id)=>fetch.delete(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}
|
88
|
+
const deleteDatasetData = (id)=>fetch.delete(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}/`, null, {
|
89
|
+
headers
|
90
|
+
});
|
57
91
|
// 获取数据集数据详情
|
58
|
-
const getDatasetData = (id)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}
|
92
|
+
const getDatasetData = (id)=>fetch.get(`${apiPrefix}/${datasetPerfix}/dataset_item/${id}/`, null, {
|
93
|
+
headers
|
94
|
+
}).then(transferDatasetDataApi2DatasetData);
|
59
95
|
// 批量删除数据集数据
|
60
96
|
const batchDeleteDatasetData = (ids)=>fetch.post(`${apiPrefix}/${datasetPerfix}/dataset_item/batch_delete/`, {
|
61
97
|
ids
|
98
|
+
}, {
|
99
|
+
headers
|
62
100
|
});
|
63
101
|
// 数据集数据文件上传
|
64
102
|
const uploadDatasetDataFiles = (files)=>{
|
@@ -67,7 +105,8 @@ export const useDatasetHttp = (apiPrefix)=>{
|
|
67
105
|
form.append('files', file);
|
68
106
|
});
|
69
107
|
return fetch.post(`${apiPrefix}/${datasetPerfix}/dataset_item/upload/`, form, {
|
70
|
-
requestType: 'formData'
|
108
|
+
requestType: 'formData',
|
109
|
+
headers
|
71
110
|
}).then((data)=>data.map(transferDatasetDataFileApi2DatasetDataFile));
|
72
111
|
};
|
73
112
|
// 下载数据集数据模板文件
|
@@ -78,6 +117,8 @@ export const useDatasetHttp = (apiPrefix)=>{
|
|
78
117
|
// 获取schema列表
|
79
118
|
const getSchemaList = (datasetId)=>fetch.get(`${apiPrefix}/${datasetPerfix}/schema/schema_list/`, {
|
80
119
|
dataset_id: datasetId
|
120
|
+
}, {
|
121
|
+
headers
|
81
122
|
});
|
82
123
|
return {
|
83
124
|
getCompanyList,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { ISession, ISessionContent } from '@/types/session';
|
2
|
-
export declare const useSessionHttp: (apiPrefix: string) => {
|
2
|
+
export declare const useSessionHttp: (apiPrefix: string, headers?: Record<string, string>) => {
|
3
3
|
getAgentInfo: () => Promise<import("@/types/agent").IAgentInfo>;
|
4
4
|
clearSession: (sessionCode: string) => Promise<unknown>;
|
5
5
|
getSessions: () => Promise<ISession[]>;
|
@@ -2,38 +2,64 @@ import fetch from '../http/fetch/index.ts.js';
|
|
2
2
|
import { transferAgentInfoApi2AgentInfo } from '../http/helper/agent.ts.js';
|
3
3
|
import { transferSession2SessionApi, transferSessionApi2Session, transferSessionContent2SessionContentApi, transferSessionContentApi2SessionContent } from '../http/helper/session.ts.js';
|
4
4
|
// session 相关接口
|
5
|
-
export const useSessionHttp = (apiPrefix)=>{
|
5
|
+
export const useSessionHttp = (apiPrefix, headers)=>{
|
6
6
|
// 获取 agent 信息
|
7
|
-
const getAgentInfo = ()=>fetch.get(`${apiPrefix}/agent/info
|
7
|
+
const getAgentInfo = ()=>fetch.get(`${apiPrefix}/agent/info/`, null, {
|
8
|
+
headers
|
9
|
+
}).then((res)=>transferAgentInfoApi2AgentInfo(res));
|
8
10
|
// 清除聊天上下文
|
9
|
-
const clearSession = (sessionCode)=>fetch.post(`${apiPrefix}/chat_completion/${sessionCode}/clear
|
11
|
+
const clearSession = (sessionCode)=>fetch.post(`${apiPrefix}/chat_completion/${sessionCode}/clear/`, null, {
|
12
|
+
headers
|
13
|
+
});
|
10
14
|
// 获取会话列表
|
11
|
-
const getSessions = ()=>fetch.get(`${apiPrefix}/session
|
15
|
+
const getSessions = ()=>fetch.get(`${apiPrefix}/session/`, null, {
|
16
|
+
headers
|
17
|
+
}).then((res)=>res.map(transferSessionApi2Session));
|
12
18
|
// 新增会话
|
13
|
-
const plusSession = (data)=>fetch.post(`${apiPrefix}/session/`, transferSession2SessionApi(data)
|
19
|
+
const plusSession = (data)=>fetch.post(`${apiPrefix}/session/`, transferSession2SessionApi(data), {
|
20
|
+
headers
|
21
|
+
}).then((res)=>transferSessionApi2Session(res));
|
14
22
|
// 修改会话
|
15
|
-
const modifySession = (data)=>fetch.put(`${apiPrefix}/session/${data.sessionCode}/`, transferSession2SessionApi(data)
|
23
|
+
const modifySession = (data)=>fetch.put(`${apiPrefix}/session/${data.sessionCode}/`, transferSession2SessionApi(data), {
|
24
|
+
headers
|
25
|
+
}).then((res)=>transferSessionApi2Session(res));
|
16
26
|
// 删除会话
|
17
|
-
const deleteSession = (sessionCode)=>fetch.delete(`${apiPrefix}/session/${sessionCode}
|
27
|
+
const deleteSession = (sessionCode)=>fetch.delete(`${apiPrefix}/session/${sessionCode}/`, null, {
|
28
|
+
headers
|
29
|
+
});
|
18
30
|
// 批量删除会话
|
19
31
|
const batchDeleteSessions = (sessionCodes)=>fetch.post(`${apiPrefix}/session/batch_delete/`, {
|
20
32
|
session_codes: sessionCodes
|
33
|
+
}, {
|
34
|
+
headers
|
21
35
|
});
|
22
36
|
// 获取会话资源
|
23
|
-
const getSession = (sessionCode)=>fetch.get(`${apiPrefix}/session/${sessionCode}
|
37
|
+
const getSession = (sessionCode)=>fetch.get(`${apiPrefix}/session/${sessionCode}/`, null, {
|
38
|
+
headers
|
39
|
+
}).then((res)=>transferSessionApi2Session(res));
|
24
40
|
// 获取会话内容列表
|
25
41
|
const getSessionContents = (sessionCode)=>fetch.get(`${apiPrefix}/session_content/content/`, {
|
26
42
|
session_code: sessionCode
|
43
|
+
}, {
|
44
|
+
headers
|
27
45
|
}).then((res)=>res.map(transferSessionContentApi2SessionContent));
|
28
46
|
// 新增会话内容
|
29
|
-
const plusSessionContent = (data)=>fetch.post(`${apiPrefix}/session_content/`, transferSessionContent2SessionContentApi(data)
|
47
|
+
const plusSessionContent = (data)=>fetch.post(`${apiPrefix}/session_content/`, transferSessionContent2SessionContentApi(data), {
|
48
|
+
headers
|
49
|
+
});
|
30
50
|
// 修改会话内容
|
31
|
-
const modifySessionContent = (data)=>fetch.put(`${apiPrefix}/session_content/${data.id}/`, transferSessionContent2SessionContentApi(data)
|
51
|
+
const modifySessionContent = (data)=>fetch.put(`${apiPrefix}/session_content/${data.id}/`, transferSessionContent2SessionContentApi(data), {
|
52
|
+
headers
|
53
|
+
});
|
32
54
|
// 删除会话内容
|
33
|
-
const deleteSessionContent = (id)=>fetch.delete(`${apiPrefix}/session_content/${id}
|
55
|
+
const deleteSessionContent = (id)=>fetch.delete(`${apiPrefix}/session_content/${id}/`, null, {
|
56
|
+
headers
|
57
|
+
});
|
34
58
|
// 批量删除聊天内容
|
35
59
|
const batchDeleteSessionContents = (ids)=>fetch.post(`${apiPrefix}/session_content/batch_delete/`, {
|
36
60
|
ids
|
61
|
+
}, {
|
62
|
+
headers
|
37
63
|
});
|
38
64
|
return {
|
39
65
|
getAgentInfo,
|
@@ -3,11 +3,14 @@
|
|
3
3
|
* @param data IAgentInfoApi
|
4
4
|
* @returns IAgentInfo
|
5
5
|
*/ export const transferAgentInfoApi2AgentInfo = (data)=>{
|
6
|
-
var _data_conversation_settings, _data_conversation_settings1;
|
6
|
+
var _data_conversation_settings, _data_conversation_settings1, _data_prompt_setting;
|
7
7
|
return {
|
8
8
|
conversationSettings: {
|
9
9
|
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,
|
10
10
|
predefinedQuestions: data === null || data === void 0 ? void 0 : (_data_conversation_settings1 = data.conversation_settings) === null || _data_conversation_settings1 === void 0 ? void 0 : _data_conversation_settings1.predefined_questions
|
11
|
+
},
|
12
|
+
promptSetting: {
|
13
|
+
content: data === null || data === void 0 ? void 0 : (_data_prompt_setting = data.prompt_setting) === null || _data_prompt_setting === void 0 ? void 0 : _data_prompt_setting.content
|
11
14
|
}
|
12
15
|
};
|
13
16
|
};
|
@@ -294,16 +294,12 @@ function _object_without_properties_loose(source, excluded) {
|
|
294
294
|
* @param data ICompanyParticipantApi[]
|
295
295
|
* @returns ICompanyParticipant[]
|
296
296
|
*/ export const transferCompanyParticipantApi2CompanyParticipantList = (data)=>{
|
297
|
-
// 按照category排序
|
298
|
-
const sortedData = [
|
299
|
-
...data
|
300
|
-
].sort((a, b)=>a.category.localeCompare(b.category));
|
301
297
|
const countMap = {};
|
302
|
-
|
298
|
+
data.forEach((item)=>{
|
303
299
|
countMap[item.category] = (countMap[item.category] || 0) + 1;
|
304
300
|
});
|
305
301
|
// 2. 为每个item添加rowspan
|
306
|
-
return
|
302
|
+
return data.map((item)=>({
|
307
303
|
category: item.category,
|
308
304
|
componentName: item.component_name,
|
309
305
|
description: item.description,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { SessionContentRole } from '@/types/enum';
|
1
2
|
import type { ISession, ISessionApi, ISessionContent, ISessionContentApi, ISessionPrompt } from '@/types/session';
|
2
3
|
/**
|
3
4
|
* 将 sessionContent 转换为 sessionPrompt
|
@@ -5,6 +6,15 @@ import type { ISession, ISessionApi, ISessionContent, ISessionContentApi, ISessi
|
|
5
6
|
* @returns sessionPrompt
|
6
7
|
*/
|
7
8
|
export declare const transferSessionContent2SessionPrompt: (sessionContent: ISessionContent) => ISessionPrompt;
|
9
|
+
/**
|
10
|
+
* 将前端使用的 session 提示数据转换为前端使用的 session 内容数据
|
11
|
+
* @param prompt 前端使用的 session 提示数据
|
12
|
+
* @returns 前端使用的 session 内容数据
|
13
|
+
*/
|
14
|
+
export declare const transferSessionPrompt2SessionContent: (prompt: ISessionPrompt) => {
|
15
|
+
role: SessionContentRole;
|
16
|
+
content: string;
|
17
|
+
};
|
8
18
|
/**
|
9
19
|
* 将 API 返回的 session 数据转换为前端使用的 session 数据
|
10
20
|
* @param data API 返回的 session 数据
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { transferTool, transferToolApi } from './tool.ts.js';
|
2
1
|
import { transferKnowledge, transferKnowledgeApi, transferKnowledgeApi2Knowledgebase, transferKnowledgebase, transferKnowledgebase2KnowledgeApi, transferKnowledgebaseApi } from './knowledge.ts.js';
|
2
|
+
import { transferTool, transferToolApi } from './tool.ts.js';
|
3
3
|
import { SessionContentRole, SessionPromptRole } from '../../types/enum.ts.js';
|
4
4
|
/**
|
5
5
|
* 将 sessionContent 转换为 sessionPrompt
|
@@ -33,6 +33,34 @@ import { SessionContentRole, SessionPromptRole } from '../../types/enum.ts.js';
|
|
33
33
|
role: sessionRoleMap[sessionContent.role]
|
34
34
|
};
|
35
35
|
};
|
36
|
+
/**
|
37
|
+
* 将前端使用的 session 提示数据转换为前端使用的 session 内容数据
|
38
|
+
* @param prompt 前端使用的 session 提示数据
|
39
|
+
* @returns 前端使用的 session 内容数据
|
40
|
+
*/ export const transferSessionPrompt2SessionContent = (prompt)=>{
|
41
|
+
const sessionRoleMap = {
|
42
|
+
[SessionPromptRole.Assistant]: SessionContentRole.Ai,
|
43
|
+
[SessionPromptRole.User]: SessionContentRole.User,
|
44
|
+
[SessionPromptRole.System]: SessionContentRole.Role,
|
45
|
+
[SessionPromptRole.Hidden]: SessionContentRole.Hidden,
|
46
|
+
[SessionPromptRole.Guide]: SessionContentRole.Guide,
|
47
|
+
[SessionPromptRole.HiddenAssistant]: SessionContentRole.HiddenAi,
|
48
|
+
[SessionPromptRole.HiddenGuide]: SessionContentRole.HiddenGuide,
|
49
|
+
[SessionPromptRole.HiddenSystem]: SessionContentRole.HiddenRole,
|
50
|
+
[SessionPromptRole.HiddenUser]: SessionContentRole.HiddenUser,
|
51
|
+
[SessionPromptRole.TemplateAssistant]: SessionContentRole.TemplateAi,
|
52
|
+
[SessionPromptRole.TemplateGuide]: SessionContentRole.TemplateGuide,
|
53
|
+
[SessionPromptRole.TemplateSystem]: SessionContentRole.TemplateRole,
|
54
|
+
[SessionPromptRole.TemplateUser]: SessionContentRole.TemplateUser,
|
55
|
+
[SessionPromptRole.TemplateHidden]: SessionContentRole.TemplateHidden,
|
56
|
+
[SessionPromptRole.Pause]: SessionContentRole.Pause,
|
57
|
+
[SessionPromptRole.UserImage]: SessionContentRole.UserImage
|
58
|
+
};
|
59
|
+
return {
|
60
|
+
content: prompt.content,
|
61
|
+
role: sessionRoleMap[prompt.role]
|
62
|
+
};
|
63
|
+
};
|
36
64
|
/**
|
37
65
|
* 将 API 返回的 session 数据转换为前端使用的 session 数据
|
38
66
|
* @param data API 返回的 session 数据
|
@@ -119,7 +147,7 @@ import { SessionContentRole, SessionPromptRole } from '../../types/enum.ts.js';
|
|
119
147
|
* @param data 前端使用的 session 内容数据
|
120
148
|
* @returns API 使用的 session 内容数据
|
121
149
|
*/ export const transferSessionContent2SessionContentApi = (data)=>{
|
122
|
-
var _data_property_extra_tools, _data_property_extra, _data_property, _data_property_extra_anchorPathResources_knowledges, _data_property_extra_anchorPathResources, _data_property_extra1, _data_property1, _data_property_extra_anchorPathResources_knowledgebases, _data_property_extra_anchorPathResources1, _data_property_extra2, _data_property2, _data_property_extra_anchorPathResources_knowledgeFolders, _data_property_extra_anchorPathResources2, _data_property_extra3, _data_property3;
|
150
|
+
var _data_property_extra_tools, _data_property_extra, _data_property, _data_property_extra_anchorPathResources_knowledges, _data_property_extra_anchorPathResources, _data_property_extra1, _data_property1, _data_property_extra_anchorPathResources_knowledgebases, _data_property_extra_anchorPathResources1, _data_property_extra2, _data_property2, _data_property_extra_anchorPathResources_knowledgeFolders, _data_property_extra_anchorPathResources2, _data_property_extra3, _data_property3, _data_property_extra4, _data_property4, _data_property_extra5, _data_property5;
|
123
151
|
return {
|
124
152
|
id: data.id,
|
125
153
|
session_code: data.sessionCode,
|
@@ -140,7 +168,9 @@ import { SessionContentRole, SessionPromptRole } from '../../types/enum.ts.js';
|
|
140
168
|
knowledges: (_data_property1 = data.property) === null || _data_property1 === void 0 ? void 0 : (_data_property_extra1 = _data_property1.extra) === null || _data_property_extra1 === void 0 ? void 0 : (_data_property_extra_anchorPathResources = _data_property_extra1.anchorPathResources) === null || _data_property_extra_anchorPathResources === void 0 ? void 0 : (_data_property_extra_anchorPathResources_knowledges = _data_property_extra_anchorPathResources.knowledges) === null || _data_property_extra_anchorPathResources_knowledges === void 0 ? void 0 : _data_property_extra_anchorPathResources_knowledges.map(transferKnowledge),
|
141
169
|
knowledgebases: (_data_property2 = data.property) === null || _data_property2 === void 0 ? void 0 : (_data_property_extra2 = _data_property2.extra) === null || _data_property_extra2 === void 0 ? void 0 : (_data_property_extra_anchorPathResources1 = _data_property_extra2.anchorPathResources) === null || _data_property_extra_anchorPathResources1 === void 0 ? void 0 : (_data_property_extra_anchorPathResources_knowledgebases = _data_property_extra_anchorPathResources1.knowledgebases) === null || _data_property_extra_anchorPathResources_knowledgebases === void 0 ? void 0 : _data_property_extra_anchorPathResources_knowledgebases.map(transferKnowledgebase),
|
142
170
|
knowledge_folders: (_data_property3 = data.property) === null || _data_property3 === void 0 ? void 0 : (_data_property_extra3 = _data_property3.extra) === null || _data_property_extra3 === void 0 ? void 0 : (_data_property_extra_anchorPathResources2 = _data_property_extra3.anchorPathResources) === null || _data_property_extra_anchorPathResources2 === void 0 ? void 0 : (_data_property_extra_anchorPathResources_knowledgeFolders = _data_property_extra_anchorPathResources2.knowledgeFolders) === null || _data_property_extra_anchorPathResources_knowledgeFolders === void 0 ? void 0 : _data_property_extra_anchorPathResources_knowledgeFolders.map(transferKnowledgebase2KnowledgeApi)
|
143
|
-
}
|
171
|
+
},
|
172
|
+
cite: (_data_property4 = data.property) === null || _data_property4 === void 0 ? void 0 : (_data_property_extra4 = _data_property4.extra) === null || _data_property_extra4 === void 0 ? void 0 : _data_property_extra4.cite,
|
173
|
+
shortcut: (_data_property5 = data.property) === null || _data_property5 === void 0 ? void 0 : (_data_property_extra5 = _data_property5.extra) === null || _data_property_extra5 === void 0 ? void 0 : _data_property_extra5.shortcut
|
144
174
|
}
|
145
175
|
}
|
146
176
|
};
|
package/dist/types/agent.d.ts
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
+
import type { ISessionPrompt } from '@/types/session';
|
1
2
|
export interface IAgentInfoApi {
|
2
3
|
conversation_settings?: {
|
3
4
|
opening_remark?: string;
|
4
5
|
predefined_questions?: string[];
|
5
6
|
};
|
7
|
+
prompt_setting?: {
|
8
|
+
content?: ISessionPrompt[];
|
9
|
+
};
|
6
10
|
}
|
7
11
|
export interface IAgentInfo {
|
8
12
|
conversationSettings?: {
|
9
13
|
openingRemark?: string;
|
10
14
|
predefinedQuestions?: string[];
|
11
15
|
};
|
16
|
+
promptSetting?: {
|
17
|
+
content?: ISessionPrompt[];
|
18
|
+
};
|
12
19
|
}
|