@blueking/ai-ui-sdk 0.0.15-beta.16 → 0.0.15-beta.18

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.
Files changed (29) hide show
  1. package/dist/component/render-input/index.vue.css +17 -17
  2. package/dist/component/render-input/index.vue.js +1 -1
  3. package/dist/component/render-input/render-drag.vue.css +5 -5
  4. package/dist/component/render-input/render-drag.vue.js +1 -1
  5. package/dist/component/render-knowledge-icon/index.vue.css +1 -1
  6. package/dist/component/render-knowledge-icon/index.vue.js +1 -1
  7. package/dist/component/render-message/openai-message.vue.css +15 -15
  8. package/dist/component/render-message/openai-message.vue.js +1 -1
  9. package/dist/component/render-message/skeleton-message.vue.css +1 -1
  10. package/dist/component/render-message/skeleton-message.vue.js +1 -1
  11. package/dist/component/render-message/system-message.vue.css +2 -2
  12. package/dist/component/render-message/system-message.vue.js +1 -1
  13. package/dist/component/render-message/time-message.vue.css +1 -1
  14. package/dist/component/render-message/time-message.vue.js +1 -1
  15. package/dist/component/render-message/token-expired-message.vue.css +9 -9
  16. package/dist/component/render-message/token-expired-message.vue.js +1 -1
  17. package/dist/component/render-message/user-message.vue.css +15 -15
  18. package/dist/component/render-message/user-message.vue.js +1 -1
  19. package/dist/component/render-stop/index.vue.css +2 -2
  20. package/dist/component/render-stop/index.vue.js +1 -1
  21. package/dist/hooks/use-chat.d.ts +1 -0
  22. package/dist/hooks/use-chat.js +2 -1
  23. package/dist/hooks/use-http.d.ts +1 -0
  24. package/dist/hooks/use-http.js +4 -0
  25. package/dist/http/fetch/index.js +1 -1
  26. package/dist/http/helper/agent.d.ts +7 -0
  27. package/dist/http/helper/agent.js +8 -0
  28. package/dist/types/agent.d.ts +8 -0
  29. package/package.json +1 -1
@@ -1,37 +1,37 @@
1
1
 
