fix colection create api (#766)

Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-23 09:01:24 +08:00
committed by GitHub
parent aab6ee51eb
commit 379673cae1
143 changed files with 40737 additions and 274 deletions

View File

@@ -47,18 +47,19 @@ const ChatItemSchema = new Schema({
default: () => new Date()
},
obj: {
// chat role
type: String,
required: true,
enum: Object.keys(ChatRoleMap)
},
value: {
// chat content
type: String,
default: ''
},
userGoodFeedback: {
type: String
},
userFeedback: String,
userBadFeedback: {
type: String
},

View File

@@ -86,13 +86,13 @@ const DatasetDataSchema = new Schema({
});
try {
// same data check
DatasetDataSchema.index({ teamId: 1, collectionId: 1, q: 1, a: 1 }, { background: true });
// list collection and count data; list data
DatasetDataSchema.index(
{ teamId: 1, datasetId: 1, collectionId: 1, chunkIndex: 1, updateTime: -1 },
{ background: true }
);
// same data check
DatasetDataSchema.index({ teamId: 1, collectionId: 1, q: 1, a: 1 }, { background: true });
// full text index
DatasetDataSchema.index({ teamId: 1, datasetId: 1, fullTextToken: 'text' }, { background: true });
// Recall vectors after data matching