Skip to content

Commit 005fbf8

Browse files
authored
fix: vector ts (#6166)
* stop design doc * remove invalid doc * rename * fix: ts * perf: auto fit * perf: comment menu * remove invalid checker * save button colorschema * fix: icon * perf: color schema * fix: icon * perf: icon * perf: icon * perf: icon * perf: icon
1 parent f8bedc1 commit 005fbf8

File tree

285 files changed

+441
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+441
-400
lines changed

.github/imgs/logo-left.svg

Lines changed: 1 addition & 1 deletion
Loading

.github/imgs/logo.svg

Lines changed: 1 addition & 1 deletion
Loading

document/content/docs/upgrading/4-14/4145.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ description: 'FastGPT V4.14.5 更新说明'
66

77
## 🚀 新增内容
88

9-
1. 对话记录使用侧改成软删除,增加从日志管理里删除对话记录。
10-
2. 更新Agent/工具时,会更新其上层所有目录的更新时间,以便其会排在列表前面。
11-
3. 门户页支持配置单个应用运行可见度配。
12-
4. 导出单个知识库集合分块接口。
13-
5. 升级 Mongo5.x 至 5.0.32 解决CVE-2025-14847。
9+
1. 工作流画布增加演示模式,同时优化折叠模式样式。
10+
2. 对话记录使用侧改成软删除,增加从日志管理里删除对话记录。
11+
3. 更新Agent/工具时,会更新其上层所有目录的更新时间,以便其会排在列表前面。
12+
4. 门户页支持配置单个应用运行可见度配。
13+
5. 导出单个知识库集合分块接口。
14+
6. 升级 Mongo5.x 至 5.0.32 解决CVE-2025-14847。
1415

1516
## ⚙️ 优化
1617

document/data/doc-last-modified.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"document/content/docs/upgrading/4-14/4142.mdx": "2025-11-18T19:27:14+08:00",
121121
"document/content/docs/upgrading/4-14/4143.mdx": "2025-11-26T20:52:05+08:00",
122122
"document/content/docs/upgrading/4-14/4144.mdx": "2025-12-16T14:56:04+08:00",
123-
"document/content/docs/upgrading/4-14/4145.mdx": "2025-12-30T10:57:22+08:00",
123+
"document/content/docs/upgrading/4-14/4145.mdx": "2025-12-30T11:31:47+08:00",
124124
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
125125
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
126126
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",

packages/service/common/vectorDB/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const insertDatasetDataVector = async ({
6666
model,
6767
inputs,
6868
...props
69-
}: InsertVectorControllerPropsType & {
69+
}: Omit<InsertVectorControllerPropsType, 'vectors'> & {
7070
inputs: string[];
7171
model: EmbeddingModelItemType;
7272
}) => {

packages/service/common/vectorDB/milvus/index.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ import {
55
MILVUS_ADDRESS,
66
MILVUS_TOKEN
77
} from '../constants';
8-
import type {
9-
DelDatasetVectorCtrlProps,
10-
EmbeddingRecallCtrlProps,
11-
EmbeddingRecallResponse,
12-
InsertVectorControllerProps
13-
} from '../controller.d';
148
import type { VectorControllerType } from '../type';
159
import { retryFn } from '@fastgpt/global/common/system/utils';
1610
import { addLog } from '../../system/log';
@@ -34,7 +28,7 @@ export class MilvusCtrl implements VectorControllerType {
3428

3529
return global.milvusClient;
3630
};
37-
init = async () => {
31+
init: VectorControllerType['init'] = async () => {
3832
const client = await this.getClient();
3933

4034
// init db(zilliz cloud will error)
@@ -126,7 +120,7 @@ export class MilvusCtrl implements VectorControllerType {
126120
}
127121
};
128122

129-
insert = async (props: InsertVectorControllerProps): Promise<{ insertIds: string[] }> => {
123+
insert: VectorControllerType['insert'] = async (props) => {
130124
const client = await this.getClient();
131125
const { teamId, datasetId, collectionId, vectors } = props;
132126

@@ -162,7 +156,7 @@ export class MilvusCtrl implements VectorControllerType {
162156
insertIds
163157
};
164158
};
165-
delete = async (props: DelDatasetVectorCtrlProps): Promise<any> => {
159+
delete: VectorControllerType['delete'] = async (props) => {
166160
const { teamId } = props;
167161
const client = await this.getClient();
168162

@@ -200,7 +194,7 @@ export class MilvusCtrl implements VectorControllerType {
200194
filter: concatWhere
201195
});
202196
};
203-
embRecall = async (props: EmbeddingRecallCtrlProps): Promise<EmbeddingRecallResponse> => {
197+
embRecall: VectorControllerType['embRecall'] = async (props) => {
204198
const client = await this.getClient();
205199
const { teamId, datasetIds, vector, limit, forbidCollectionIdList, filterCollectionIdList } =
206200
props;
@@ -258,11 +252,7 @@ export class MilvusCtrl implements VectorControllerType {
258252
};
259253
};
260254

261-
getVectorCount = async (props: {
262-
teamId?: string;
263-
datasetId?: string;
264-
collectionId?: string;
265-
}) => {
255+
getVectorCount: VectorControllerType['getVectorCount'] = async (props) => {
266256
const { teamId, datasetId, collectionId } = props;
267257
const client = await this.getClient();
268258

@@ -295,7 +285,7 @@ export class MilvusCtrl implements VectorControllerType {
295285
return total;
296286
};
297287

298-
getVectorDataByTime = async (start: Date, end: Date) => {
288+
getVectorDataByTime: VectorControllerType['getVectorDataByTime'] = async (start, end) => {
299289
const client = await this.getClient();
300290
const startTimestamp = new Date(start).getTime();
301291
const endTimestamp = new Date(end).getTime();

packages/service/common/vectorDB/oceanbase/index.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22
import { DatasetVectorTableName } from '../constants';
33
import { ObClient } from './controller';
44
import { type RowDataPacket } from 'mysql2/promise';
5-
import {
6-
type DelDatasetVectorCtrlProps,
7-
type EmbeddingRecallCtrlProps,
8-
type EmbeddingRecallResponse,
9-
type InsertVectorControllerProps
10-
} from '../controller.d';
115
import type { VectorControllerType } from '../type';
126
import dayjs from 'dayjs';
137
import { addLog } from '../../system/log';
148

159
export class ObVectorCtrl implements VectorControllerType {
1610
constructor() {}
17-
init = async () => {
11+
init: VectorControllerType['init'] = async () => {
1812
try {
1913
await ObClient.query(`
2014
CREATE TABLE IF NOT EXISTS ${DatasetVectorTableName} (
@@ -42,7 +36,7 @@ export class ObVectorCtrl implements VectorControllerType {
4236
}
4337
};
4438

45-
insert = async (props: InsertVectorControllerProps): Promise<{ insertIds: string[] }> => {
39+
insert: VectorControllerType['insert'] = async (props) => {
4640
const { teamId, datasetId, collectionId, vectors } = props;
4741

4842
const values = vectors.map((vector) => [
@@ -64,7 +58,7 @@ export class ObVectorCtrl implements VectorControllerType {
6458
insertIds
6559
};
6660
};
67-
delete = async (props: DelDatasetVectorCtrlProps): Promise<any> => {
61+
delete: VectorControllerType['delete'] = async (props) => {
6862
const { teamId } = props;
6963

7064
const teamIdWhere = `team_id='${String(teamId)}' AND`;
@@ -99,7 +93,7 @@ export class ObVectorCtrl implements VectorControllerType {
9993
where: [where]
10094
});
10195
};
102-
embRecall = async (props: EmbeddingRecallCtrlProps): Promise<EmbeddingRecallResponse> => {
96+
embRecall: VectorControllerType['embRecall'] = async (props) => {
10397
const { teamId, datasetIds, vector, limit, forbidCollectionIdList, filterCollectionIdList } =
10498
props;
10599

@@ -159,7 +153,7 @@ export class ObVectorCtrl implements VectorControllerType {
159153
}))
160154
};
161155
};
162-
getVectorDataByTime = async (start: Date, end: Date) => {
156+
getVectorDataByTime: VectorControllerType['getVectorDataByTime'] = async (start, end) => {
163157
const rows = await ObClient.query<
164158
({
165159
id: string;
@@ -182,11 +176,7 @@ export class ObVectorCtrl implements VectorControllerType {
182176
}));
183177
};
184178

185-
getVectorCount = async (props: {
186-
teamId?: string;
187-
datasetId?: string;
188-
collectionId?: string;
189-
}) => {
179+
getVectorCount: VectorControllerType['getVectorCount'] = async (props) => {
190180
const { teamId, datasetId, collectionId } = props;
191181

192182
// Build where conditions dynamically

packages/service/common/vectorDB/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Pool } from 'pg';
1+
import type { Pool as PgPool } from 'pg';
22
import type { Pool as MysqlPool } from 'mysql2/promise';
33
import type { MilvusClient } from '@zilliz/milvus2-sdk-node';
44
import { z } from 'zod';
@@ -117,7 +117,7 @@ export interface VectorControllerType {
117117
}
118118

119119
declare global {
120-
var pgClient: Pool | null;
120+
var pgClient: PgPool | null;
121121
var obClient: MysqlPool | null;
122122
var milvusClient: MilvusClient | null;
123123
}

packages/service/core/app/tool/controller.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,6 @@ export async function getChildAppPreviewNode({
458458
pluginId: app.id,
459459
templateType: app.templateType ?? FlowNodeTemplateTypeEnum.tools,
460460
flowNodeType,
461-
colorSchema:
462-
flowNodeType === FlowNodeTypeEnum.toolSet || flowNodeType === FlowNodeTypeEnum.pluginModule
463-
? 'salmon'
464-
: flowNodeType === FlowNodeTypeEnum.appModule
465-
? 'skyBlue'
466-
: undefined,
467461
avatar: app.avatar,
468462
name: parseI18nString(app.name, lang),
469463
intro: parseI18nString(app.intro, lang),

packages/web/components/common/Avatar/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ const Avatar = ({
1717

1818
return isIcon ? (
1919
<Box display={'inline-flex'} {...props}>
20-
<MyIcon name={src as any} w={w} fill={fill} borderRadius={props.borderRadius} />
20+
<MyIcon
21+
name={src as any}
22+
w={w}
23+
borderRadius={props.borderRadius}
24+
{...(fill ? { fill } : {})}
25+
/>
2126
</Box>
2227
) : (
2328
<MyImage

0 commit comments

Comments
 (0)