2
2
  .send-prompt-container {
3
- &[data-v-oto1kofg] {
3
+ &[data-v-6hc6s8b5] {
4
4
  width: 800px;
5
5
  z-index: 1501;
6
6
  overflow: visible;
7
7
  position: relative;
8
8
  }
9
- [data-v-oto1kofg] .textarea-list {
9
+ [data-v-6hc6s8b5] .textarea-list {
10
10
  bottom: var(--textarea-bottom);
11
11
  }
12
12
  &:hover {
13
- .clear-icon[data-v-oto1kofg] {
13
+ .clear-icon[data-v-6hc6s8b5] {
14
14
  display: inline-flex !important;
15
15
  }
16
16
  }
17
17
  }
18
18
  .quill-container {
19
- &[data-v-oto1kofg] {
19
+ &[data-v-6hc6s8b5] {
20
20
  background: #fff;
21
21
  box-shadow: 0 0 6px 0 #0000001a;
22
22
  border-radius: 4px;
23
23
  box-sizing: border-box !important;
24
24
  border: 1px solid transparent;
25
25
  }
26
- &.active[data-v-oto1kofg] {
26
+ &.active[data-v-6hc6s8b5] {
27
27
  border: 1px solid #3A84FF !important;
28
28
  }
29
- &[data-v-oto1kofg]:has(.ql-editor:focus) {
29
+ &[data-v-6hc6s8b5]:has(.ql-editor:focus) {
30
30
  border: 1px solid #3A84FF !important;
31
31
  }
32
32
  }
33
33
  .send-prompt {
34
- &[data-v-oto1kofg] {
34
+ &[data-v-6hc6s8b5] {
35
35
  width: 800px;
36
36
  border: 1px solid transparent;
37
37
  flex-direction: row;
@@ -41,28 +41,28 @@
41
41
  border-radius: 4px;
42
42
  border: 1px solid transparent !important;
43
43
  }
44
- [data-v-oto1kofg] .content-input-wrapper {
44
+ [data-v-6hc6s8b5] .content-input-wrapper {
45
45
  padding: 0 !important;
46
46
  height: 100% !important;
47
47
  }
48
- [data-v-oto1kofg] .auto-textarea-wrapper {
48
+ [data-v-6hc6s8b5] .auto-textarea-wrapper {
49
49
  height: 100% !important;
50
50
  }
51
- [data-v-oto1kofg] .v-note-panel {
51
+ [data-v-6hc6s8b5] .v-note-panel {
52
52
  border-radius: 4px;
53
53
  }
54
- [data-v-oto1kofg] .scroll-style {
54
+ [data-v-6hc6s8b5] .scroll-style {
55
55
  overflow-y: hidden !important;
56
56
  }
57
- [data-v-oto1kofg] .auto-textarea-block {
57
+ [data-v-6hc6s8b5] .auto-textarea-block {
58
58
  display: none;
59
59
  }
60
- &[data-v-oto1kofg]:has(.ql-editor:focus) {
60
+ &[data-v-6hc6s8b5]:has(.ql-editor:focus) {
61
61
  height: var(--text-height);
62
62
  }
63
63
  }
64
64
  .ai-ui-sdk-fasong {
65
- &[data-v-oto1kofg] {
65
+ &[data-v-6hc6s8b5] {
66
66
  width: 28px;
67
67
  height: 28px;
68
68
  line-height: 28px;
@@ -76,16 +76,16 @@
76
76
  text-align: center;
77
77
  z-index: 1501;
78
78
  }
79
- &[data-v-oto1kofg]:hover {
79
+ &[data-v-6hc6s8b5]:hover {
80
80
  background: #F0F5FF;
81
81
  color: #3a84ff;
82
82
  }
83
- &.disable[data-v-oto1kofg] {
83
+ &.disable[data-v-6hc6s8b5] {
84
84
  color: #dcdee5;
85
85
  cursor: not-allowed;
86
86
  }
87
87
  }
88
- .clear-icon[data-v-oto1kofg] {
88
+ .clear-icon[data-v-6hc6s8b5] {
89
89
  display: none !important;
90
90
  position: absolute;
91
91
  bottom: 42px;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js';
2
- script.__scopeId = "data-v-oto1kofg";
2
+ script.__scopeId = "data-v-6hc6s8b5";
3
3
  script.__file = "./src/component/render-input/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,6 +1,6 @@
1
1
 
2
2
  .send-tool-container {
3
- &[data-v-rs11xc02] {
3
+ &[data-v-0yw4x2ah] {
4
4
  position: absolute;
5
5
  left: 50%;
6
6
  top: 16px;
@@ -14,18 +14,18 @@
14
14
  z-index: 15001;
15
15
  }
16
16
  &.bottom {
17
- &[data-v-rs11xc02] {
17
+ &[data-v-0yw4x2ah] {
18
18
  bottom: 0;
19
19
  top: auto;
20
20
  }
21
- .ai-ui-sdk-gengduo[data-v-rs11xc02] {
21
+ .ai-ui-sdk-gengduo[data-v-0yw4x2ah] {
22
22
  margin-top: -10px;
23
23
  }
24
24
  }
25
- &[data-v-rs11xc02]:hover, &.is-dragging[data-v-rs11xc02] {
25
+ &[data-v-0yw4x2ah]:hover, &.is-dragging[data-v-0yw4x2ah] {
26
26
  background: #3A84FF;
27
27
  }
28
- .ai-ui-sdk-gengduo[data-v-rs11xc02] {
28
+ .ai-ui-sdk-gengduo[data-v-0yw4x2ah] {
29
29
  margin-top: -2px;
30
30
  color: #63656E;
31
31
  }
@@ -1,5 +1,5 @@
1
1
  import script from './render-drag.script.vue.js';
2
- script.__scopeId = "data-v-rs11xc02";
2
+ script.__scopeId = "data-v-0yw4x2ah";
3
3
  script.__file = "./src/component/render-input/render-drag.vue";
4
4
  import './render-drag.vue.css';
5
5
  export default script;
@@ -1,4 +1,4 @@
1
1
 
2
- .ai-ui-sdk-icon[data-v-huwxm2zi] {
2
+ .ai-ui-sdk-icon[data-v-6lsid74v] {
3
3
  color: #C4C6CC;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js';
2
- script.__scopeId = "data-v-huwxm2zi";
2
+ script.__scopeId = "data-v-6lsid74v";
3
3
  script.__file = "./src/component/render-knowledge-icon/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -1,11 +1,11 @@
1
1
 
2
- .ai-message-home[data-v-54501q2z] {
2
+ .ai-message-home[data-v-2q3oq3t0] {
3
3
  justify-content: center;
4
4
  align-items: flex-start;
5
5
  width: 100%;
6
6
  }
7
7
  .ai-content {
8
- &[data-v-54501q2z] {
8
+ &[data-v-2q3oq3t0] {
9
9
  flex: 1;
10
10
  max-width: calc(100% - 104px);
11
11
  background: #FFFFFF;
@@ -18,12 +18,12 @@
18
18
  padding-top: 12px;
19
19
  margin-right: 52px;
20
20
  }
21
- .ai-ui-sdk-warning-circle-fill[data-v-54501q2z] {
21
+ .ai-ui-sdk-warning-circle-fill[data-v-2q3oq3t0] {
22
22
  color: #EA3636;
23
23
  font-size: 18px;
24
24
  margin-right: 2px;
25
25
  }
26
- .ai-ui-sdk-quanquan[data-v-54501q2z] {
26
+ .ai-ui-sdk-quanquan[data-v-2q3oq3t0] {
27
27
  display: inline-block;
28
28
  color: #3A84FF;
29
29
  animation: rotate 800ms linear infinite;
@@ -32,12 +32,12 @@
32
32
  top: 23px;
33
33
  z-index: 1501;
34
34
  }
35
- .message-check[data-v-54501q2z] {
35
+ .message-check[data-v-2q3oq3t0] {
36
36
  position: absolute;
37
37
  top: 0;
38
38
  left: -80px;
39
39
  }
40
- &[data-v-54501q2z]::before {
40
+ &[data-v-2q3oq3t0]::before {
41
41
  position: absolute;
42
42
  content: '';
43
43
  width: 15px;
@@ -47,25 +47,25 @@
47
47
  rotate: 45deg;
48
48
  background: #FFFFFF;
49
49
  }
50
- &.fail[data-v-54501q2z] {
50
+ &.fail[data-v-2q3oq3t0] {
51
51
  padding: 12px;
52
52
  word-break: break-all;
53
53
  }
54
- &.loading[data-v-54501q2z] {
54
+ &.loading[data-v-2q3oq3t0] {
55
55
  padding: 12px 0;
56
56
  word-break: break-all;
57
57
  }
58
58
  }
59
- .skeleton-message[data-v-54501q2z] {
59
+ .skeleton-message[data-v-2q3oq3t0] {
60
60
  margin-right: 52px;
61
61
  }
62
62
  .message-photo {
63
- &[data-v-54501q2z] {
63
+ &[data-v-2q3oq3t0] {
64
64
  width: 52px;
65
65
  text-align: right;
66
66
  user-select: none;
67
67
  }
68
- img[data-v-54501q2z] {
68
+ img[data-v-2q3oq3t0] {
69
69
  margin-right: 16px;
70
70
  margin-top: 5px;
71
71
  width: 36px;
@@ -73,24 +73,24 @@ img[data-v-54501q2z] {
73
73
  }
74
74
  }
75
75
  .message-tools {
76
- &[data-v-54501q2z] {
76
+ &[data-v-2q3oq3t0] {
77
77
  margin: 12px 12px 12px;
78
78
  padding-top: 10px;
79
79
  justify-content: space-between;
80
80
  border-top: 1px solid #EAEBF0;
81
81
  }
82
- .rate-tip[data-v-54501q2z] {
82
+ .rate-tip[data-v-2q3oq3t0] {
83
83
  font-size: 12px;
84
84
  color: #979BA5;
85
85
  margin-left: 7px;
86
86
  }
87
87
  .tool-icons {
88
88
  .ai-ui-sdk-icon {
89
- &[data-v-54501q2z] {
89
+ &[data-v-2q3oq3t0] {
90
90
  cursor: pointer;
91
91
  color: #979BA5;
92
92
  }
93
- &[data-v-54501q2z]:hover {
93
+ &[data-v-2q3oq3t0]:hover {
94
94
  color: #3A84FF;
95
95
  }
96
96
  }
@@ -1,5 +1,5 @@
1
1
  import script from './openai-message.script.vue.js';
2
- script.__scopeId = "data-v-54501q2z";
2
+ script.__scopeId = "data-v-2q3oq3t0";
3
3
  script.__file = "./src/component/render-message/openai-message.vue";
4
4
  import './openai-message.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
 
2
- .skeleton-message[data-v-447u0gcx] {
2
+ .skeleton-message[data-v-jyn3e2iw] {
3
3
  height: 50px;
4
4
  flex: 1;
5
5
  background-color: #EBECF3;
@@ -1,6 +1,6 @@
1
1
  import { render } from './skeleton-message.script.vue.js';
2
2
  const script = { render };
3
- script.__scopeId = "data-v-447u0gcx";
3
+ script.__scopeId = "data-v-jyn3e2iw";
4
4
  script.__file = "./src/component/render-message/skeleton-message.vue";
5
5
  import './skeleton-message.vue.css';
6
6
  export default script;
@@ -1,6 +1,6 @@
1
1
 
2
2
  .system-message {
3
- &[data-v-i2wpjayq] {
3
+ &[data-v-2d06ahpe] {
4
4
  position: relative;
5
5
  width: calc(100% - 204px) !important;
6
6
  max-width: 800px !important;
@@ -8,7 +8,7 @@
8
8
  border-bottom: 1px dashed #DCDEE5;
9
9
  margin: 24px 0 40px !important;
10
10
  }
11
- span[data-v-i2wpjayq] {
11
+ span[data-v-2d06ahpe] {
12
12
  position: absolute;
13
13
  left: 50%;
14
14
  top: 50%;
@@ -1,5 +1,5 @@
1
1
  import script from './system-message.script.vue.js';
2
- script.__scopeId = "data-v-i2wpjayq";
2
+ script.__scopeId = "data-v-2d06ahpe";
3
3
  script.__file = "./src/component/render-message/system-message.vue";
4
4
  import './system-message.vue.css';
5
5
  export default script;
@@ -1,5 +1,5 @@
1
1
 
2
- .time-message[data-v-y2nljnd6] {
2
+ .time-message[data-v-l4p7l3bi] {
3
3
  position: relative;
4
4
  padding: 0 8px !important;
5
5
  height: 22px;
@@ -1,5 +1,5 @@
1
1
  import script from './time-message.script.vue.js';
2
- script.__scopeId = "data-v-y2nljnd6";
2
+ script.__scopeId = "data-v-l4p7l3bi";
3
3
  script.__file = "./src/component/render-message/time-message.vue";
4
4
  import './time-message.vue.css';
5
5
  export default script;
@@ -1,11 +1,11 @@
1
1
 
2
- .ai-message-home[data-v-lsxab1t5] {
2
+ .ai-message-home[data-v-gvrgm4he] {
3
3
  justify-content: center;
4
4
  align-items: flex-start;
5
5
  width: 100%;
6
6
  }
7
7
  .ai-content {
8
- &[data-v-lsxab1t5] {
8
+ &[data-v-gvrgm4he] {
9
9
  flex: 1;
10
10
  background: #FFFFFF;
11
11
  line-height: 22px;
@@ -17,17 +17,17 @@
17
17
  padding-top: 12px;
18
18
  margin-right: 52px;
19
19
  }
20
- .ai-ui-sdk-warning-circle-fill[data-v-lsxab1t5] {
20
+ .ai-ui-sdk-warning-circle-fill[data-v-gvrgm4he] {
21
21
  color: #EA3636;
22
22
  font-size: 18px;
23
23
  margin-right: 2px;
24
24
  }
25
- .message-check[data-v-lsxab1t5] {
25
+ .message-check[data-v-gvrgm4he] {
26
26
  position: absolute;
27
27
  top: 0;
28
28
  left: -80px;
29
29
  }
30
- &[data-v-lsxab1t5]::before {
30
+ &[data-v-gvrgm4he]::before {
31
31
  position: absolute;
32
32
  content: '';
33
33
  width: 15px;
@@ -37,24 +37,24 @@
37
37
  rotate: 45deg;
38
38
  background: #FFFFFF;
39
39
  }
40
- &.fail[data-v-lsxab1t5] {
40
+ &.fail[data-v-gvrgm4he] {
41
41
  padding: 12px;
42
42
  }
43
43
  }
44
44
  .message-photo {
45
- &[data-v-lsxab1t5] {
45
+ &[data-v-gvrgm4he] {
46
46
  width: 52px;
47
47
  text-align: right;
48
48
  user-select: none;
49
49
  }
50
- img[data-v-lsxab1t5] {
50
+ img[data-v-gvrgm4he] {
51
51
  margin-right: 16px;
52
52
  margin-top: 5px;
53
53
  width: 36px;
54
54
  height: 36px;
55
55
  }
56
56
  }
57
- .clear-message[data-v-lsxab1t5] {
57
+ .clear-message[data-v-gvrgm4he] {
58
58
  color: #3a84ff;
59
59
  cursor: pointer;
60
60
  }
@@ -1,5 +1,5 @@
1
1
  import script from './token-expired-message.script.vue.js';
2
- script.__scopeId = "data-v-lsxab1t5";
2
+ script.__scopeId = "data-v-gvrgm4he";
3
3
  script.__file = "./src/component/render-message/token-expired-message.vue";
4
4
  import './token-expired-message.vue.css';
5
5
  export default script;
@@ -1,23 +1,23 @@
1
1
 
2
- .user-message-home[data-v-y9offirg] {
2
+ .user-message-home[data-v-88v6uahd] {
3
3
  align-items: flex-start;
4
4
  justify-content: flex-end;
5
5
  }
6
6
  .user-message-extra {
7
- &[data-v-y9offirg] {
7
+ &[data-v-88v6uahd] {
8
8
  padding: 0 52px;
9
9
  }
10
- &[data-v-y9offirg]:after {
10
+ &[data-v-88v6uahd]:after {
11
11
  content: '';
12
12
  display: table;
13
13
  clear: both;
14
14
  }
15
- .ai-ui-sdk-icon[data-v-y9offirg] {
15
+ .ai-ui-sdk-icon[data-v-88v6uahd] {
16
16
  font-size: 14px;
17
17
  }
18
18
  }
19
19
  .user-content {
20
- &[data-v-y9offirg] {
20
+ &[data-v-88v6uahd] {
21
21
  flex: 1;
22
22
  max-width: calc(100% - 104px);
23
23
  background: #E1ECFF;
@@ -30,7 +30,7 @@
30
30
  margin-left: 52px;
31
31
  }
32
32
  .ai-ui-sdk-icon {
33
- &[data-v-y9offirg] {
33
+ &[data-v-88v6uahd] {
34
34
  width: 28px;
35
35
  height: 28px;
36
36
  background: #FFFFFF;
@@ -45,20 +45,20 @@
45
45
  margin-right: 8px;
46
46
  margin-top: 8px;
47
47
  }
48
- &.hover-show[data-v-y9offirg] {
48
+ &.hover-show[data-v-88v6uahd] {
49
49
  display: none;
50
50
  }
51
- &.ai-ui-sdk-yinyong-2[data-v-y9offirg]:hover, &.ai-ui-sdk-copy[data-v-y9offirg]:hover, &.ai-ui-sdk-baocun[data-v-y9offirg]:hover, &.ai-ui-sdk-delete[data-v-y9offirg]:hover {
51
+ &.ai-ui-sdk-yinyong-2[data-v-88v6uahd]:hover, &.ai-ui-sdk-copy[data-v-88v6uahd]:hover, &.ai-ui-sdk-baocun[data-v-88v6uahd]:hover, &.ai-ui-sdk-delete[data-v-88v6uahd]:hover {
52
52
  color: #3A84FF;
53
53
  border-color: #3A84FF;
54
54
  }
55
55
  }
56
56
  &:hover {
57
- .hover-show[data-v-y9offirg] {
57
+ .hover-show[data-v-88v6uahd] {
58
58
  display: flex;
59
59
  }
60
60
  }
61
- &[data-v-y9offirg]::after {
61
+ &[data-v-88v6uahd]::after {
62
62
  position: absolute;
63
63
  content: '';
64
64
  width: 15px;
@@ -69,24 +69,24 @@
69
69
  background: #E1ECFF;
70
70
  }
71
71
  }
72
- .message-tools[data-v-y9offirg] {
72
+ .message-tools[data-v-88v6uahd] {
73
73
  justify-content: flex-end;
74
74
  position: absolute;
75
75
  width: 150px;
76
76
  left: -150px;
77
77
  top: 2px;
78
78
  }
79
- .message-check[data-v-y9offirg] {
79
+ .message-check[data-v-88v6uahd] {
80
80
  position: absolute;
81
81
  top: 0;
82
82
  left: -80px;
83
83
  }
84
84
  .message-photo {
85
- &[data-v-y9offirg] {
85
+ &[data-v-88v6uahd] {
86
86
  width: 52px;
87
87
  user-select: none;
88
88
  }
89
- img[data-v-y9offirg] {
89
+ img[data-v-88v6uahd] {
90
90
  margin-left: 16px;
91
91
  margin-top: 5px;
92
92
  width: 36px;
@@ -95,6 +95,6 @@ img[data-v-y9offirg] {
95
95
  border-radius: 100%;
96
96
  }
97
97
  }
98
- .skeleton-message[data-v-y9offirg] {
98
+ .skeleton-message[data-v-88v6uahd] {
99
99
  margin-left: 52px;
100
100
  }
@@ -1,5 +1,5 @@
1
1
  import script from './user-message.script.vue.js';
2
- script.__scopeId = "data-v-y9offirg";
2
+ script.__scopeId = "data-v-88v6uahd";
3
3
  script.__file = "./src/component/render-message/user-message.vue";
4
4
  import './user-message.vue.css';
5
5
  export default script;
@@ -1,6 +1,6 @@
1
1
 
2
2
  .render-stop {
3
- &[data-v-t9btp6q4] {
3
+ &[data-v-5d1b3a21] {
4
4
  background: #FFFFFF;
5
5
  border: 1px solid #DCDEE5;
6
6
  border-radius: 2px;
@@ -9,7 +9,7 @@
9
9
  font-size: 12px;
10
10
  cursor: pointer;
11
11
  }
12
- .stop-icon[data-v-t9btp6q4] {
12
+ .stop-icon[data-v-5d1b3a21] {
13
13
  width: 8px;
14
14
  height: 8px;
15
15
  background: #FFDDDD;
@@ -1,5 +1,5 @@
1
1
  import script from './index.script.vue.js';
2
- script.__scopeId = "data-v-t9btp6q4";
2
+ script.__scopeId = "data-v-5d1b3a21";
3
3
  script.__file = "./src/component/render-stop/index.vue";
4
4
  import './index.vue.css';
5
5
  export default script;
@@ -849,6 +849,7 @@ export declare const useChat: ({ handleStart, handleText, handleReferenceDoc, ha
849
849
  cite?: string;
850
850
  }, callback?: () => void) => void;
851
851
  deleteChat: (index: number) => void;
852
+ getAgentInfoApi: () => Promise<import("../types/agent").IAgentInfo>;
852
853
  clearSessionApi: (sessionCode: string) => Promise<unknown>;
853
854
  getSessionsApi: () => Promise<ISession[]>;
854
855
  plusSessionApi: (data: ISession) => Promise<ISession>;
@@ -66,7 +66,7 @@ import { processPromptTemplate, throttle } from '../common/util.js';
66
66
  // ai 聊天
67
67
  export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions })=>{
68
68
  // 接口
69
- const { clearSession: clearSessionApi, getSessions: getSessionsApi, plusSession: plusSessionApi, modifySession: modifySessionApi, deleteSession: deleteSessionApi, batchDeleteSessions: batchDeleteSessionsApi, getSession: getSessionApi, getSessionContents: getSessionContentsApi, plusSessionContent: plusSessionContentApi, modifySessionContent: modifySessionContentApi, deleteSessionContent: deleteSessionContentApi, batchDeleteSessionContents: batchDeleteSessionContentsApi } = useHttp(requestOptions.url);
69
+ const { getAgentInfo: getAgentInfoApi, clearSession: clearSessionApi, getSessions: getSessionsApi, plusSession: plusSessionApi, modifySession: modifySessionApi, deleteSession: deleteSessionApi, batchDeleteSessions: batchDeleteSessionsApi, getSession: getSessionApi, getSessionContents: getSessionContentsApi, plusSessionContent: plusSessionContentApi, modifySessionContent: modifySessionContentApi, deleteSessionContent: deleteSessionContentApi, batchDeleteSessionContents: batchDeleteSessionContentsApi } = useHttp(requestOptions.url);
70
70
  const startMessage = '内容正在生成中...';
71
71
  // 聊天上下文
72
72
  const currentSession = ref();
@@ -552,6 +552,7 @@ export const useChat = ({ handleStart, handleText, handleReferenceDoc, handleThi
552
552
  reGenerateChat,
553
553
  reSendChat,
554
554
  deleteChat,
555
+ getAgentInfoApi,
555
556
  clearSessionApi,
556
557
  getSessionsApi,
557
558
  plusSessionApi,
@@ -1,5 +1,6 @@
1
1
  import type { ISession, ISessionContent } from '@/types/session';
2
2
  export declare const useHttp: (apiPrefix: string) => {
3
+ getAgentInfo: () => Promise<import("@/types/agent").IAgentInfo>;
3
4
  clearSession: (sessionCode: string) => Promise<unknown>;
4
5
  getSessions: () => Promise<ISession[]>;
5
6
  plusSession: (data: ISession) => Promise<ISession>;
@@ -1,6 +1,9 @@
1
1
  import fetch from '../http/fetch/index.js';
2
2
  import { transferSession2SessionApi, transferSessionApi2Session, transferSessionContent2SessionContentApi, transferSessionContentApi2SessionContent } from '../http/helper/session.js';
3
+ import { transferAgentInfoApi2AgentInfo } from '../http/helper/agent.js';
3
4
  export const useHttp = (apiPrefix)=>{
5
+ // 获取 agent 信息
6
+ const getAgentInfo = ()=>fetch.get(`${apiPrefix}/agent/info/`).then((res)=>transferAgentInfoApi2AgentInfo(res));
4
7
  // 清除聊天上下文
5
8
  const clearSession = (sessionCode)=>fetch.post(`${apiPrefix}/chat_completion/${sessionCode}/clear/`);
6
9
  // 获取会话列表
@@ -32,6 +35,7 @@ export const useHttp = (apiPrefix)=>{
32
35
  ids
33
36
  });
34
37
  return {
38
+ getAgentInfo,
35
39
  clearSession,
36
40
  getSessions,
37
41
  plusSession,
@@ -90,7 +90,7 @@ const getFetchUrl = (url, method, payload = {})=>{
90
90
  // 构造 url 对象
91
91
  const urlObject = new URL(url, baseUrl);
92
92
  // add path
93
- if (urlObject.origin === baseUrl) {
93
+ if (!/https?:\/\//.test(url)) {
94
94
  const configPath = window.SITE_URL || '';
95
95
  const subPath = configPath.endsWith('/') ? configPath.slice(0, -1) : configPath;
96
96
  urlObject.pathname = subPath + urlObject.pathname;
@@ -0,0 +1,7 @@
1
+ import type { IAgentInfoApi, IAgentInfo } from '@/types/agent';
2
+ /**
3
+ * 转换agentapi为agent
4
+ * @param data IAgentInfoApi
5
+ * @returns IAgentInfo
6
+ */
7
+ export declare const transferAgentInfoApi2AgentInfo: (data: IAgentInfoApi) => IAgentInfo;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 转换agentapi为agent
3
+ * @param data IAgentInfoApi
4
+ * @returns IAgentInfo
5
+ */ export const transferAgentInfoApi2AgentInfo = (data)=>({
6
+ openingRemark: data.opening_remark,
7
+ predefinedQuestions: data.predefined_questions
8
+ });
@@ -0,0 +1,8 @@
1
+ export interface IAgentInfoApi {
2
+ opening_remark: string;
3
+ predefined_questions: string[];
4
+ }
5
+ export interface IAgentInfo {
6
+ openingRemark: string;
7
+ predefinedQuestions: string[];
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-ui-sdk",
3
- "version": "0.0.15-beta.16",
3
+ "version": "0.0.15-beta.18",
4
4
  "description": "蓝鲸AI UI SDK",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",