feat: 知识库匹配模式选择

This commit is contained in:
archer
2023-04-12 00:44:01 +08:00
parent 1fe5cd751a
commit c605964fa8
11 changed files with 102 additions and 41 deletions

View File

@@ -1,5 +1,7 @@
import { Schema, model, models, Model as MongoModel } from 'mongoose';
import { ModelSchema as ModelType } from '@/types/mongoSchema';
import { ModelVectorSearchModeMap, ModelVectorSearchModeEnum } from '@/constants/model';
const ModelSchema = new Schema({
userId: {
type: Schema.Types.ObjectId,
@@ -43,6 +45,13 @@ const ModelSchema = new Schema({
max: 10,
default: 4
},
search: {
mode: {
type: String,
enum: Object.keys(ModelVectorSearchModeMap),
default: ModelVectorSearchModeEnum.hightSimilarity
}
},
service: {
company: {
type: String,