ai-assistant.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import type { IGrantedGroup, IUser, Ref } from '@growi/core';
  2. import type { VectorStore } from '../server/models/vector-store';
  3. /*
  4. * Objects
  5. */
  6. export const AiAssistantShareScope = {
  7. PUBLIC_ONLY: 'publicOnly',
  8. OWNER: 'owner',
  9. GROUPS: 'groups',
  10. } as const;
  11. export const AiAssistantAccessScope = {
  12. PUBLIC_ONLY: 'publicOnly',
  13. OWNER: 'owner',
  14. GROUPS: 'groups',
  15. } as const;
  16. /*
  17. * Interfaces
  18. */
  19. export type AiAssistantShareScope = typeof AiAssistantShareScope[keyof typeof AiAssistantShareScope];
  20. export type AiAssistantAccessScope = typeof AiAssistantAccessScope[keyof typeof AiAssistantAccessScope];
  21. export interface AiAssistant {
  22. name: string;
  23. description: string
  24. additionalInstruction: string
  25. pagePathPatterns: string[],
  26. vectorStore: Ref<VectorStore>
  27. owner: Ref<IUser>
  28. grantedGroups?: IGrantedGroup[]
  29. shareScope: AiAssistantShareScope
  30. accessScope: AiAssistantAccessScope
  31. }
  32. export type IApiv3AiAssistantCreateParams = Omit<AiAssistant, 'owner' | 'vectorStore'>
  33. export type AccessibleAiAssistants = {
  34. myAiAssistants: AiAssistant[],
  35. teamAiAssistants: AiAssistant[],
  36. }