@glodon-aiot/apis 2.4.7 → 3.0.4
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/_virtual/_commonjsHelpers.mjs +4 -0
- package/dist/es/_virtual/minio-zj.mjs +4 -0
- package/dist/es/aecpilot/index.mjs +55 -55
- package/dist/es/aecpilotui/index.mjs +27 -27
- package/dist/es/agentcliui/index.mjs +29 -29
- package/dist/es/cvforce/index.mjs +17 -9
- package/dist/es/cvforce-datahub/index.mjs +1 -1
- package/dist/es/node_modules/@glodon-aiot/minio/dist/minio-zj.mjs +26485 -0
- package/dist/lib/index.js +120 -3
- package/dist/src/aecpilot/index.d.ts +2 -2
- package/dist/src/aecpilot/model.d.ts +3 -3
- package/dist/src/aecpilotui/index.d.ts +2 -2
- package/dist/src/agentcliui/index.d.ts +2 -2
- package/dist/src/cvforce/index.d.ts +9 -1
- package/dist/src/cvforce/model.d.ts +2 -0
- package/dist/src/index.d.ts +1 -1
- package/package.json +13 -17
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var P = Object.defineProperty, K = Object.defineProperties;
|
|
2
|
+
var E = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var I = Object.getOwnPropertySymbols;
|
|
4
|
-
var b = Object.prototype.hasOwnProperty,
|
|
5
|
-
var T = (
|
|
4
|
+
var b = Object.prototype.hasOwnProperty, F = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var T = (m, e, t) => e in m ? P(m, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : m[e] = t, f = (m, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
b.call(e, t) && T(
|
|
7
|
+
b.call(e, t) && T(m, t, e[t]);
|
|
8
8
|
if (I)
|
|
9
9
|
for (var t of I(e))
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, S = (
|
|
13
|
-
var r = (
|
|
10
|
+
F.call(e, t) && T(m, t, e[t]);
|
|
11
|
+
return m;
|
|
12
|
+
}, S = (m, e) => K(m, E(e));
|
|
13
|
+
var r = (m, e, t) => new Promise((o, n) => {
|
|
14
14
|
var s = (i) => {
|
|
15
15
|
try {
|
|
16
|
-
|
|
16
|
+
g(t.next(i));
|
|
17
17
|
} catch (a) {
|
|
18
18
|
n(a);
|
|
19
19
|
}
|
|
20
20
|
}, h = (i) => {
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
g(t.throw(i));
|
|
23
23
|
} catch (a) {
|
|
24
24
|
n(a);
|
|
25
25
|
}
|
|
26
|
-
},
|
|
27
|
-
|
|
26
|
+
}, g = (i) => i.done ? o(i.value) : Promise.resolve(i.value).then(s, h);
|
|
27
|
+
g((t = t.apply(m, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
30
|
-
import { BaseApi as
|
|
31
|
-
import {
|
|
32
|
-
import { IHistoryRole as
|
|
33
|
-
import { IFileOrigin as
|
|
34
|
-
import { fetchEventSource as
|
|
35
|
-
import
|
|
36
|
-
import { PROMPT_SEARCH_MAX_LENGTH as
|
|
37
|
-
import { PROMPT_TITLE_MAX_LENGTH as
|
|
38
|
-
import
|
|
39
|
-
class
|
|
29
|
+
import O from "axios";
|
|
30
|
+
import { BaseApi as v } from "../base/index.mjs";
|
|
31
|
+
import { m as $ } from "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
32
|
+
import { IHistoryRole as k, AecKnowledgeFileStatus as R } from "./model.mjs";
|
|
33
|
+
import { IFileOrigin as G, ISourceType as V, IThinkingStatus as W, IversionInfo as X } from "./model.mjs";
|
|
34
|
+
import { fetchEventSource as w } from "../utils/fetchEventSource/fetch.mjs";
|
|
35
|
+
import C from "dayjs";
|
|
36
|
+
import { PROMPT_SEARCH_MAX_LENGTH as H } from "./cosntant.mjs";
|
|
37
|
+
import { PROMPT_TITLE_MAX_LENGTH as q } from "./cosntant.mjs";
|
|
38
|
+
import A from "../node_modules/uuid/dist/esm-browser/v4.mjs";
|
|
39
|
+
class J extends v {
|
|
40
40
|
constructor(e, t, o) {
|
|
41
|
-
super(e != null ? e :
|
|
41
|
+
super(e != null ? e : O.create(), o), this.axiosInstance = e, this.getToken = t;
|
|
42
42
|
}
|
|
43
43
|
// 会话
|
|
44
44
|
getSessions() {
|
|
@@ -160,16 +160,16 @@ class Y extends O {
|
|
|
160
160
|
return new Promise((o, n) => {
|
|
161
161
|
const s = new FileReader();
|
|
162
162
|
s.readAsArrayBuffer(t), s.onload = (h) => {
|
|
163
|
-
|
|
163
|
+
$.initMinio({
|
|
164
164
|
endPoint: e.endpoints[0],
|
|
165
165
|
useSSL: e.useSSL,
|
|
166
166
|
accessKey: e.accessKey,
|
|
167
167
|
secretKey: e.secretKey
|
|
168
168
|
});
|
|
169
|
-
const
|
|
169
|
+
const g = Buffer.from(h.target.result), i = {
|
|
170
170
|
"Content-Type": "application/octet-stream"
|
|
171
171
|
};
|
|
172
|
-
|
|
172
|
+
$.putObjectBuffer(e.bucket, e.fileKeys[0], g, i, (a) => {
|
|
173
173
|
if (a)
|
|
174
174
|
throw console.error(a), Error(a);
|
|
175
175
|
o(e.fileKeys[0]);
|
|
@@ -229,17 +229,17 @@ class Y extends O {
|
|
|
229
229
|
// 文件详情
|
|
230
230
|
checkFileReady(e, t, o = () => !0, n = 1e4, s) {
|
|
231
231
|
return r(this, null, function* () {
|
|
232
|
-
return new Promise((h,
|
|
232
|
+
return new Promise((h, g) => {
|
|
233
233
|
const i = () => {
|
|
234
234
|
if (!o()) {
|
|
235
235
|
clearInterval(a);
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
238
|
t ? this.getSessionKnowledgeFile(e, t).then((c) => {
|
|
239
|
-
if (s == null || s(c), c.status ===
|
|
239
|
+
if (s == null || s(c), c.status === R.Success && (clearInterval(a), h(c)), c.status === R.Failed) {
|
|
240
240
|
clearInterval(a);
|
|
241
241
|
const d = "该文件无法读取,请上传可编辑pdf,doc,docx文档";
|
|
242
|
-
|
|
242
|
+
g(Error(d, {
|
|
243
243
|
cause: {
|
|
244
244
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
245
245
|
// @ts-ignore
|
|
@@ -250,7 +250,7 @@ class Y extends O {
|
|
|
250
250
|
}));
|
|
251
251
|
}
|
|
252
252
|
}).catch((c) => {
|
|
253
|
-
clearInterval(a),
|
|
253
|
+
clearInterval(a), g(c);
|
|
254
254
|
}) : h(null);
|
|
255
255
|
}, a = setInterval(i, n);
|
|
256
256
|
i();
|
|
@@ -268,9 +268,9 @@ class Y extends O {
|
|
|
268
268
|
var i;
|
|
269
269
|
const s = {
|
|
270
270
|
code: 0,
|
|
271
|
-
messageId:
|
|
271
|
+
messageId: A(),
|
|
272
272
|
content: "",
|
|
273
|
-
role:
|
|
273
|
+
role: k.Robot,
|
|
274
274
|
sessionId: "",
|
|
275
275
|
reference: [],
|
|
276
276
|
searchReference: [],
|
|
@@ -280,16 +280,16 @@ class Y extends O {
|
|
|
280
280
|
isAgree: 0
|
|
281
281
|
},
|
|
282
282
|
isReplying: !1
|
|
283
|
-
}, h = yield this.getToken(),
|
|
283
|
+
}, h = yield this.getToken(), g = S(f({}, t), {
|
|
284
284
|
stream: !0
|
|
285
285
|
});
|
|
286
|
-
|
|
286
|
+
w(`${(i = this.axiosInstance) == null ? void 0 : i.defaults.baseURL}/chat?sessionId=${e}`, {
|
|
287
287
|
method: "POST",
|
|
288
288
|
headers: {
|
|
289
289
|
Authorization: `Bearer ${h}`,
|
|
290
290
|
"Content-Type": "application/json"
|
|
291
291
|
},
|
|
292
|
-
body: JSON.stringify(
|
|
292
|
+
body: JSON.stringify(g),
|
|
293
293
|
openWhenHidden: !0,
|
|
294
294
|
signal: o,
|
|
295
295
|
onopen(a) {
|
|
@@ -312,7 +312,7 @@ class Y extends O {
|
|
|
312
312
|
searchReference: s.searchReference,
|
|
313
313
|
messageId: s.messageId,
|
|
314
314
|
sessionId: e,
|
|
315
|
-
messageTime:
|
|
315
|
+
messageTime: C(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
316
316
|
comment: {
|
|
317
317
|
isAgree: 0
|
|
318
318
|
},
|
|
@@ -364,9 +364,9 @@ class Y extends O {
|
|
|
364
364
|
var i, a;
|
|
365
365
|
const s = {
|
|
366
366
|
code: 0,
|
|
367
|
-
messageId:
|
|
367
|
+
messageId: A(),
|
|
368
368
|
content: "",
|
|
369
|
-
role:
|
|
369
|
+
role: k.Robot,
|
|
370
370
|
sessionId: "",
|
|
371
371
|
reference: [],
|
|
372
372
|
searchReference: [],
|
|
@@ -379,16 +379,16 @@ class Y extends O {
|
|
|
379
379
|
reasoningContent: "",
|
|
380
380
|
thinkingSecs: "",
|
|
381
381
|
thinkingStatus: ""
|
|
382
|
-
}, h = yield this.getToken(),
|
|
382
|
+
}, h = yield this.getToken(), g = S(f({}, t), {
|
|
383
383
|
stream: !0
|
|
384
384
|
});
|
|
385
|
-
|
|
385
|
+
w(`${(a = (i = this.axiosInstance) == null ? void 0 : i.defaults.baseURL) == null ? void 0 : a.replace("/v1", "/v3")}/chat?sessionId=${e}`, {
|
|
386
386
|
method: "POST",
|
|
387
387
|
headers: {
|
|
388
388
|
Authorization: `Bearer ${h}`,
|
|
389
389
|
"Content-Type": "application/json"
|
|
390
390
|
},
|
|
391
|
-
body: JSON.stringify(
|
|
391
|
+
body: JSON.stringify(g),
|
|
392
392
|
openWhenHidden: !0,
|
|
393
393
|
signal: o,
|
|
394
394
|
onopen(l) {
|
|
@@ -421,8 +421,8 @@ class Y extends O {
|
|
|
421
421
|
}
|
|
422
422
|
if (d === "reference" && (s.code = c.code, s.message = c.message, s.reference = u), d === "result") {
|
|
423
423
|
s.code = c.code, s.message = c.message;
|
|
424
|
-
const p = u.messageId, y = u.llmModel,
|
|
425
|
-
s.messageId = p, s.llmModel = y, s.messageTime =
|
|
424
|
+
const p = u.messageId, y = u.llmModel, M = u.messageTime;
|
|
425
|
+
s.messageId = p, s.llmModel = y, s.messageTime = M, s.sessionId = e;
|
|
426
426
|
}
|
|
427
427
|
n != null && n.onmessage && n.onmessage(s);
|
|
428
428
|
},
|
|
@@ -456,7 +456,7 @@ class Y extends O {
|
|
|
456
456
|
}
|
|
457
457
|
listPrompt(e) {
|
|
458
458
|
return r(this, null, function* () {
|
|
459
|
-
return e != null && e.title && e.title.length >
|
|
459
|
+
return e != null && e.title && e.title.length > H ? [] : this.get("/prompts", e);
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
462
|
getPrompt(e) {
|
|
@@ -498,13 +498,13 @@ class Y extends O {
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
export {
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
501
|
+
J as AECPilotApi,
|
|
502
|
+
R as AecKnowledgeFileStatus,
|
|
503
|
+
G as IFileOrigin,
|
|
504
|
+
k as IHistoryRole,
|
|
505
|
+
V as ISourceType,
|
|
506
|
+
W as IThinkingStatus,
|
|
507
|
+
X as IversionInfo,
|
|
508
|
+
H as PROMPT_SEARCH_MAX_LENGTH,
|
|
509
|
+
q as PROMPT_TITLE_MAX_LENGTH
|
|
510
510
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var S = Object.defineProperty, A = Object.defineProperties;
|
|
2
|
+
var w = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var h = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var f = (p, e, t) => e in p ?
|
|
4
|
+
var R = Object.prototype.hasOwnProperty, K = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (p, e, t) => e in p ? S(p, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : p[e] = t, y = (p, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
R.call(e, t) && f(p, t, e[t]);
|
|
8
8
|
if (h)
|
|
9
9
|
for (var t of h(e))
|
|
10
|
-
|
|
10
|
+
K.call(e, t) && f(p, t, e[t]);
|
|
11
11
|
return p;
|
|
12
|
-
}, $ = (p, e) =>
|
|
12
|
+
}, $ = (p, e) => A(p, w(e));
|
|
13
13
|
var s = (p, e, t) => new Promise((a, i) => {
|
|
14
14
|
var r = (d) => {
|
|
15
15
|
try {
|
|
@@ -26,19 +26,19 @@ var s = (p, e, t) => new Promise((a, i) => {
|
|
|
26
26
|
}, m = (d) => d.done ? a(d.value) : Promise.resolve(d.value).then(r, n);
|
|
27
27
|
m((t = t.apply(p, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
30
|
-
import { BaseApi as
|
|
31
|
-
import {
|
|
32
|
-
import { IHistoryRole as
|
|
33
|
-
import { fetchEventSource as
|
|
34
|
-
import
|
|
35
|
-
import { Buffer as
|
|
36
|
-
import { PROMPT_SEARCH_MAX_LENGTH as
|
|
29
|
+
import T from "axios";
|
|
30
|
+
import { BaseApi as b } from "../base/index.mjs";
|
|
31
|
+
import { m as I } from "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
32
|
+
import { IHistoryRole as P, AecKnowledgeFileStatus as v } from "../aecpilot/model.mjs";
|
|
33
|
+
import { fetchEventSource as k } from "../utils/fetchEventSource/fetch.mjs";
|
|
34
|
+
import M from "dayjs";
|
|
35
|
+
import { Buffer as F } from "buffer";
|
|
36
|
+
import { PROMPT_SEARCH_MAX_LENGTH as B } from "../aecpilot/cosntant.mjs";
|
|
37
37
|
import E from "../node_modules/uuid/dist/esm-browser/v4.mjs";
|
|
38
|
-
globalThis.Buffer =
|
|
39
|
-
class
|
|
38
|
+
globalThis.Buffer = F;
|
|
39
|
+
class Y extends b {
|
|
40
40
|
constructor(e, t, a) {
|
|
41
|
-
super(e != null ? e :
|
|
41
|
+
super(e != null ? e : T.create(), a), this.axiosInstance = e, this.getToken = t;
|
|
42
42
|
}
|
|
43
43
|
// async postChatV2EventSource1(
|
|
44
44
|
// applicationId: string,
|
|
@@ -349,7 +349,7 @@ class J extends T {
|
|
|
349
349
|
}
|
|
350
350
|
listPrompt(e, t) {
|
|
351
351
|
return s(this, null, function* () {
|
|
352
|
-
return t != null && t.title && t.title.length >
|
|
352
|
+
return t != null && t.title && t.title.length > B ? [] : this.get(`/data/v1/application/${e}/prompts`, t);
|
|
353
353
|
});
|
|
354
354
|
}
|
|
355
355
|
getPrompt(e, t) {
|
|
@@ -416,7 +416,7 @@ class J extends T {
|
|
|
416
416
|
return;
|
|
417
417
|
}
|
|
418
418
|
a ? this.getApplicationIdSessionKnowledgeFileId(e, t, a, {}, !0).then((c) => {
|
|
419
|
-
if (n == null || n(c), c.status ===
|
|
419
|
+
if (n == null || n(c), c.status === v.Success && (clearInterval(o), m(c)), c.status === v.Failed) {
|
|
420
420
|
clearInterval(o);
|
|
421
421
|
const g = "该文件无法读取,请上传可编辑pdf,doc,docx文档";
|
|
422
422
|
d(Error(g, {
|
|
@@ -459,7 +459,7 @@ class J extends T {
|
|
|
459
459
|
return new Promise((a, i) => {
|
|
460
460
|
const r = new FileReader();
|
|
461
461
|
r.readAsArrayBuffer(t), r.onload = (n) => {
|
|
462
|
-
|
|
462
|
+
I.initMinio({
|
|
463
463
|
endPoint: e.endpoints[0],
|
|
464
464
|
useSSL: e.useSSL,
|
|
465
465
|
accessKey: e.accessKey,
|
|
@@ -468,7 +468,7 @@ class J extends T {
|
|
|
468
468
|
const m = Buffer.from(n.target.result), d = {
|
|
469
469
|
"Content-Type": "application/octet-stream"
|
|
470
470
|
};
|
|
471
|
-
|
|
471
|
+
I.putObjectBuffer(e.bucket, e.fileKeys[0], m, d, (l) => {
|
|
472
472
|
if (l)
|
|
473
473
|
throw console.error(l), Error(l);
|
|
474
474
|
a(e.fileKeys[0]);
|
|
@@ -504,7 +504,7 @@ class J extends T {
|
|
|
504
504
|
code: 0,
|
|
505
505
|
messageId: E(),
|
|
506
506
|
content: "",
|
|
507
|
-
role:
|
|
507
|
+
role: P.Robot,
|
|
508
508
|
sessionId: "",
|
|
509
509
|
reference: [],
|
|
510
510
|
searchReference: [],
|
|
@@ -518,7 +518,7 @@ class J extends T {
|
|
|
518
518
|
}, m = yield this.getToken(), d = $(y({}, a), {
|
|
519
519
|
stream: !0
|
|
520
520
|
});
|
|
521
|
-
|
|
521
|
+
k(`${(l = this.axiosInstance) == null ? void 0 : l.defaults.baseURL}/chat/v2/chat?applicationId=${e}&sessionId=${t}`, {
|
|
522
522
|
method: "POST",
|
|
523
523
|
headers: {
|
|
524
524
|
Authorization: `Bearer ${m}`,
|
|
@@ -537,7 +537,7 @@ class J extends T {
|
|
|
537
537
|
let c = {};
|
|
538
538
|
try {
|
|
539
539
|
c = JSON.parse(o.data);
|
|
540
|
-
} catch (
|
|
540
|
+
} catch (H) {
|
|
541
541
|
}
|
|
542
542
|
(c == null ? void 0 : c.mtype) === "search" ? n.searchReference.push(c) : n.content = n.content + o.data;
|
|
543
543
|
const g = {
|
|
@@ -547,7 +547,7 @@ class J extends T {
|
|
|
547
547
|
searchReference: n.searchReference,
|
|
548
548
|
messageId: n.messageId,
|
|
549
549
|
sessionId: t,
|
|
550
|
-
messageTime:
|
|
550
|
+
messageTime: M(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
551
551
|
comment: {
|
|
552
552
|
isAgree: 0
|
|
553
553
|
},
|
|
@@ -603,5 +603,5 @@ class J extends T {
|
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
export {
|
|
606
|
-
|
|
606
|
+
Y as AecpilotUIApi
|
|
607
607
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var S = Object.defineProperty, w = Object.defineProperties;
|
|
2
|
+
var A = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var u = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var f = (l, e, t) => e in l ?
|
|
4
|
+
var R = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (l, e, t) => e in l ? S(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, y = (l, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
|
|
7
|
+
R.call(e, t) && f(l, t, e[t]);
|
|
8
8
|
if (u)
|
|
9
9
|
for (var t of u(e))
|
|
10
|
-
|
|
10
|
+
T.call(e, t) && f(l, t, e[t]);
|
|
11
11
|
return l;
|
|
12
|
-
}, $ = (l, e) =>
|
|
12
|
+
}, $ = (l, e) => w(l, A(e));
|
|
13
13
|
var s = (l, e, t) => new Promise((a, i) => {
|
|
14
14
|
var n = (c) => {
|
|
15
15
|
try {
|
|
@@ -26,19 +26,19 @@ var s = (l, e, t) => new Promise((a, i) => {
|
|
|
26
26
|
}, r = (c) => c.done ? a(c.value) : Promise.resolve(c.value).then(n, h);
|
|
27
27
|
r((t = t.apply(l, e)).next());
|
|
28
28
|
});
|
|
29
|
-
import
|
|
30
|
-
import { BaseApi as
|
|
31
|
-
import {
|
|
32
|
-
import { IHistoryRole as
|
|
33
|
-
import { fetchEventSource as
|
|
34
|
-
import
|
|
35
|
-
import { Buffer as
|
|
36
|
-
import { PROMPT_SEARCH_MAX_LENGTH as
|
|
37
|
-
import
|
|
38
|
-
window.Buffer =
|
|
39
|
-
class
|
|
29
|
+
import K from "axios";
|
|
30
|
+
import { BaseApi as k } from "../base/index.mjs";
|
|
31
|
+
import { m as I } from "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
32
|
+
import { IHistoryRole as P, AecKnowledgeFileStatus as v } from "../aecpilot/model.mjs";
|
|
33
|
+
import { fetchEventSource as F } from "../utils/fetchEventSource/fetch.mjs";
|
|
34
|
+
import M from "dayjs";
|
|
35
|
+
import { Buffer as b } from "buffer";
|
|
36
|
+
import { PROMPT_SEARCH_MAX_LENGTH as B } from "../aecpilot/cosntant.mjs";
|
|
37
|
+
import E from "../node_modules/uuid/dist/esm-browser/v4.mjs";
|
|
38
|
+
window.Buffer = b;
|
|
39
|
+
class _ extends k {
|
|
40
40
|
constructor(e, t, a) {
|
|
41
|
-
super(e != null ? e :
|
|
41
|
+
super(e != null ? e : K.create(), a), this.axiosInstance = e, this.getToken = t;
|
|
42
42
|
}
|
|
43
43
|
getApplicationIdSessions(e) {
|
|
44
44
|
return s(this, null, function* () {
|
|
@@ -89,9 +89,9 @@ class x extends K {
|
|
|
89
89
|
return s(this, null, function* () {
|
|
90
90
|
const r = {
|
|
91
91
|
code: 0,
|
|
92
|
-
messageId:
|
|
92
|
+
messageId: E(),
|
|
93
93
|
content: "",
|
|
94
|
-
role:
|
|
94
|
+
role: P.Robot,
|
|
95
95
|
sessionId: "",
|
|
96
96
|
reference: [],
|
|
97
97
|
searchReference: [],
|
|
@@ -104,7 +104,7 @@ class x extends K {
|
|
|
104
104
|
}, c = yield this.getToken(), p = $(y({}, a), {
|
|
105
105
|
stream: !0
|
|
106
106
|
});
|
|
107
|
-
|
|
107
|
+
F(`https://aiot-dev.glodon.com/api/cvforcepd/chat/v2/chat?applicationId=${e}&sessionId=${t}`, {
|
|
108
108
|
method: "POST",
|
|
109
109
|
headers: {
|
|
110
110
|
Authorization: `Bearer ${c}`,
|
|
@@ -121,7 +121,7 @@ class x extends K {
|
|
|
121
121
|
let o = {};
|
|
122
122
|
try {
|
|
123
123
|
o = JSON.parse(d.data);
|
|
124
|
-
} catch (
|
|
124
|
+
} catch (H) {
|
|
125
125
|
}
|
|
126
126
|
(o == null ? void 0 : o.mtype) === "search" ? r.searchReference.push(o) : r.content = r.content + d.data;
|
|
127
127
|
const g = {
|
|
@@ -131,7 +131,7 @@ class x extends K {
|
|
|
131
131
|
searchReference: r.searchReference,
|
|
132
132
|
messageId: r.messageId,
|
|
133
133
|
sessionId: t,
|
|
134
|
-
messageTime:
|
|
134
|
+
messageTime: M(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss"),
|
|
135
135
|
comment: {
|
|
136
136
|
isAgree: 0
|
|
137
137
|
},
|
|
@@ -268,7 +268,7 @@ class x extends K {
|
|
|
268
268
|
return new Promise((a, i) => {
|
|
269
269
|
const n = new FileReader();
|
|
270
270
|
n.readAsArrayBuffer(t), n.onload = (h) => {
|
|
271
|
-
|
|
271
|
+
I.initMinio({
|
|
272
272
|
endPoint: e.endpoints[0],
|
|
273
273
|
useSSL: e.useSSL,
|
|
274
274
|
accessKey: e.accessKey,
|
|
@@ -277,7 +277,7 @@ class x extends K {
|
|
|
277
277
|
const r = Buffer.from(h.target.result), c = {
|
|
278
278
|
"Content-Type": "application/octet-stream"
|
|
279
279
|
};
|
|
280
|
-
|
|
280
|
+
I.putObjectBuffer(e.bucket, e.fileKeys[0], r, c, (p) => {
|
|
281
281
|
if (p)
|
|
282
282
|
throw console.error(p), Error(p);
|
|
283
283
|
a(e.fileKeys[0]);
|
|
@@ -299,7 +299,7 @@ class x extends K {
|
|
|
299
299
|
}
|
|
300
300
|
listPrompt(e, t) {
|
|
301
301
|
return s(this, null, function* () {
|
|
302
|
-
return t != null && t.title && t.title.length >
|
|
302
|
+
return t != null && t.title && t.title.length > B ? [] : this.get(`/data/v1/application/${e}/prompts`, t);
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
getPrompt(e, t) {
|
|
@@ -336,7 +336,7 @@ class x extends K {
|
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
a ? this.getApplicationIdSessionKnowledgeFileId(e, t, a, {}, !0).then((o) => {
|
|
339
|
-
if (h == null || h(o), o.status ===
|
|
339
|
+
if (h == null || h(o), o.status === v.Success && (clearInterval(d), r(o)), o.status === v.Failed) {
|
|
340
340
|
clearInterval(d);
|
|
341
341
|
const g = "该文件无法读取,请上传可编辑pdf,doc,docx文档";
|
|
342
342
|
c(Error(g, {
|
|
@@ -414,5 +414,5 @@ class x extends K {
|
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
416
|
export {
|
|
417
|
-
|
|
417
|
+
_ as AgentClientUIApi
|
|
418
418
|
};
|
|
@@ -14,12 +14,12 @@ var s = (l, e, t) => new Promise((n, i) => {
|
|
|
14
14
|
}, p = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(r, c);
|
|
15
15
|
p((t = t.apply(l, e)).next());
|
|
16
16
|
});
|
|
17
|
-
import
|
|
18
|
-
import { BaseApi as
|
|
19
|
-
import {
|
|
20
|
-
class m extends
|
|
17
|
+
import g from "axios";
|
|
18
|
+
import { BaseApi as h } from "../base/index.mjs";
|
|
19
|
+
import { m as d } from "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
20
|
+
class m extends h {
|
|
21
21
|
constructor(e, t) {
|
|
22
|
-
super(e != null ? e :
|
|
22
|
+
super(e != null ? e : g.create(), t);
|
|
23
23
|
}
|
|
24
24
|
getKnowledge(e, t) {
|
|
25
25
|
return s(this, null, function* () {
|
|
@@ -114,11 +114,19 @@ class m extends g {
|
|
|
114
114
|
return this.post(`/application/${e}session/${t}/file`, n);
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
/**
|
|
118
|
+
* 异步提交会话评论信息
|
|
119
|
+
* @param appid - 应用的 ID,用于标识具体的应用
|
|
120
|
+
* @param sid - 会话的 ID,用于标识具体的会话
|
|
121
|
+
* @param params - 评论参数对象,包含评论的相关信息,类型为 ICommentParam
|
|
122
|
+
* @returns 返回一个 Promise,当请求成功时解析为消息 ID
|
|
123
|
+
*/
|
|
124
|
+
postComments(e, t, n) {
|
|
118
125
|
return s(this, null, function* () {
|
|
119
|
-
return this.post(
|
|
126
|
+
return this.post(`/application/${e}/sessions/${t}/comments`, n);
|
|
120
127
|
});
|
|
121
128
|
}
|
|
129
|
+
/**
|
|
122
130
|
/**
|
|
123
131
|
* 查询会话记录
|
|
124
132
|
* 规则:
|
|
@@ -198,7 +206,7 @@ class m extends g {
|
|
|
198
206
|
return new Promise((n, i) => {
|
|
199
207
|
const r = new FileReader();
|
|
200
208
|
r.readAsArrayBuffer(t), r.onload = (c) => {
|
|
201
|
-
|
|
209
|
+
d.initMinio({
|
|
202
210
|
endPoint: e.endpoints[0],
|
|
203
211
|
useSSL: e.useSSL,
|
|
204
212
|
accessKey: e.accessKey,
|
|
@@ -207,7 +215,7 @@ class m extends g {
|
|
|
207
215
|
const p = Buffer.from(c.target.result), o = {
|
|
208
216
|
"Content-Type": "application/octet-stream"
|
|
209
217
|
};
|
|
210
|
-
|
|
218
|
+
d.putObjectBuffer(e.bucket, e.fileKeys[0], p, o, (a) => {
|
|
211
219
|
if (a)
|
|
212
220
|
throw console.error(a), Error(a);
|
|
213
221
|
n(e.fileKeys[0]);
|
|
@@ -30,7 +30,7 @@ import L from "axios";
|
|
|
30
30
|
import { UploadZipsStatus as u } from "./model.mjs";
|
|
31
31
|
import { GenerateStatus as w, IDatasetLevel as z, PreLabelTaskStatus as E, SubsectionStatus as G } from "./model.mjs";
|
|
32
32
|
import { BaseApi as k } from "../base/index.mjs";
|
|
33
|
-
import "
|
|
33
|
+
import "../node_modules/@glodon-aiot/minio/dist/minio-zj.mjs";
|
|
34
34
|
import "dayjs";
|
|
35
35
|
import "../agentcliui/index.mjs";
|
|
36
36
|
import "../aecpilotui/index.mjs";
|