@3-/aiapi 0.1.24 → 0.1.26

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 (2) hide show
  1. package/factCheck.js +7 -7
  2. package/package.json +1 -1
package/factCheck.js CHANGED
@@ -9,10 +9,10 @@ import utf8e from '@3-/utf8/utf8e.js';
9
9
 
10
10
  // @3-/read
11
11
  // @3-/write
12
- SHOW_KIND = ['严重失实', '略有出入'];
12
+ SHOW_KIND = ['严重失实', '不正确'];
13
13
 
14
- PREFIX = `对下文问答对做事实核查,只输出与事实不符的观点。
15
- 必须搜索到明确的反面事实才算失实,模棱两可算无法核实。
14
+ PREFIX = `对下文问答中提及的事实做核查(不核查观点)。
15
+ 必须搜索到明确的反面事实才算失实,数据微小差异为基本一致,找不到信息当无法核实。
16
16
  输出文本必须是简体中文,格式如下:
17
17
  - id:
18
18
  标题: 要简短,几个词即可
@@ -104,7 +104,7 @@ txtLi = (txt) => {
104
104
  }
105
105
  pre = t = void 0;
106
106
  };
107
- txt_li = txt.replaceAll('**', '').split('\n');
107
+ txt_li = txt.split('\n');
108
108
  out: //;
109
109
  for (i of txt_li) {
110
110
  if (i.startsWith('- id:')) {
@@ -114,10 +114,10 @@ txtLi = (txt) => {
114
114
  t = {id};
115
115
  }
116
116
  } else if (t) {
117
- trim = i.trimStart().replace('- ', '');
117
+ trim = i.replace('- ', '').trimStart();
118
118
  for (tag of all_tag) {
119
- all_tag.delete(tag);
120
119
  if (trim.startsWith(tag + ':')) {
120
+ all_tag.delete(tag);
121
121
  pre = tag;
122
122
  t[tag] = trim.slice(tag.length + 1).trim();
123
123
  if (tag === '失实度') {
@@ -156,7 +156,7 @@ export default retry(async(chat, li) => {
156
156
  if (!groundingChunks) {
157
157
  return new Map();
158
158
  }
159
- content = content.parts[0].text;
159
+ content = content.parts[0].text.replaceAll('**', '');
160
160
  console.log(content);
161
161
  url_li = [];
162
162
  for (x of groundingChunks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3-/aiapi",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://atomgit.com/i18n/lib.git"