Shun Miyazawa před 1 rokem
rodič
revize
9167954b6c

+ 6 - 0
apps/app/src/features/openai/server/models/ai-assistant.ts

@@ -39,6 +39,7 @@ interface AiAssistant {
   instruction?: string
   instruction?: string
   vectorStoreId: string // VectorStoreId of OpenAI Specify (https://platform.openai.com/docs/api-reference/vector-stores/object)
   vectorStoreId: string // VectorStoreId of OpenAI Specify (https://platform.openai.com/docs/api-reference/vector-stores/object)
   types: AiAssistantType[]
   types: AiAssistantType[]
+  creator: mongoose.Types.ObjectId
   grantedGroups: IGrantedGroup[];
   grantedGroups: IGrantedGroup[];
   pages: mongoose.Types.ObjectId[]
   pages: mongoose.Types.ObjectId[]
   sharingScope: AiAssistantSharingScope
   sharingScope: AiAssistantSharingScope
@@ -75,6 +76,11 @@ const schema = new Schema<AiAssistantDocument>(
       enum: Object.values(AiAssistantType),
       enum: Object.values(AiAssistantType),
       required: true,
       required: true,
     }],
     }],
+    creator: {
+      type: Schema.Types.ObjectId,
+      ref: 'User',
+      required: true,
+    },
     pages: [{
     pages: [{
       type: Schema.Types.ObjectId,
       type: Schema.Types.ObjectId,
       ref: 'Page',
       ref: 'Page',