Просмотр исходного кода

Add AI assistant types and scopes interfaces

Shun Miyazawa 1 год назад
Родитель
Сommit
66be0a2f97

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

@@ -0,0 +1,28 @@
+/*
+*  Objects
+*/
+export const AiAssistantType = {
+  KNOWLEDGE: 'knowledge',
+  // EDITOR: 'editor',
+  // LEARNING: 'learning',
+} as const;
+
+export const AiAssistantShareScope = {
+  PUBLIC: 'public',
+  ONLY_ME: 'onlyMe',
+  USER_GROUP: 'userGroup',
+} as const;
+
+export const AiAssistantOwnerAccessScope = {
+  PUBLIC: 'public',
+  ONLY_ME: 'onlyMe',
+  USER_GROUP: 'userGroup',
+} as const;
+
+
+/*
+*  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];

+ 2 - 28
apps/app/src/features/openai/server/models/ai-assistant.ts

@@ -5,36 +5,10 @@ import { type Model, type Document, Schema } from 'mongoose';
 
 import { getOrCreateModel } from '~/server/util/mongoose-utils';
 
-import type { VectorStore } from './vector-store';
-
-/*
-*  Objects
-*/
-const AiAssistantType = {
-  KNOWLEDGE: 'knowledge',
-  // EDITOR: 'editor',
-  // LEARNING: 'learning',
-} as const;
-
-const AiAssistantShareScope = {
-  PUBLIC: 'public',
-  ONLY_ME: 'onlyMe',
-  USER_GROUP: 'userGroup',
-} as const;
-
-const AiAssistantOwnerAccessScope = {
-  PUBLIC: 'public',
-  ONLY_ME: 'onlyMe',
-  USER_GROUP: 'userGroup',
-} as const;
+import { AiAssistantType, AiAssistantShareScope, AiAssistantOwnerAccessScope } from '../../interfaces/ai-assistant';
 
+import type { VectorStore } from './vector-store';
 
-/*
-*  Interfaces
-*/
-type AiAssistantType = typeof AiAssistantType[keyof typeof AiAssistantType];
-type AiAssistantShareScope = typeof AiAssistantShareScope[keyof typeof AiAssistantShareScope];
-type AiAssistantOwnerAccessScope = typeof AiAssistantOwnerAccessScope[keyof typeof AiAssistantOwnerAccessScope];
 
 interface AiAssistant {
   name: string;