update package;fix: input data model ui (#4181)

* update package

* fix: ts

* update config

* update jieba package

* add type sign

* fix: input data ui
This commit is contained in:
Archer
2025-03-15 23:49:32 +08:00
committed by archer
parent 713d1901bf
commit cf50f9ec4d
34 changed files with 5090 additions and 5376 deletions

View File

@@ -10,7 +10,7 @@
"js-yaml": "^4.1.0",
"jschardet": "3.1.1",
"nanoid": "^5.1.3",
"next": "14.2.21",
"next": "14.2.24",
"openai": "4.61.0",
"openapi-types": "^12.1.3",
"json5": "^2.2.3",

View File

@@ -1,4 +1,13 @@
import { cut } from '@node-rs/jieba';
import { Jieba } from '@node-rs/jieba';
import fs from 'fs';
import path from 'path';
// 使用 require.resolve 获取包的路径,然后拼接字典文件路径
const jiebaPath = path.dirname(require.resolve('@node-rs/jieba/package.json'));
const dictPath = path.join(jiebaPath, 'dict.txt');
// 使用正确的文件路径加载字典
const jieba = Jieba.withDict(fs.readFileSync(dictPath));
const stopWords = new Set([
'--',
@@ -1509,8 +1518,8 @@ const stopWords = new Set([
]
]);
export function jiebaSplit({ text }: { text: string }) {
const tokens = cut(text, true);
export async function jiebaSplit({ text }: { text: string }) {
const tokens = (await jieba.cutAsync(text, true)) as string[];
return (
tokens

View File

@@ -537,7 +537,7 @@ export async function searchDatasetData(
$match: {
teamId: new Types.ObjectId(teamId),
datasetId: new Types.ObjectId(id),
$text: { $search: jiebaSplit({ text: query }) },
$text: { $search: await jiebaSplit({ text: query }) },
...(filterCollectionIdList
? {
collectionId: {

View File

@@ -3,7 +3,7 @@
"version": "1.0.0",
"dependencies": {
"@fastgpt/global": "workspace:*",
"@node-rs/jieba": "1.10.0",
"@node-rs/jieba": "2.0.1",
"@xmldom/xmldom": "^0.8.10",
"@zilliz/milvus2-sdk-node": "2.4.2",
"axios": "^1.8.2",
@@ -26,7 +26,7 @@
"mammoth": "^1.6.0",
"mongoose": "^8.10.1",
"multer": "1.4.5-lts.1",
"next": "14.2.21",
"next": "14.2.24",
"nextjs-cors": "^2.2.0",
"node-cron": "^3.0.3",
"node-xlsx": "^0.24.0",

View File

@@ -4,8 +4,8 @@
"dependencies": {
"@chakra-ui/anatomy": "2.2.1",
"@chakra-ui/icons": "2.1.1",
"@chakra-ui/next-js": "2.1.5",
"@chakra-ui/react": "2.8.1",
"@chakra-ui/next-js": "2.4.2",
"@chakra-ui/react": "2.10.7",
"@chakra-ui/styled-system": "2.9.1",
"@chakra-ui/system": "2.6.1",
"@emotion/react": "11.11.1",
@@ -21,11 +21,11 @@
"ahooks": "^3.7.11",
"date-fns": "2.30.0",
"dayjs": "^1.11.7",
"i18next": "23.11.5",
"i18next": "23.16.8",
"js-cookie": "^3.0.5",
"lexical": "0.12.6",
"lodash": "^4.17.21",
"next-i18next": "15.3.0",
"next-i18next": "15.4.2",
"papaparse": "^5.4.1",
"react": "18.3.1",
"react-beautiful-dnd": "^13.1.1",