소스 검색

Add aiAssistant field

Shun Miyazawa 1 년 전
부모
커밋
70f07d0f59
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      apps/app/src/features/openai/interfaces/thread-relation.ts
  2. 5 0
      apps/app/src/features/openai/server/models/thread-relation.ts

+ 2 - 0
apps/app/src/features/openai/interfaces/thread-relation.ts

@@ -1,10 +1,12 @@
 import type { IUser, Ref, HasObjectId } from '@growi/core';
 
+import type { AiAssistant } from './ai-assistant';
 import type { IVectorStore } from './vector-store';
 
 export interface IThreadRelation {
   userId: Ref<IUser>
   vectorStore: Ref<IVectorStore>
+  aiAssistant: Ref<AiAssistant>
   threadId: string;
   title?: string;
   expiredAt: Date;

+ 5 - 0
apps/app/src/features/openai/server/models/thread-relation.ts

@@ -25,6 +25,11 @@ const schema = new Schema<ThreadRelationDocument, ThreadRelationModel>({
     ref: 'User',
     required: true,
   },
+  aiAssistant: {
+    type: Schema.Types.ObjectId,
+    ref: 'AiAssistant',
+    required: true,
+  },
   vectorStore: {
     type: Schema.Types.ObjectId,
     ref: 'VectorStore',