n8n
Version:
n8n Workflow Automation Tool
46 lines (45 loc) • 3.11 kB
TypeScript
import { type ChatHubUpdateAgentRequest, type ChatHubCreateAgentRequest, type ChatHubAgentDto, type ChatModelDto } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import type { EntityManager, User } from '@n8n/db';
import type { ChatHubAgent } from './chat-hub-agent.entity';
import { ChatHubAgentRepository } from './chat-hub-agent.repository';
import { ChatHubCredentialsService } from './chat-hub-credentials.service';
import { ChatHubAttachmentService } from './chat-hub.attachment.service';
import { ChatHubWorkflowService } from './chat-hub-workflow.service';
import { WorkflowExecutionService } from '../../workflows/workflow-execution.service';
import { ChatHubSettingsService } from './chat-hub.settings.service';
import { ChatHubToolService } from './chat-hub-tool.service';
import { ChatHubExecutionService } from './chat-hub-execution.service';
import { DynamicNodeParametersService } from '../../services/dynamic-node-parameters.service';
export declare class ChatHubAgentService {
private readonly logger;
private readonly chatAgentRepository;
private readonly chatHubCredentialsService;
private readonly chatHubAttachmentService;
private readonly chatHubWorkflowService;
private readonly chatHubExecutionService;
private readonly workflowExecutionService;
private readonly chatHubSettingsService;
private readonly dynamicNodeParametersService;
private readonly chatHubToolService;
constructor(logger: Logger, chatAgentRepository: ChatHubAgentRepository, chatHubCredentialsService: ChatHubCredentialsService, chatHubAttachmentService: ChatHubAttachmentService, chatHubWorkflowService: ChatHubWorkflowService, chatHubExecutionService: ChatHubExecutionService, workflowExecutionService: WorkflowExecutionService, chatHubSettingsService: ChatHubSettingsService, dynamicNodeParametersService: DynamicNodeParametersService, chatHubToolService: ChatHubToolService);
getAgentsByUserIdAsModels(userId: string): Promise<ChatModelDto[]>;
convertAgentEntityToModel(agent: ChatHubAgent): ChatModelDto;
getAgentsByUserId(userId: string): Promise<ChatHubAgent[]>;
getAgentById(id: string, userId: string, trx?: EntityManager): Promise<ChatHubAgent>;
getAgentByIdAsDto(id: string, userId: string): Promise<ChatHubAgentDto>;
createAgent(user: User, data: ChatHubCreateAgentRequest): Promise<ChatHubAgentDto>;
updateAgent(id: string, user: User, updates: ChatHubUpdateAgentRequest): Promise<ChatHubAgentDto>;
private toDto;
deleteAgent(id: string, userId: string): Promise<void>;
private ensureSemanticSearchOptions;
private insertEmbeddings;
deleteAllEmbeddingsForUser(userId: string): Promise<void>;
private deleteEmbeddingsByAgentId;
private deleteEmbeddingsByKnowledgeId;
addFilesToAgent(agentId: string, user: User, files: Express.Multer.File[]): Promise<ChatHubAgentDto>;
private runIndexingInBackground;
private updateKnowledgeItemStatuses;
deleteAgentFile(agentId: string, user: User, fileKnowledgeId: string): Promise<void>;
private prepareFilesForIndexing;
}