@glodon-aiot/agent-cli-ui 3.3.5-alpha.17 → 3.3.5-alpha.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.
- package/dist/es/Dialog/AgentChat/index.mjs +28 -28
- package/dist/es/ReactTextGenerationUI/components/TextSiders/index.mjs +73 -77
- package/dist/es/packages/agent-cli-ui/package.json.mjs +3 -3
- package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
- package/dist/es/src/style14.css +1 -1
- package/dist/es/src/style15.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/es/src/style8.css +1 -1
- package/dist/es/src/style9.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +37 -37
- package/package.json +3 -3
|
@@ -2,30 +2,30 @@ var Kt = Object.defineProperty, Wt = Object.defineProperties;
|
|
|
2
2
|
var Qt = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var tt = Object.getOwnPropertySymbols;
|
|
4
4
|
var _t = Object.prototype.hasOwnProperty, Gt = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var we = (L, o,
|
|
6
|
-
for (var
|
|
7
|
-
_t.call(o,
|
|
5
|
+
var we = (L, o, k) => o in L ? Kt(L, o, { enumerable: !0, configurable: !0, writable: !0, value: k }) : L[o] = k, nt = (L, o) => {
|
|
6
|
+
for (var k in o || (o = {}))
|
|
7
|
+
_t.call(o, k) && we(L, k, o[k]);
|
|
8
8
|
if (tt)
|
|
9
|
-
for (var
|
|
10
|
-
Gt.call(o,
|
|
9
|
+
for (var k of tt(o))
|
|
10
|
+
Gt.call(o, k) && we(L, k, o[k]);
|
|
11
11
|
return L;
|
|
12
12
|
}, it = (L, o) => Wt(L, Qt(o));
|
|
13
|
-
var D = (L, o,
|
|
14
|
-
var z = (L, o,
|
|
13
|
+
var D = (L, o, k) => (we(L, typeof o != "symbol" ? o + "" : o, k), k);
|
|
14
|
+
var z = (L, o, k) => new Promise((e, x) => {
|
|
15
15
|
var fe = (I) => {
|
|
16
16
|
try {
|
|
17
|
-
H(
|
|
17
|
+
H(k.next(I));
|
|
18
18
|
} catch (h) {
|
|
19
19
|
x(h);
|
|
20
20
|
}
|
|
21
21
|
}, b = (I) => {
|
|
22
22
|
try {
|
|
23
|
-
H(
|
|
23
|
+
H(k.throw(I));
|
|
24
24
|
} catch (h) {
|
|
25
25
|
x(h);
|
|
26
26
|
}
|
|
27
27
|
}, H = (I) => I.done ? e(I.value) : Promise.resolve(I.value).then(fe, b);
|
|
28
|
-
H((
|
|
28
|
+
H((k = k.apply(L, o)).next());
|
|
29
29
|
});
|
|
30
30
|
import { jsx as c, jsxs as A } from "react/jsx-runtime";
|
|
31
31
|
import { memo as Xt, useState as m, useRef as B, useContext as Zt, useEffect as F, useMemo as Jt } from "react";
|
|
@@ -59,7 +59,7 @@ const Ln = Xt(lt), st = {
|
|
|
59
59
|
text: "今天我能帮你什么?"
|
|
60
60
|
};
|
|
61
61
|
class J {
|
|
62
|
-
constructor(o,
|
|
62
|
+
constructor(o, k, e, x) {
|
|
63
63
|
D(this, "messageTime");
|
|
64
64
|
D(this, "isWaiting");
|
|
65
65
|
D(this, "messageId");
|
|
@@ -69,7 +69,7 @@ class J {
|
|
|
69
69
|
D(this, "isSensitive");
|
|
70
70
|
D(this, "isSuspend");
|
|
71
71
|
D(this, "comment");
|
|
72
|
-
this.content = o, this.sessionId =
|
|
72
|
+
this.content = o, this.sessionId = k, this.role = e, this.files = x, this.content = o, this.role = e, this.sessionId = k, this.files = x, this.messageTime = at(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"), this.isWaiting = !1, this.messageId = dt(), this.isContext = !1, this.actions = [], this.reference = [], this.isSensitive = !1, this.isSuspend = !1, this.comment = {
|
|
73
73
|
isAgree: 0
|
|
74
74
|
};
|
|
75
75
|
}
|
|
@@ -78,7 +78,7 @@ const rt = 10, ei = (L) => {
|
|
|
78
78
|
var qe, Ye, Ke, We, Qe, _e, Ge, Xe, Ze, Je, Se;
|
|
79
79
|
const {
|
|
80
80
|
application: o,
|
|
81
|
-
docViewerUrl:
|
|
81
|
+
docViewerUrl: k = "",
|
|
82
82
|
currentSession: e,
|
|
83
83
|
onCreateSession: x,
|
|
84
84
|
embeddingService: fe,
|
|
@@ -185,7 +185,7 @@ const rt = 10, ei = (L) => {
|
|
|
185
185
|
});
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
|
-
if (!(P == null ? void 0 : P.every((
|
|
188
|
+
if (!(P == null ? void 0 : P.every((v) => !!(v != null && v.value))))
|
|
189
189
|
if (f != null && f.promptVariables) {
|
|
190
190
|
u.config({
|
|
191
191
|
getContainer: () => (g == null ? void 0 : g.current) || document.body
|
|
@@ -194,7 +194,7 @@ const rt = 10, ei = (L) => {
|
|
|
194
194
|
});
|
|
195
195
|
return;
|
|
196
196
|
} else
|
|
197
|
-
console.error("变量值不能为空", P == null ? void 0 : P.map((
|
|
197
|
+
console.error("变量值不能为空", P == null ? void 0 : P.map((v) => !!(v != null && v.value)));
|
|
198
198
|
if (ve) {
|
|
199
199
|
u.config({
|
|
200
200
|
getContainer: () => (g == null ? void 0 : g.current) || document.body
|
|
@@ -232,10 +232,10 @@ const rt = 10, ei = (L) => {
|
|
|
232
232
|
if (!i) {
|
|
233
233
|
x == null || x({
|
|
234
234
|
netOpen: H ? 1 : 2
|
|
235
|
-
}).then((
|
|
235
|
+
}).then((v) => {
|
|
236
236
|
var R, $;
|
|
237
|
-
U(!0), I(!!((R =
|
|
238
|
-
b == null || b(
|
|
237
|
+
U(!0), I(!!((R = v.data) != null && R.netOpen)), Q(!!(($ = v.data) != null && $.enableNetOpen)), Ht(v).then(() => {
|
|
238
|
+
b == null || b(v), U(!1), Ie(n);
|
|
239
239
|
});
|
|
240
240
|
});
|
|
241
241
|
return;
|
|
@@ -255,7 +255,7 @@ ${n}` : n;
|
|
|
255
255
|
files: ne[i]
|
|
256
256
|
}
|
|
257
257
|
}) : s = !0;
|
|
258
|
-
} catch (
|
|
258
|
+
} catch (v) {
|
|
259
259
|
s = !1;
|
|
260
260
|
}
|
|
261
261
|
if (le(!1), s === !1)
|
|
@@ -265,7 +265,7 @@ ${n}` : n;
|
|
|
265
265
|
}), Ht = (t) => new Promise((n, r) => z(void 0, null, function* () {
|
|
266
266
|
const s = (t == null ? void 0 : t.promptVariables).filter((d) => !(d.type === ce.User && d.key === "query") && !(d.type === ce.System && d.key === "datetime")).map((d) => {
|
|
267
267
|
var p;
|
|
268
|
-
const w = (p = P.find((
|
|
268
|
+
const w = (p = P.find((v) => v.key === d.key && v.type === d.type)) == null ? void 0 : p.value;
|
|
269
269
|
return d.value = w || "", d;
|
|
270
270
|
});
|
|
271
271
|
re(s.sort((d, w) => d.key.localeCompare(w.key))), yield t == null ? void 0 : t.setPromptVariables(s), n();
|
|
@@ -279,7 +279,7 @@ ${n}` : n;
|
|
|
279
279
|
a.has(p.id) || (i.push(p), a.add(p.id));
|
|
280
280
|
}), Promise.all(i.map((p) => T == null ? void 0 : T.patchApplicationIdKnowledgeIdFileId(o == null ? void 0 : o.id, n, p.id, {
|
|
281
281
|
enabled: 1
|
|
282
|
-
}).then((
|
|
282
|
+
}).then((v) => {
|
|
283
283
|
r.push(p);
|
|
284
284
|
}))).then((p) => {
|
|
285
285
|
se(!0), ke(t, r);
|
|
@@ -316,7 +316,7 @@ ${t}` : t;
|
|
|
316
316
|
};
|
|
317
317
|
}, [ge, e]);
|
|
318
318
|
const ke = (t, n) => z(void 0, null, function* () {
|
|
319
|
-
var p,
|
|
319
|
+
var p, v;
|
|
320
320
|
const r = (p = e == null ? void 0 : e.data) == null ? void 0 : p.id;
|
|
321
321
|
if (!r)
|
|
322
322
|
return;
|
|
@@ -347,7 +347,7 @@ ${t}` : t, a = new J(i, r, G.User, n);
|
|
|
347
347
|
fileIds: d
|
|
348
348
|
}, w), ie({
|
|
349
349
|
[r]: []
|
|
350
|
-
}), (
|
|
350
|
+
}), (v = oe.current) == null || v.update();
|
|
351
351
|
});
|
|
352
352
|
F(() => {
|
|
353
353
|
var r;
|
|
@@ -426,8 +426,8 @@ ${t}` : t, a = new J(i, r, G.User, n);
|
|
|
426
426
|
me(!0), T == null || T.postTicket(a).then((d) => {
|
|
427
427
|
T.uploadMinioFile(d.minio, n).then(() => {
|
|
428
428
|
var R, $;
|
|
429
|
-
const w = (R = d.minio.endpoints) == null ? void 0 : R[0], p = d.minio.bucket,
|
|
430
|
-
i(`${location.protocol}//${w}/${p}/${
|
|
429
|
+
const w = (R = d.minio.endpoints) == null ? void 0 : R[0], p = d.minio.bucket, v = ($ = d.minio.fileKeys) == null ? void 0 : $[0];
|
|
430
|
+
i(`${location.protocol}//${w}/${p}/${v}`);
|
|
431
431
|
}).catch(() => {
|
|
432
432
|
te(""), q(void 0);
|
|
433
433
|
}).finally(() => {
|
|
@@ -547,7 +547,7 @@ ${t}` : t, a = new J(i, r, G.User, n);
|
|
|
547
547
|
).map((a, s) => {
|
|
548
548
|
var w, p;
|
|
549
549
|
let d = "";
|
|
550
|
-
return typeof (l == null ? void 0 : l.promptVariables) == "object" && (d = ((p = (w = l.promptVariables.default) == null ? void 0 : w.find((
|
|
550
|
+
return typeof (l == null ? void 0 : l.promptVariables) == "object" && (d = ((p = (w = l.promptVariables.default) == null ? void 0 : w.find((v) => v.key === a.key && v.type === a.type)) == null ? void 0 : p.value) || ""), {
|
|
551
551
|
id: s + "",
|
|
552
552
|
key: a.key,
|
|
553
553
|
name: a.name,
|
|
@@ -638,7 +638,7 @@ ${t}` : t, a = new J(i, r, G.User, n);
|
|
|
638
638
|
application: o,
|
|
639
639
|
currentSession: e,
|
|
640
640
|
history: t,
|
|
641
|
-
docViewerUrl:
|
|
641
|
+
docViewerUrl: k,
|
|
642
642
|
isLastHistory: n === 0,
|
|
643
643
|
onRelatedClick: At,
|
|
644
644
|
onAgainClick: Bt,
|
|
@@ -779,7 +779,7 @@ ${t}` : t, a = new J(i, r, G.User, n);
|
|
|
779
779
|
appId: o == null ? void 0 : o.id,
|
|
780
780
|
ref: oe,
|
|
781
781
|
isFirstSession: Oe,
|
|
782
|
-
docViewerUrl:
|
|
782
|
+
docViewerUrl: k,
|
|
783
783
|
onStatusChange: (t) => z(void 0, null, function* () {
|
|
784
784
|
t !== "process" ? (se(!0), be()) : se(!1);
|
|
785
785
|
}),
|
|
@@ -1,60 +1,56 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ge = Object.defineProperty, fe = Object.defineProperties;
|
|
2
2
|
var he = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var z = Object.getOwnPropertySymbols;
|
|
4
4
|
var ye = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var J = (a, d, r) => d in a ?
|
|
5
|
+
var J = (a, d, r) => d in a ? ge(a, d, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[d] = r, W = (a, d) => {
|
|
6
6
|
for (var r in d || (d = {}))
|
|
7
7
|
ye.call(d, r) && J(a, r, d[r]);
|
|
8
8
|
if (z)
|
|
9
9
|
for (var r of z(d))
|
|
10
10
|
Ie.call(d, r) && J(a, r, d[r]);
|
|
11
11
|
return a;
|
|
12
|
-
}, G = (a, d) =>
|
|
13
|
-
var R = (a, d, r) => new Promise((C,
|
|
14
|
-
var
|
|
12
|
+
}, G = (a, d) => fe(a, he(d));
|
|
13
|
+
var R = (a, d, r) => new Promise((C, N) => {
|
|
14
|
+
var S = (h) => {
|
|
15
15
|
try {
|
|
16
|
-
I(r.next(
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
I(r.next(h));
|
|
17
|
+
} catch (v) {
|
|
18
|
+
N(v);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, T = (h) => {
|
|
21
21
|
try {
|
|
22
|
-
I(r.throw(
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
I(r.throw(h));
|
|
23
|
+
} catch (v) {
|
|
24
|
+
N(v);
|
|
25
25
|
}
|
|
26
|
-
}, I = (
|
|
26
|
+
}, I = (h) => h.done ? C(h.value) : Promise.resolve(h.value).then(S, T);
|
|
27
27
|
I((r = r.apply(a, d)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsxs as x, jsx as l, Fragment as
|
|
30
|
-
import { useState as
|
|
31
|
-
import { Form as
|
|
29
|
+
import { jsxs as x, jsx as l, Fragment as ke } from "react/jsx-runtime";
|
|
30
|
+
import { useState as g, useRef as ve, useContext as Se, useEffect as w } from "react";
|
|
31
|
+
import { Form as A, Collapse as X, Input as B, Button as be, message as P, notification as xe } from "antd";
|
|
32
32
|
import { PromptVariableType as m } from "@glodon-aiot/apis";
|
|
33
33
|
import { v4 as Pe } from "uuid";
|
|
34
34
|
import Ce from "../../../context.mjs";
|
|
35
|
-
import
|
|
35
|
+
import pe from "../../../components/KnowledgeList/KnowledgeSelect/index.mjs";
|
|
36
36
|
import "../../../packages/react-components/dist/es/index.mjs";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
/* empty css */import { fetchEventSource as
|
|
40
|
-
import { Markdown as
|
|
37
|
+
import we from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
|
|
38
|
+
import Ne from "../../../node_modules/moment/dist/moment.mjs";
|
|
39
|
+
/* empty css */import { fetchEventSource as Te } from "../fetchEventSource/fetch.mjs";
|
|
40
|
+
import { Markdown as Ve } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
|
|
41
41
|
const {
|
|
42
42
|
Panel: Q
|
|
43
|
-
} = X,
|
|
43
|
+
} = X, je = ({
|
|
44
44
|
application: a,
|
|
45
45
|
sessionId: d
|
|
46
46
|
}) => {
|
|
47
|
-
const r = a.id, [C,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
service: S,
|
|
51
|
-
agentClient: h,
|
|
52
|
-
beforeMessageSend: Ve,
|
|
47
|
+
const r = a.id, [C, N] = g(""), [S, T] = g(""), [I, h] = g(), [v, p] = g(!1), D = ve(null), [F, Z] = g([]), [V, H] = g([]), [_, K] = g(0), [ee, O] = g(), [c, M] = g(), [Y] = A.useForm(), [U, te] = g({}), [q, se] = g({}), [re, ne] = g(0), {
|
|
48
|
+
service: k,
|
|
49
|
+
agentClient: y,
|
|
53
50
|
popupContainer: b,
|
|
54
|
-
icon: Ae,
|
|
55
51
|
token: ae,
|
|
56
52
|
apiUrl: oe
|
|
57
|
-
} =
|
|
53
|
+
} = Se(Ce), le = (e, o, i, t) => {
|
|
58
54
|
const s = {
|
|
59
55
|
messageId: Pe(),
|
|
60
56
|
content: "",
|
|
@@ -67,7 +63,7 @@ const {
|
|
|
67
63
|
}, n = G(W({}, i), {
|
|
68
64
|
stream: !0
|
|
69
65
|
});
|
|
70
|
-
|
|
66
|
+
Te(`${oe}/chat/v2/chat?applicationId=${e}&sessionId=${o}`, {
|
|
71
67
|
method: "POST",
|
|
72
68
|
headers: {
|
|
73
69
|
Authorization: `Bearer ${ae}`,
|
|
@@ -89,13 +85,13 @@ const {
|
|
|
89
85
|
reference: s.reference,
|
|
90
86
|
messageId: s.messageId,
|
|
91
87
|
sessionId: o,
|
|
92
|
-
messageTime:
|
|
88
|
+
messageTime: Ne(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
93
89
|
searchReference: []
|
|
94
90
|
};
|
|
95
91
|
return (t == null ? void 0 : t.onmessage) && t.onmessage(L);
|
|
96
92
|
}
|
|
97
|
-
const
|
|
98
|
-
if (s.reference =
|
|
93
|
+
const f = JSON.parse(u.data);
|
|
94
|
+
if (s.reference = f.data.reference, s.messageTime = f.data.messageTime, s.messageId = f.data.messageId, s.llmModel = f.data.llmModel, s.content = f.data.content, s.code = f.code, f.code === 200) {
|
|
99
95
|
const L = {
|
|
100
96
|
code: s.code,
|
|
101
97
|
content: s.content,
|
|
@@ -109,7 +105,7 @@ const {
|
|
|
109
105
|
t != null && t.onmessage && t.onmessage(L);
|
|
110
106
|
} else
|
|
111
107
|
return xe.error({
|
|
112
|
-
message:
|
|
108
|
+
message: f.message
|
|
113
109
|
});
|
|
114
110
|
},
|
|
115
111
|
onerror() {
|
|
@@ -134,7 +130,7 @@ const {
|
|
|
134
130
|
}
|
|
135
131
|
});
|
|
136
132
|
};
|
|
137
|
-
|
|
133
|
+
w(() => {
|
|
138
134
|
if (!(a != null && a.id))
|
|
139
135
|
return;
|
|
140
136
|
const e = a.arrange;
|
|
@@ -144,27 +140,27 @@ const {
|
|
|
144
140
|
Z(i), K(i.length);
|
|
145
141
|
const t = i.map((s) => s.id);
|
|
146
142
|
H(t);
|
|
147
|
-
}, [a]),
|
|
148
|
-
if (!(a != null && a.id) || !
|
|
143
|
+
}, [a]), w(() => {
|
|
144
|
+
if (!(a != null && a.id) || !y)
|
|
149
145
|
return;
|
|
150
|
-
const e =
|
|
146
|
+
const e = y.questionContextMaxLength || 4e3;
|
|
151
147
|
ne(e), ce();
|
|
152
|
-
}, [a,
|
|
148
|
+
}, [a, y]);
|
|
153
149
|
const ce = () => R(void 0, null, function* () {
|
|
154
|
-
if (!
|
|
150
|
+
if (!k || !r)
|
|
155
151
|
return;
|
|
156
|
-
const e = yield
|
|
152
|
+
const e = yield k.postApplicationIdSession({
|
|
157
153
|
name: "AI 会话",
|
|
158
154
|
applicationId: r
|
|
159
155
|
});
|
|
160
156
|
debugger;
|
|
161
157
|
O(e);
|
|
162
158
|
});
|
|
163
|
-
|
|
164
|
-
!r || !
|
|
159
|
+
w(() => {
|
|
160
|
+
!r || !k || Promise.all([k.getApplicationIdPromptVariables(r, {
|
|
165
161
|
type: m.User,
|
|
166
162
|
status: 1
|
|
167
|
-
}),
|
|
163
|
+
}), k.getApplicationIdPromptVariables(r, {
|
|
168
164
|
type: m.System,
|
|
169
165
|
status: 1
|
|
170
166
|
})]).then(([e, o]) => {
|
|
@@ -175,9 +171,9 @@ const {
|
|
|
175
171
|
value: "",
|
|
176
172
|
type: n.type
|
|
177
173
|
}));
|
|
178
|
-
|
|
174
|
+
M(s);
|
|
179
175
|
});
|
|
180
|
-
}, [
|
|
176
|
+
}, [k, r]), w(() => {
|
|
181
177
|
if (!c)
|
|
182
178
|
return;
|
|
183
179
|
const e = c.filter((s) => s.type === m.User), o = c.filter((s) => s.type === m.System), i = {};
|
|
@@ -194,11 +190,11 @@ const {
|
|
|
194
190
|
}, [c]);
|
|
195
191
|
const de = (e, o) => {
|
|
196
192
|
}, ie = (e) => {
|
|
197
|
-
|
|
193
|
+
N(e.target.value);
|
|
198
194
|
}, me = () => R(void 0, null, function* () {
|
|
199
|
-
if (
|
|
195
|
+
if (p(!0), !r || !k || !y)
|
|
200
196
|
return;
|
|
201
|
-
|
|
197
|
+
p(!1);
|
|
202
198
|
for (const t in U)
|
|
203
199
|
U[t] || (P.config({
|
|
204
200
|
getContainer: () => (b == null ? void 0 : b.current) || document.body
|
|
@@ -211,13 +207,13 @@ const {
|
|
|
211
207
|
}), P.error("变量值不能为空"), P.config({
|
|
212
208
|
getContainer: void 0
|
|
213
209
|
}));
|
|
214
|
-
const e = yield
|
|
210
|
+
const e = yield k.postApplicationIdSession({
|
|
215
211
|
name: "AI 会话",
|
|
216
212
|
applicationId: r
|
|
217
213
|
});
|
|
218
214
|
debugger;
|
|
219
215
|
O(e);
|
|
220
|
-
const o =
|
|
216
|
+
const o = V == null ? void 0 : V.map((t) => t.toString()), i = {
|
|
221
217
|
content: C,
|
|
222
218
|
chatMode: 1,
|
|
223
219
|
knowledges: o,
|
|
@@ -226,42 +222,42 @@ const {
|
|
|
226
222
|
};
|
|
227
223
|
le(r, e.id, i, {
|
|
228
224
|
onmessage: (t) => {
|
|
229
|
-
|
|
225
|
+
p(!0), h(void 0), T(t.content);
|
|
230
226
|
},
|
|
231
227
|
onclose: (t) => {
|
|
232
|
-
|
|
228
|
+
p(!1), t.code == 200 && (T(t.content), h(t));
|
|
233
229
|
},
|
|
234
230
|
onerror: () => {
|
|
235
|
-
|
|
231
|
+
p(!1);
|
|
236
232
|
}
|
|
237
|
-
}), c &&
|
|
233
|
+
}), c && k.getApplicationIdSessionIdPromptVariables(r, e.id).then((t) => {
|
|
238
234
|
const s = t.filter((n) => !(n.type === m.User && n.key === "query") && !(n.type === m.System && n.key === "datetime")).map((n) => {
|
|
239
|
-
const u = c.filter((
|
|
235
|
+
const u = c.filter((f) => f.key === n.key && f.type === n.type);
|
|
240
236
|
return n.value = u[0].value, n;
|
|
241
237
|
});
|
|
242
238
|
Promise.all(s.map((n) => {
|
|
243
239
|
de(n.id, n.value);
|
|
244
|
-
})),
|
|
240
|
+
})), M(s);
|
|
245
241
|
});
|
|
246
242
|
});
|
|
247
|
-
|
|
248
|
-
if (!
|
|
243
|
+
w(() => {
|
|
244
|
+
if (!S)
|
|
249
245
|
return;
|
|
250
246
|
const e = D.current;
|
|
251
247
|
e && (e.scrollTop = e.scrollHeight);
|
|
252
|
-
}, [
|
|
248
|
+
}, [S]);
|
|
253
249
|
const ue = (e) => {
|
|
254
250
|
H(e), K(e.length);
|
|
255
251
|
}, $ = (e, o) => {
|
|
256
252
|
c && (c.map((i) => {
|
|
257
253
|
i.id === e && (i.value = o.target.value);
|
|
258
|
-
}),
|
|
254
|
+
}), M([...c]));
|
|
259
255
|
}, j = (c == null ? void 0 : c.filter((e) => e.type === m.System)) || [], E = (c == null ? void 0 : c.filter((e) => e.type === m.User)) || [];
|
|
260
256
|
return /* @__PURE__ */ x("div", {
|
|
261
257
|
className: "text-main",
|
|
262
258
|
children: [/* @__PURE__ */ x("div", {
|
|
263
259
|
className: "text-left-sider",
|
|
264
|
-
children: [(c == null ? void 0 : c.length) && /* @__PURE__ */ l(
|
|
260
|
+
children: [(c == null ? void 0 : c.length) && /* @__PURE__ */ l(A, {
|
|
265
261
|
autoComplete: "off",
|
|
266
262
|
form: Y,
|
|
267
263
|
labelWrap: !0,
|
|
@@ -279,7 +275,7 @@ const {
|
|
|
279
275
|
defaultActiveKey: [m.System, m.User],
|
|
280
276
|
children: [j.length && /* @__PURE__ */ l(Q, {
|
|
281
277
|
header: "角色设定变量",
|
|
282
|
-
children: j.map((e) => /* @__PURE__ */ l(
|
|
278
|
+
children: j.map((e) => /* @__PURE__ */ l(A.Item, {
|
|
283
279
|
label: e.name,
|
|
284
280
|
name: ["systemPrompts", e.key],
|
|
285
281
|
style: {
|
|
@@ -291,13 +287,13 @@ const {
|
|
|
291
287
|
}],
|
|
292
288
|
children: /* @__PURE__ */ l(B, {
|
|
293
289
|
placeholder: "请输入",
|
|
294
|
-
maxLength:
|
|
290
|
+
maxLength: y == null ? void 0 : y.questionContextMaxLength,
|
|
295
291
|
onBlur: (o) => $(e.id, o)
|
|
296
292
|
})
|
|
297
293
|
}, e.key))
|
|
298
294
|
}, m.System), E.length && /* @__PURE__ */ l(Q, {
|
|
299
295
|
header: "用户指令变量",
|
|
300
|
-
children: E.map((e) => /* @__PURE__ */ l(
|
|
296
|
+
children: E.map((e) => /* @__PURE__ */ l(A.Item, {
|
|
301
297
|
label: e.name,
|
|
302
298
|
name: ["userPrompts", e.key],
|
|
303
299
|
style: {
|
|
@@ -309,7 +305,7 @@ const {
|
|
|
309
305
|
}],
|
|
310
306
|
children: /* @__PURE__ */ l(B, {
|
|
311
307
|
placeholder: "请输入",
|
|
312
|
-
maxLength:
|
|
308
|
+
maxLength: y == null ? void 0 : y.questionContextMaxLength,
|
|
313
309
|
onBlur: (o) => $(e.id, o)
|
|
314
310
|
})
|
|
315
311
|
}, e.key))
|
|
@@ -320,8 +316,8 @@ const {
|
|
|
320
316
|
children: [/* @__PURE__ */ l("span", {
|
|
321
317
|
className: "header-title",
|
|
322
318
|
children: "文本生成输入"
|
|
323
|
-
}), F.length !== 0 && /* @__PURE__ */ l(
|
|
324
|
-
checkedValues:
|
|
319
|
+
}), F.length !== 0 && /* @__PURE__ */ l(pe, {
|
|
320
|
+
checkedValues: V,
|
|
325
321
|
currKnowledgeList: F,
|
|
326
322
|
selectCount: _,
|
|
327
323
|
onSelectChange: ue,
|
|
@@ -345,11 +341,11 @@ const {
|
|
|
345
341
|
className: "left-input"
|
|
346
342
|
}), /* @__PURE__ */ l(be, {
|
|
347
343
|
type: "primary",
|
|
348
|
-
disabled: !C ||
|
|
344
|
+
disabled: !C || v,
|
|
349
345
|
onClick: me,
|
|
350
346
|
className: "sider-btn",
|
|
351
|
-
loading:
|
|
352
|
-
children:
|
|
347
|
+
loading: v,
|
|
348
|
+
children: v ? "生成中" : "确认生成"
|
|
353
349
|
})]
|
|
354
350
|
})
|
|
355
351
|
})]
|
|
@@ -360,10 +356,10 @@ const {
|
|
|
360
356
|
children: /* @__PURE__ */ l("div", {
|
|
361
357
|
className: "sider-text",
|
|
362
358
|
ref: D,
|
|
363
|
-
children:
|
|
364
|
-
children: [/* @__PURE__ */ l(
|
|
365
|
-
children:
|
|
366
|
-
}), I && (I == null ? void 0 : I.reference.length) !== 0 && /* @__PURE__ */ l(
|
|
359
|
+
children: S ? /* @__PURE__ */ x(ke, {
|
|
360
|
+
children: [/* @__PURE__ */ l(Ve, {
|
|
361
|
+
children: S
|
|
362
|
+
}), I && (I == null ? void 0 : I.reference.length) !== 0 && /* @__PURE__ */ l(we, {
|
|
367
363
|
history: I,
|
|
368
364
|
docViewerUrl: ""
|
|
369
365
|
})]
|
|
@@ -379,5 +375,5 @@ const {
|
|
|
379
375
|
});
|
|
380
376
|
};
|
|
381
377
|
export {
|
|
382
|
-
|
|
378
|
+
je as default
|
|
383
379
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.
|
|
1
|
+
const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.18", s = "./dist/es/index.mjs", i = "./dist/lib/index.js", o = "./dist/src/index.d.ts", n = {
|
|
2
2
|
import: "./dist/es/index.mjs",
|
|
3
3
|
require: "./dist/lib/index.js",
|
|
4
4
|
types: "./dist/src/index.d.ts"
|
|
@@ -22,8 +22,8 @@ const e = "@glodon-aiot/agent-cli-ui", t = "3.3.5-alpha.17", s = "./dist/es/inde
|
|
|
22
22
|
webpack: "*"
|
|
23
23
|
}, p = {
|
|
24
24
|
"@ant-design/icons": "^5.3.4",
|
|
25
|
-
"@glodon-aiot/apis": "^3.3.5-alpha.
|
|
26
|
-
"@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.
|
|
25
|
+
"@glodon-aiot/apis": "^3.3.5-alpha.18",
|
|
26
|
+
"@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.18",
|
|
27
27
|
"@matejmazur/react-mathjax": "^0.1.10",
|
|
28
28
|
"@react-pdf-viewer/core": "^3.12.0",
|
|
29
29
|
"@react-pdf-viewer/default-layout": "^3.12.0",
|