Browse Source

Omit AiAssistant.type

Shun Miyazawa 1 year ago
parent
commit
be160c336e

+ 0 - 7
apps/app/src/features/openai/interfaces/ai-assistant.ts

@@ -1,12 +1,6 @@
 /*
 *  Objects
 */
-export const AiAssistantType = {
-  KNOWLEDGE: 'knowledge',
-  // EDITOR: 'editor',
-  // LEARNING: 'learning',
-} as const;
-
 export const AiAssistantShareScope = {
   PUBLIC: 'public',
   ONLY_ME: 'onlyMe',
@@ -23,6 +17,5 @@ export const AiAssistantOwnerAccessScope = {
 /*
 *  Interfaces
 */
-export type AiAssistantType = typeof AiAssistantType[keyof typeof AiAssistantType];
 export type AiAssistantShareScope = typeof AiAssistantShareScope[keyof typeof AiAssistantShareScope];
 export type AiAssistantOwnerAccessScope = typeof AiAssistantOwnerAccessScope[keyof typeof AiAssistantOwnerAccessScope];

+ 1 - 7
apps/app/src/features/openai/server/models/ai-assistant.ts

@@ -5,7 +5,7 @@ import { type Model, type Document, Schema } from 'mongoose';
 
 import { getOrCreateModel } from '~/server/util/mongoose-utils';
 
-import { AiAssistantType, AiAssistantShareScope, AiAssistantOwnerAccessScope } from '../../interfaces/ai-assistant';
+import { AiAssistantShareScope, AiAssistantOwnerAccessScope } from '../../interfaces/ai-assistant';
 
 import type { VectorStore } from './vector-store';
 
@@ -16,7 +16,6 @@ interface AiAssistant {
   additionalInstruction: string
   pagePathPatterns: string[],
   vectorStore: Ref<VectorStore>
-  types: AiAssistantType[]
   owner: Ref<IUser>
   grantedUsers?: IUser[]
   grantedGroups?: IGrantedGroup[]
@@ -57,11 +56,6 @@ const schema = new Schema<AiAssistantDocument>(
       ref: 'VectorStore',
       required: true,
     },
-    types: [{
-      type: String,
-      enum: Object.values(AiAssistantType),
-      required: true,
-    }],
     owner: {
       type: Schema.Types.ObjectId,
       ref: 'User',