Skip to content

Commit

Permalink
add baidu mochow vdb
Browse files Browse the repository at this point in the history
Signed-off-by: chenqingxiang04 <[email protected]>
  • Loading branch information
chenqingxiang04 authored and chenqingxiang04 committed Jan 16, 2025
1 parent a8d456f commit 25f13ba
Show file tree
Hide file tree
Showing 6 changed files with 462 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/service/common/vectorStore/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ export const DatasetVectorTableName = 'modeldata';
export const PG_ADDRESS = process.env.PG_URL;
export const MILVUS_ADDRESS = process.env.MILVUS_ADDRESS;
export const MILVUS_TOKEN = process.env.MILVUS_TOKEN;

export const MOCHOW_ADDRESS = process.env.MOCHOW_ADDRESS;
export const MOCHOW_ACCOUNT = process.env.MOCHOW_ACCOUNT;
export const MOCHOW_APIKEY = process.env.MOCHOW_APIKEY;
export const MOCHOW_REPLICA_NUM = process.env.MOCHOW_REPLICA_NUM;
4 changes: 3 additions & 1 deletion packages/service/common/vectorStore/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { PgVectorCtrl } from './pg/class';
import { getVectorsByText } from '../../core/ai/embedding';
import { InsertVectorProps } from './controller.d';
import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
import { MILVUS_ADDRESS, PG_ADDRESS } from './constants';
import { MILVUS_ADDRESS, MOCHOW_ADDRESS, PG_ADDRESS } from './constants';
import { MilvusCtrl } from './milvus/class';
import { MochowCtrl } from './mochow/class';

const getVectorObj = () => {
if (PG_ADDRESS) return new PgVectorCtrl();
if (MILVUS_ADDRESS) return new MilvusCtrl();
if (MOCHOW_ADDRESS) return new MochowCtrl();

return new PgVectorCtrl();
};
Expand Down
Loading

0 comments on commit 25f13ba

Please sign in to comment.