fix AI-359 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added automated cleanup of embeddings for documents deleted or trashed from workspaces. * Introduced a new job to schedule and perform this cleanup per workspace daily and on demand. * Added new GraphQL mutation to manually trigger the cleanup process. * Added the ability to list workspaces with flexible filtering and selection options. * **Improvements** * Enhanced document status handling to more accurately reflect embedding presence. * Refined internal methods for managing and checking document embeddings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
85 lines
2.3 KiB
TypeScript
85 lines
2.3 KiB
TypeScript
import './config';
|
|
|
|
import { Module } from '@nestjs/common';
|
|
|
|
import { ServerConfigModule } from '../../core';
|
|
import { DocStorageModule } from '../../core/doc';
|
|
import { FeatureModule } from '../../core/features';
|
|
import { PermissionModule } from '../../core/permission';
|
|
import { QuotaModule } from '../../core/quota';
|
|
import { WorkspaceModule } from '../../core/workspaces';
|
|
import { IndexerModule } from '../indexer';
|
|
import {
|
|
CopilotContextResolver,
|
|
CopilotContextRootResolver,
|
|
CopilotContextService,
|
|
} from './context';
|
|
import { CopilotController } from './controller';
|
|
import { CopilotCronJobs } from './cron';
|
|
import { CopilotEmbeddingJob } from './embedding';
|
|
import { ChatMessageCache } from './message';
|
|
import { PromptService } from './prompt';
|
|
import { CopilotProviderFactory, CopilotProviders } from './providers';
|
|
import {
|
|
CopilotResolver,
|
|
PromptsManagementResolver,
|
|
UserCopilotResolver,
|
|
} from './resolver';
|
|
import { ChatSessionService } from './session';
|
|
import { CopilotStorage } from './storage';
|
|
import {
|
|
CopilotTranscriptionResolver,
|
|
CopilotTranscriptionService,
|
|
} from './transcript';
|
|
import { CopilotWorkflowExecutors, CopilotWorkflowService } from './workflow';
|
|
import {
|
|
CopilotWorkspaceEmbeddingConfigResolver,
|
|
CopilotWorkspaceEmbeddingResolver,
|
|
CopilotWorkspaceService,
|
|
} from './workspace';
|
|
|
|
@Module({
|
|
imports: [
|
|
DocStorageModule,
|
|
FeatureModule,
|
|
QuotaModule,
|
|
PermissionModule,
|
|
ServerConfigModule,
|
|
WorkspaceModule,
|
|
IndexerModule,
|
|
],
|
|
providers: [
|
|
// providers
|
|
...CopilotProviders,
|
|
CopilotProviderFactory,
|
|
// services
|
|
ChatSessionService,
|
|
CopilotResolver,
|
|
ChatMessageCache,
|
|
PromptService,
|
|
CopilotStorage,
|
|
// workflow
|
|
CopilotWorkflowService,
|
|
...CopilotWorkflowExecutors,
|
|
// context
|
|
CopilotContextResolver,
|
|
CopilotContextService,
|
|
// jobs
|
|
CopilotEmbeddingJob,
|
|
CopilotCronJobs,
|
|
// transcription
|
|
CopilotTranscriptionService,
|
|
CopilotTranscriptionResolver,
|
|
// workspace embeddings
|
|
CopilotWorkspaceService,
|
|
CopilotWorkspaceEmbeddingResolver,
|
|
CopilotWorkspaceEmbeddingConfigResolver,
|
|
// gql resolvers
|
|
UserCopilotResolver,
|
|
PromptsManagementResolver,
|
|
CopilotContextRootResolver,
|
|
],
|
|
controllers: [CopilotController],
|
|
})
|
|
export class CopilotModule {}
|