@3-/aiapi 0.1.30 → 0.1.32
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/factCheck.js +2 -2
- package/fmtWithFactCheck.js +3 -3
- package/package.json +1 -1
package/factCheck.js
CHANGED
|
@@ -105,7 +105,7 @@ txtLi = (txt) => {
|
|
|
105
105
|
}
|
|
106
106
|
pre = t = void 0;
|
|
107
107
|
};
|
|
108
|
-
txt_li = txt.split('\n');
|
|
108
|
+
txt_li = txt.replaceAll('**', '').split('\n');
|
|
109
109
|
out: //;
|
|
110
110
|
for (i of txt_li) {
|
|
111
111
|
if (i.startsWith('- id:')) {
|
|
@@ -157,7 +157,7 @@ export default retry(async(chat, li) => {
|
|
|
157
157
|
if (!groundingChunks) {
|
|
158
158
|
return new Map();
|
|
159
159
|
}
|
|
160
|
-
content = content.parts[0].text
|
|
160
|
+
content = content.parts[0].text;
|
|
161
161
|
console.log(content);
|
|
162
162
|
url_li = [];
|
|
163
163
|
for (x of groundingChunks) {
|
package/fmtWithFactCheck.js
CHANGED
|
@@ -12,7 +12,7 @@ import txtFmt from '@3-/txt_li/txtFmt.js';
|
|
|
12
12
|
// @3-/read
|
|
13
13
|
// @3-/write
|
|
14
14
|
check = async(chat, json) => {
|
|
15
|
-
var j, k, li, n, tip, x, y, z, 答, 问, 问答;
|
|
15
|
+
var checked, j, k, li, n, tip, x, y, z, 答, 问, 问答;
|
|
16
16
|
li = [];
|
|
17
17
|
for (x of json) {
|
|
18
18
|
({问答} = x);
|
|
@@ -21,12 +21,12 @@ check = async(chat, json) => {
|
|
|
21
21
|
li.push(`问:${txtFmt(问)}\n答:${txtFmt(答)}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
checked = (await factCheck(chat, li));
|
|
25
25
|
n = 0;
|
|
26
26
|
for (z of json) {
|
|
27
27
|
({问答} = z);
|
|
28
28
|
for (j of 问答) {
|
|
29
|
-
li =
|
|
29
|
+
li = checked.get(++n);
|
|
30
30
|
if (li) {
|
|
31
31
|
for (k of li) {
|
|
32
32
|
if (k.失实度 === '严重失实') {
|