@glodon-aiot/agent-cli-ui 3.3.5-alpha.19 → 3.3.5-alpha.20
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/ReactTextGenerationUI/components/TextSiders/index.mjs +184 -182
- package/dist/es/ReactTextGenerationUI/index.mjs +14 -12
- 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/style10.css +1 -1
- package/dist/es/src/style11.css +1 -1
- package/dist/es/src/style12.css +1 -1
- package/dist/es/src/style13.css +1 -1
- package/dist/es/src/style16.css +1 -1
- package/dist/es/src/style17.css +1 -1
- package/dist/es/src/style18.css +1 -1
- package/dist/es/src/style19.css +1 -1
- package/dist/es/src/style20.css +1 -1
- package/dist/es/src/style22.css +1 -1
- package/dist/es/src/style23.css +1 -1
- package/dist/es/src/style24.css +1 -1
- package/dist/es/src/style25.css +1 -1
- package/dist/es/src/style27.css +1 -1
- package/dist/es/src/style28.css +1 -1
- package/dist/es/src/style29.css +1 -1
- package/dist/es/src/style30.css +1 -1
- package/dist/es/src/style4.css +1 -1
- package/dist/es/src/style5.css +1 -1
- package/dist/es/src/style6.css +1 -1
- package/dist/es/src/style7.css +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/index.js +38 -38
- package/dist/src/ReactTextGenerationUI/components/TextSiders/index.d.ts +1 -0
- package/dist/src/utils/reactCompatibility.d.ts +27 -0
- package/package.json +3 -3
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
1
|
+
var ge = Object.defineProperty, he = Object.defineProperties;
|
|
2
|
+
var ye = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var G = Object.getOwnPropertySymbols;
|
|
4
|
+
var Ie = Object.prototype.hasOwnProperty, ke = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Q = (n, i, l) => i in n ? ge(n, i, { enumerable: !0, configurable: !0, writable: !0, value: l }) : n[i] = l, A = (n, i) => {
|
|
6
|
+
for (var l in i || (i = {}))
|
|
7
|
+
Ie.call(i, l) && Q(n, l, i[l]);
|
|
8
|
+
if (G)
|
|
9
|
+
for (var l of G(i))
|
|
10
|
+
ke.call(i, l) && Q(n, l, i[l]);
|
|
11
|
+
return n;
|
|
12
|
+
}, X = (n, i) => he(n, ye(i));
|
|
13
|
+
var V = (n, i, l) => new Promise((u, S) => {
|
|
14
|
+
var U = (g) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
17
|
-
} catch (
|
|
18
|
-
|
|
16
|
+
v(l.next(g));
|
|
17
|
+
} catch (x) {
|
|
18
|
+
S(x);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, p = (g) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
23
|
-
} catch (
|
|
24
|
-
|
|
22
|
+
v(l.throw(g));
|
|
23
|
+
} catch (x) {
|
|
24
|
+
S(x);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, v = (g) => g.done ? u(g.value) : Promise.resolve(g.value).then(U, p);
|
|
27
|
+
v((l = l.apply(n, i)).next());
|
|
28
28
|
});
|
|
29
|
-
import { jsxs as
|
|
30
|
-
import { useState as
|
|
31
|
-
import { Form as
|
|
32
|
-
import { PromptVariableType as
|
|
29
|
+
import { jsxs as P, jsx as a, Fragment as Se } from "react/jsx-runtime";
|
|
30
|
+
import { useState as y, useRef as pe, useContext as ve, useEffect as w } from "react";
|
|
31
|
+
import { Form as M, Collapse as _, Input as K, Button as xe, message as C, notification as be } from "antd";
|
|
32
|
+
import { PromptVariableType as f } from "@glodon-aiot/apis";
|
|
33
33
|
import { v4 as Pe } from "uuid";
|
|
34
|
-
import
|
|
35
|
-
import
|
|
34
|
+
import Ce from "../../../context.mjs";
|
|
35
|
+
import we 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
|
|
37
|
+
import Ne from "../../../Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs";
|
|
38
|
+
import Te from "../../../node_modules/moment/dist/moment.mjs";
|
|
39
|
+
/* empty css */import { fetchEventSource as Ae } from "../fetchEventSource/fetch.mjs";
|
|
40
40
|
import { Markdown as Ve } from "../../../packages/react-components/dist/es/components/Markdown/index.mjs";
|
|
41
41
|
const {
|
|
42
|
-
Panel:
|
|
43
|
-
} =
|
|
44
|
-
application:
|
|
45
|
-
sessionId:
|
|
42
|
+
Panel: Z
|
|
43
|
+
} = _, Ee = ({
|
|
44
|
+
application: n,
|
|
45
|
+
sessionId: i,
|
|
46
|
+
docViewerUrl: l
|
|
46
47
|
}) => {
|
|
47
|
-
const
|
|
48
|
-
service:
|
|
49
|
-
agentClient:
|
|
48
|
+
const u = n.id, [S, U] = y(""), [p, v] = y(""), [g, x] = y(), [q, N] = y(!1), D = pe(null), [H, ee] = y([]), [T, O] = y([]), [te, Y] = y(0), [$, j] = y(), [c, L] = y(), [E] = M.useForm(), [R, re] = y({}), [B, se] = y({}), [ne, oe] = y(0), {
|
|
49
|
+
service: h,
|
|
50
|
+
agentClient: k,
|
|
50
51
|
popupContainer: b,
|
|
51
52
|
token: ae,
|
|
52
|
-
apiUrl:
|
|
53
|
-
} =
|
|
53
|
+
apiUrl: ce
|
|
54
|
+
} = ve(Ce), le = (e, o, m, t) => {
|
|
54
55
|
const r = {
|
|
55
56
|
messageId: Pe(),
|
|
56
57
|
content: "",
|
|
@@ -60,10 +61,10 @@ const {
|
|
|
60
61
|
messageTime: "",
|
|
61
62
|
llmModel: "",
|
|
62
63
|
searchReference: []
|
|
63
|
-
}, s =
|
|
64
|
+
}, s = X(A({}, m), {
|
|
64
65
|
stream: !0
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
Ae(`${ce}/chat/v2/chat?applicationId=${e}&sessionId=${o}`, {
|
|
67
68
|
method: "POST",
|
|
68
69
|
headers: {
|
|
69
70
|
Authorization: `Bearer ${ae}`,
|
|
@@ -71,28 +72,28 @@ const {
|
|
|
71
72
|
},
|
|
72
73
|
body: JSON.stringify(s),
|
|
73
74
|
openWhenHidden: !0,
|
|
74
|
-
onopen(
|
|
75
|
-
return console.log("onopen"),
|
|
75
|
+
onopen(d) {
|
|
76
|
+
return console.log("onopen"), d.ok && t != null && t.onopen && t.onopen(), Promise.resolve();
|
|
76
77
|
},
|
|
77
|
-
onmessage(
|
|
78
|
-
if (!
|
|
78
|
+
onmessage(d) {
|
|
79
|
+
if (!d.id && !d.data && !d.event && !d.retry)
|
|
79
80
|
return;
|
|
80
|
-
if (!
|
|
81
|
-
r.content = r.content +
|
|
82
|
-
const
|
|
81
|
+
if (!d.data.includes('{"code": ')) {
|
|
82
|
+
r.content = r.content + d.data;
|
|
83
|
+
const F = {
|
|
83
84
|
content: r.content,
|
|
84
85
|
role: 1,
|
|
85
86
|
reference: r.reference,
|
|
86
87
|
messageId: r.messageId,
|
|
87
88
|
sessionId: o,
|
|
88
|
-
messageTime:
|
|
89
|
+
messageTime: Te(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
89
90
|
searchReference: []
|
|
90
91
|
};
|
|
91
|
-
return (t == null ? void 0 : t.onmessage) && t.onmessage(
|
|
92
|
+
return (t == null ? void 0 : t.onmessage) && t.onmessage(F);
|
|
92
93
|
}
|
|
93
|
-
const
|
|
94
|
-
if (r.reference =
|
|
95
|
-
const
|
|
94
|
+
const I = JSON.parse(d.data);
|
|
95
|
+
if (r.reference = I.data.reference, r.messageTime = I.data.messageTime, r.messageId = I.data.messageId, r.llmModel = I.data.llmModel, r.content = I.data.content, r.code = I.code, I.code === 200) {
|
|
96
|
+
const F = {
|
|
96
97
|
code: r.code,
|
|
97
98
|
content: r.content,
|
|
98
99
|
role: 1,
|
|
@@ -102,10 +103,10 @@ const {
|
|
|
102
103
|
messageTime: r.messageTime,
|
|
103
104
|
searchReference: []
|
|
104
105
|
};
|
|
105
|
-
t != null && t.onmessage && t.onmessage(
|
|
106
|
+
t != null && t.onmessage && t.onmessage(F);
|
|
106
107
|
} else
|
|
107
|
-
return
|
|
108
|
-
message:
|
|
108
|
+
return be.error({
|
|
109
|
+
message: I.message
|
|
109
110
|
});
|
|
110
111
|
},
|
|
111
112
|
onerror() {
|
|
@@ -113,7 +114,7 @@ const {
|
|
|
113
114
|
},
|
|
114
115
|
onclose() {
|
|
115
116
|
console.log("onclose");
|
|
116
|
-
const
|
|
117
|
+
const d = {
|
|
117
118
|
code: r.code,
|
|
118
119
|
content: r.content,
|
|
119
120
|
role: 1,
|
|
@@ -126,144 +127,145 @@ const {
|
|
|
126
127
|
},
|
|
127
128
|
searchReference: []
|
|
128
129
|
};
|
|
129
|
-
t != null && t.onclose && t.onclose(
|
|
130
|
+
t != null && t.onclose && t.onclose(d);
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
};
|
|
133
134
|
w(() => {
|
|
134
|
-
if (!(
|
|
135
|
+
if (!(n != null && n.id))
|
|
135
136
|
return;
|
|
136
|
-
const e =
|
|
137
|
+
const e = n.arrange;
|
|
137
138
|
if (!(e != null && e.length))
|
|
138
139
|
return;
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
const t =
|
|
142
|
-
|
|
143
|
-
}, [
|
|
144
|
-
if (!(
|
|
140
|
+
const m = e[0].knowledges || [];
|
|
141
|
+
ee(m), Y(m.length);
|
|
142
|
+
const t = m.map((r) => r.id);
|
|
143
|
+
O(t);
|
|
144
|
+
}, [n]), w(() => {
|
|
145
|
+
if (!(n != null && n.id) || !k)
|
|
145
146
|
return;
|
|
146
|
-
const e =
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
const
|
|
150
|
-
if (!
|
|
147
|
+
const e = k.questionContextMaxLength || 4e3;
|
|
148
|
+
oe(e), de();
|
|
149
|
+
}, [n, k]);
|
|
150
|
+
const de = () => V(void 0, null, function* () {
|
|
151
|
+
if (!h || !u)
|
|
151
152
|
return;
|
|
152
|
-
const e = yield
|
|
153
|
+
const e = yield h.postApplicationIdSession({
|
|
153
154
|
name: "AI 会话",
|
|
154
|
-
applicationId:
|
|
155
|
+
applicationId: u
|
|
155
156
|
});
|
|
156
|
-
|
|
157
|
-
Y(e);
|
|
157
|
+
j(e);
|
|
158
158
|
});
|
|
159
159
|
w(() => {
|
|
160
|
-
!
|
|
161
|
-
type:
|
|
160
|
+
!u || !h || Promise.all([h.getApplicationIdPromptVariables(u, {
|
|
161
|
+
type: f.User,
|
|
162
162
|
status: 1
|
|
163
|
-
}),
|
|
164
|
-
type:
|
|
163
|
+
}), h.getApplicationIdPromptVariables(u, {
|
|
164
|
+
type: f.System,
|
|
165
165
|
status: 1
|
|
166
166
|
})]).then(([e, o]) => {
|
|
167
|
-
const r = [...e, ...o].filter((s) => !(s.type ===
|
|
167
|
+
const r = [...e, ...o].filter((s) => !(s.type === f.User && s.key === "query") && !(s.type === f.System && s.key === "datetime")).map((s) => ({
|
|
168
168
|
id: s.id,
|
|
169
169
|
key: s.key,
|
|
170
170
|
name: s.name,
|
|
171
171
|
value: "",
|
|
172
172
|
type: s.type
|
|
173
173
|
}));
|
|
174
|
-
|
|
174
|
+
L(r);
|
|
175
175
|
});
|
|
176
|
-
}, [
|
|
176
|
+
}, [h, u]), w(() => {
|
|
177
177
|
if (!c)
|
|
178
178
|
return;
|
|
179
|
-
const e = c.filter((r) => r.type ===
|
|
179
|
+
const e = c.filter((r) => r.type === f.User), o = c.filter((r) => r.type === f.System), m = {};
|
|
180
180
|
e == null || e.map((r) => {
|
|
181
|
-
r.key && (
|
|
181
|
+
r.key && (m[r.key] = r.value);
|
|
182
182
|
});
|
|
183
183
|
const t = {};
|
|
184
184
|
o == null || o.map((r) => {
|
|
185
185
|
r.key && (t[r.key] = r.value);
|
|
186
|
-
}),
|
|
187
|
-
userPrompts:
|
|
186
|
+
}), E.setFieldsValue({
|
|
187
|
+
userPrompts: m,
|
|
188
188
|
systemPrompts: t
|
|
189
|
-
}),
|
|
189
|
+
}), re(m), se(t);
|
|
190
190
|
}, [c]);
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
const ie = (e, o) => {
|
|
192
|
+
!$ || !u || !h || h.patchApplicationIdSessionpromptVariablesId(u, $.id, e, {
|
|
193
|
+
value: o
|
|
194
|
+
});
|
|
195
|
+
}, me = (e) => {
|
|
196
|
+
U(e.target.value);
|
|
197
|
+
}, ue = () => V(void 0, null, function* () {
|
|
198
|
+
if (!u || !h || !k)
|
|
196
199
|
return;
|
|
197
|
-
|
|
198
|
-
for (const t in
|
|
199
|
-
|
|
200
|
+
N(!0);
|
|
201
|
+
for (const t in R)
|
|
202
|
+
R[t] || (C.config({
|
|
200
203
|
getContainer: () => (b == null ? void 0 : b.current) || document.body
|
|
201
|
-
}),
|
|
204
|
+
}), C.error("变量值不能为空"), C.config({
|
|
202
205
|
getContainer: void 0
|
|
203
206
|
}));
|
|
204
|
-
for (const t in
|
|
205
|
-
|
|
207
|
+
for (const t in B)
|
|
208
|
+
B[t] || (C.config({
|
|
206
209
|
getContainer: () => (b == null ? void 0 : b.current) || document.body
|
|
207
|
-
}),
|
|
210
|
+
}), C.error("变量值不能为空"), C.config({
|
|
208
211
|
getContainer: void 0
|
|
209
212
|
}));
|
|
210
|
-
const e = yield
|
|
213
|
+
const e = yield h.postApplicationIdSession({
|
|
211
214
|
name: "AI 会话",
|
|
212
|
-
applicationId:
|
|
215
|
+
applicationId: u
|
|
213
216
|
});
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
content: p,
|
|
217
|
+
j(e);
|
|
218
|
+
const o = T == null ? void 0 : T.map((t) => t.toString()), m = {
|
|
219
|
+
content: S,
|
|
218
220
|
chatMode: 1,
|
|
219
221
|
knowledges: o,
|
|
220
|
-
promptVariables:
|
|
221
|
-
systemPromptVariables:
|
|
222
|
+
promptVariables: R,
|
|
223
|
+
systemPromptVariables: B
|
|
222
224
|
};
|
|
223
|
-
le(
|
|
225
|
+
le(u, e.id, m, {
|
|
224
226
|
onmessage: (t) => {
|
|
225
|
-
|
|
227
|
+
N(!0), x(void 0), v(t.content);
|
|
226
228
|
},
|
|
227
|
-
onclose: (t) =>
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
const r = yield Promise.all(t.reference.map((s) =>
|
|
231
|
-
t.reference = t.reference.map((s,
|
|
229
|
+
onclose: (t) => V(void 0, null, function* () {
|
|
230
|
+
if (N(!1), t.code == 200) {
|
|
231
|
+
v(t.content);
|
|
232
|
+
const r = yield Promise.all(t.reference.map((s) => h.getKnowledgeIdFileId(s.knowledgeId, s.docId)));
|
|
233
|
+
t.reference = t.reference.map((s, d) => A(A({}, s), r[d])), x(t);
|
|
232
234
|
}
|
|
233
235
|
}),
|
|
234
236
|
onerror: () => {
|
|
235
|
-
|
|
237
|
+
N(!1);
|
|
236
238
|
}
|
|
237
|
-
}), c &&
|
|
238
|
-
const r = t.filter((s) => !(s.type ===
|
|
239
|
-
const
|
|
240
|
-
return s.value =
|
|
239
|
+
}), c && h.getApplicationIdSessionIdPromptVariables(u, e.id).then((t) => {
|
|
240
|
+
const r = t.filter((s) => !(s.type === f.User && s.key === "query") && !(s.type === f.System && s.key === "datetime")).map((s) => {
|
|
241
|
+
const d = c.find((I) => I.key === s.key && I.type === s.type);
|
|
242
|
+
return s.value = (d == null ? void 0 : d.value) || "", s;
|
|
241
243
|
});
|
|
242
244
|
Promise.all(r.map((s) => {
|
|
243
|
-
|
|
244
|
-
})),
|
|
245
|
+
ie(s.id, s.value);
|
|
246
|
+
})), L(r);
|
|
245
247
|
});
|
|
246
248
|
});
|
|
247
249
|
w(() => {
|
|
248
|
-
if (!
|
|
250
|
+
if (!p)
|
|
249
251
|
return;
|
|
250
|
-
const e =
|
|
252
|
+
const e = D.current;
|
|
251
253
|
e && (e.scrollTop = e.scrollHeight);
|
|
252
|
-
}, [
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
c && (c.map((
|
|
257
|
-
|
|
258
|
-
}),
|
|
259
|
-
},
|
|
260
|
-
return /* @__PURE__ */
|
|
254
|
+
}, [p]);
|
|
255
|
+
const fe = (e) => {
|
|
256
|
+
O(e), Y(e.length);
|
|
257
|
+
}, z = (e, o) => {
|
|
258
|
+
c && (c.map((m) => {
|
|
259
|
+
m.id === e && (m.value = o.target.value);
|
|
260
|
+
}), L([...c]));
|
|
261
|
+
}, J = (c == null ? void 0 : c.filter((e) => e.type === f.System)) || [], W = (c == null ? void 0 : c.filter((e) => e.type === f.User)) || [];
|
|
262
|
+
return /* @__PURE__ */ P("div", {
|
|
261
263
|
className: "text-main",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ P("div", {
|
|
263
265
|
className: "text-left-sider",
|
|
264
|
-
children: [!!(c != null && c.length) && /* @__PURE__ */
|
|
266
|
+
children: [!!(c != null && c.length) && /* @__PURE__ */ a(M, {
|
|
265
267
|
autoComplete: "off",
|
|
266
|
-
form:
|
|
268
|
+
form: E,
|
|
267
269
|
labelWrap: !0,
|
|
268
270
|
labelAlign: "left",
|
|
269
271
|
labelCol: {
|
|
@@ -272,14 +274,14 @@ const {
|
|
|
272
274
|
}
|
|
273
275
|
},
|
|
274
276
|
className: "prompt-form",
|
|
275
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ P(_, {
|
|
276
278
|
bordered: !1,
|
|
277
279
|
ghost: !0,
|
|
278
280
|
className: "prompt-variables-collapse",
|
|
279
|
-
defaultActiveKey: [
|
|
280
|
-
children: [
|
|
281
|
+
defaultActiveKey: [f.System, f.User],
|
|
282
|
+
children: [J.length && /* @__PURE__ */ a(Z, {
|
|
281
283
|
header: "角色设定变量",
|
|
282
|
-
children:
|
|
284
|
+
children: J.map((e) => /* @__PURE__ */ a(M.Item, {
|
|
283
285
|
label: e.name,
|
|
284
286
|
name: ["systemPrompts", e.key],
|
|
285
287
|
style: {
|
|
@@ -289,15 +291,15 @@ const {
|
|
|
289
291
|
required: !0,
|
|
290
292
|
message: "请输入"
|
|
291
293
|
}],
|
|
292
|
-
children: /* @__PURE__ */
|
|
294
|
+
children: /* @__PURE__ */ a(K, {
|
|
293
295
|
placeholder: "请输入",
|
|
294
|
-
maxLength:
|
|
295
|
-
onBlur: (o) =>
|
|
296
|
+
maxLength: k == null ? void 0 : k.questionContextMaxLength,
|
|
297
|
+
onBlur: (o) => z(e.id, o)
|
|
296
298
|
})
|
|
297
299
|
}, e.key))
|
|
298
|
-
},
|
|
300
|
+
}, f.System), W.length && /* @__PURE__ */ a(Z, {
|
|
299
301
|
header: "用户指令变量",
|
|
300
|
-
children:
|
|
302
|
+
children: W.map((e) => /* @__PURE__ */ a(M.Item, {
|
|
301
303
|
label: e.name,
|
|
302
304
|
name: ["userPrompts", e.key],
|
|
303
305
|
style: {
|
|
@@ -307,74 +309,74 @@ const {
|
|
|
307
309
|
required: !0,
|
|
308
310
|
message: "请输入"
|
|
309
311
|
}],
|
|
310
|
-
children: /* @__PURE__ */
|
|
312
|
+
children: /* @__PURE__ */ a(K, {
|
|
311
313
|
placeholder: "请输入",
|
|
312
|
-
maxLength:
|
|
313
|
-
onBlur: (o) =>
|
|
314
|
+
maxLength: k == null ? void 0 : k.questionContextMaxLength,
|
|
315
|
+
onBlur: (o) => z(e.id, o)
|
|
314
316
|
})
|
|
315
317
|
}, e.key))
|
|
316
|
-
},
|
|
318
|
+
}, f.User)]
|
|
317
319
|
})
|
|
318
|
-
}), /* @__PURE__ */
|
|
320
|
+
}), /* @__PURE__ */ P("div", {
|
|
319
321
|
className: "sider-header",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ a("span", {
|
|
321
323
|
className: "header-title",
|
|
322
324
|
children: "文本生成输入"
|
|
323
|
-
}),
|
|
324
|
-
checkedValues:
|
|
325
|
-
currKnowledgeList:
|
|
326
|
-
selectCount:
|
|
327
|
-
onSelectChange:
|
|
325
|
+
}), H.length !== 0 && /* @__PURE__ */ a(we, {
|
|
326
|
+
checkedValues: T,
|
|
327
|
+
currKnowledgeList: H,
|
|
328
|
+
selectCount: te,
|
|
329
|
+
onSelectChange: fe,
|
|
328
330
|
disabled: !1
|
|
329
331
|
})]
|
|
330
|
-
}), /* @__PURE__ */
|
|
332
|
+
}), /* @__PURE__ */ a("div", {
|
|
331
333
|
className: "sider-main",
|
|
332
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ P("div", {
|
|
333
335
|
className: "sider-text",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
336
|
+
children: [/* @__PURE__ */ a(K.TextArea, {
|
|
335
337
|
style: {
|
|
336
338
|
height: "100%",
|
|
337
339
|
resize: "none"
|
|
338
340
|
},
|
|
339
341
|
placeholder: "请输入你的问题,通过shift+enter换行",
|
|
340
|
-
maxLength:
|
|
342
|
+
maxLength: ne,
|
|
341
343
|
showCount: !0,
|
|
342
344
|
bordered: !1,
|
|
343
|
-
onChange:
|
|
344
|
-
value:
|
|
345
|
+
onChange: me,
|
|
346
|
+
value: S,
|
|
345
347
|
className: "left-input"
|
|
346
|
-
}), /* @__PURE__ */
|
|
348
|
+
}), /* @__PURE__ */ a(xe, {
|
|
347
349
|
type: "primary",
|
|
348
|
-
disabled: !
|
|
349
|
-
onClick:
|
|
350
|
+
disabled: !S || q,
|
|
351
|
+
onClick: ue,
|
|
350
352
|
className: "sider-btn",
|
|
351
|
-
loading:
|
|
352
|
-
children:
|
|
353
|
+
loading: q,
|
|
354
|
+
children: q ? "生成中" : "确认生成"
|
|
353
355
|
})]
|
|
354
356
|
})
|
|
355
357
|
})]
|
|
356
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ a("div", {
|
|
357
359
|
className: "text-right-sider",
|
|
358
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ a("div", {
|
|
359
361
|
className: "sider-main",
|
|
360
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ a("div", {
|
|
361
363
|
className: "sider-text",
|
|
362
|
-
ref:
|
|
363
|
-
children:
|
|
364
|
-
children: [/* @__PURE__ */
|
|
365
|
-
children:
|
|
366
|
-
}),
|
|
364
|
+
ref: D,
|
|
365
|
+
children: p ? /* @__PURE__ */ P(Se, {
|
|
366
|
+
children: [/* @__PURE__ */ a(Ve, {
|
|
367
|
+
children: p
|
|
368
|
+
}), g && (g == null ? void 0 : g.reference.length) !== 0 && /* @__PURE__ */ a("div", {
|
|
367
369
|
style: {
|
|
368
370
|
marginTop: 16
|
|
369
371
|
},
|
|
370
|
-
children: /* @__PURE__ */
|
|
371
|
-
history:
|
|
372
|
-
docViewerUrl:
|
|
372
|
+
children: /* @__PURE__ */ a(Ne, {
|
|
373
|
+
history: g,
|
|
374
|
+
docViewerUrl: l
|
|
373
375
|
})
|
|
374
376
|
})]
|
|
375
|
-
}) : /* @__PURE__ */
|
|
377
|
+
}) : /* @__PURE__ */ a("div", {
|
|
376
378
|
className: "text-pannel",
|
|
377
|
-
children: /* @__PURE__ */
|
|
379
|
+
children: /* @__PURE__ */ a("span", {
|
|
378
380
|
children: "请在左侧输入需要 AI 生成的内容"
|
|
379
381
|
})
|
|
380
382
|
})
|
|
@@ -384,5 +386,5 @@ const {
|
|
|
384
386
|
});
|
|
385
387
|
};
|
|
386
388
|
export {
|
|
387
|
-
|
|
389
|
+
Ee as default
|
|
388
390
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var A = Object.defineProperty, L = Object.defineProperties;
|
|
2
2
|
var M = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var i = Object.getOwnPropertySymbols;
|
|
4
|
-
var P = Object.prototype.hasOwnProperty,
|
|
4
|
+
var P = Object.prototype.hasOwnProperty, j = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var s = (o, e, t) => e in o ? A(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, a = (o, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
P.call(e, t) && s(o, t, e[t]);
|
|
8
8
|
if (i)
|
|
9
9
|
for (var t of i(e))
|
|
10
|
-
|
|
10
|
+
j.call(e, t) && s(o, t, e[t]);
|
|
11
11
|
return o;
|
|
12
12
|
}, d = (o, e) => L(o, M(e));
|
|
13
13
|
import { jsx as n } from "react/jsx-runtime";
|
|
14
|
-
import { useRef as
|
|
14
|
+
import { useRef as w, useState as l, useEffect as z } from "react";
|
|
15
15
|
/* empty css */import { ConfigProvider as m } from "antd";
|
|
16
16
|
import B from "antd/es/locale/zh_CN";
|
|
17
17
|
import E from "./components/TextSiders/index.mjs";
|
|
18
18
|
import { JWT as J } from "../utils/index.mjs";
|
|
19
|
-
import { AgentClientProvider as
|
|
20
|
-
const
|
|
19
|
+
import { AgentClientProvider as V } from "../context.mjs";
|
|
20
|
+
const Z = (o) => {
|
|
21
21
|
const {
|
|
22
22
|
application: e,
|
|
23
23
|
theme: t,
|
|
@@ -34,8 +34,9 @@ const Y = (o) => {
|
|
|
34
34
|
disabled: x,
|
|
35
35
|
transform: I,
|
|
36
36
|
features: b,
|
|
37
|
-
agentClient: N
|
|
38
|
-
|
|
37
|
+
agentClient: N,
|
|
38
|
+
docViewerUrl: R
|
|
39
|
+
} = o, T = w(null), [U, W] = l(!1), [q, k] = l();
|
|
39
40
|
return z(() => {
|
|
40
41
|
if (!r)
|
|
41
42
|
return;
|
|
@@ -45,9 +46,9 @@ const Y = (o) => {
|
|
|
45
46
|
theme: t
|
|
46
47
|
}), /* @__PURE__ */ n(m, {
|
|
47
48
|
locale: B,
|
|
48
|
-
children: /* @__PURE__ */ n(
|
|
49
|
+
children: /* @__PURE__ */ n(V, {
|
|
49
50
|
value: d(a({}, o), {
|
|
50
|
-
popupContainer:
|
|
51
|
+
popupContainer: T,
|
|
51
52
|
agentClient: N,
|
|
52
53
|
footer: f,
|
|
53
54
|
defaultInput: c,
|
|
@@ -61,13 +62,14 @@ const Y = (o) => {
|
|
|
61
62
|
transform: I,
|
|
62
63
|
features: b
|
|
63
64
|
}),
|
|
64
|
-
children: !
|
|
65
|
+
children: !U && /* @__PURE__ */ n("div", {
|
|
65
66
|
className: "gbot-dialog-modal chat-text",
|
|
66
67
|
children: /* @__PURE__ */ n("div", {
|
|
67
68
|
className: "text-pannel",
|
|
68
69
|
children: /* @__PURE__ */ n(E, {
|
|
69
70
|
application: e,
|
|
70
|
-
sessionId: v
|
|
71
|
+
sessionId: v,
|
|
72
|
+
docViewerUrl: R
|
|
71
73
|
})
|
|
72
74
|
})
|
|
73
75
|
})
|
|
@@ -75,5 +77,5 @@ const Y = (o) => {
|
|
|
75
77
|
});
|
|
76
78
|
};
|
|
77
79
|
export {
|
|
78
|
-
|
|
80
|
+
Z as default
|
|
79
81
|
};
|
|
@@ -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.20", 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.19", 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.20",
|
|
26
|
+
"@glodon-aiot/bot-client-sdk": "^3.3.5-alpha.20",
|
|
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",
|