@n8n-plus/n8n-plus
Version:
n8n Workflow Automation Tool (plus edition)
47 lines (46 loc) • 2.66 kB
TypeScript
import { ChatHubConversationModel, ChatSessionId, type ChatHubBaseLLMModel, type ChatHubInputModality } from '@n8n/api-types';
import { Logger } from '@n8n/backend-common';
import { SharedWorkflowRepository, WorkflowRepository } from '@n8n/db';
import { EntityManager } from '@n8n/typeorm';
import { IExecuteData, INode, INodeCredentials, IRunExecutionData, IWorkflowBase, type IBinaryData } from 'n8n-workflow';
import { ChatHubMessage } from './chat-hub-message.entity';
import { type ChatTriggerResponseMode } from './chat-hub.types';
import { ChatHubAttachmentService } from './chat-hub.attachment.service';
export declare class ChatHubWorkflowService {
private readonly logger;
private readonly workflowRepository;
private readonly sharedWorkflowRepository;
private readonly chatHubAttachmentService;
constructor(logger: Logger, workflowRepository: WorkflowRepository, sharedWorkflowRepository: SharedWorkflowRepository, chatHubAttachmentService: ChatHubAttachmentService);
createChatWorkflow(userId: string, sessionId: ChatSessionId, projectId: string, history: ChatHubMessage[], humanMessage: string, attachments: IBinaryData[], credentials: INodeCredentials, model: ChatHubBaseLLMModel, systemMessage: string | undefined, tools: INode[], timeZone: string, trx?: EntityManager): Promise<{
workflowData: IWorkflowBase;
executionData: IRunExecutionData;
responseMode: ChatTriggerResponseMode;
}>;
createTitleGenerationWorkflow(userId: string, sessionId: ChatSessionId, projectId: string, humanMessage: string, attachments: IBinaryData[], credentials: INodeCredentials, model: ChatHubConversationModel, trx?: EntityManager): Promise<{
workflowData: IWorkflowBase;
executionData: IRunExecutionData;
}>;
prepareExecutionData(triggerNode: INode, sessionId: string, message: string, attachments: IBinaryData[]): IExecuteData[];
parseInputModalities(options?: {
allowFileUploads?: boolean;
allowedFilesMimeTypes?: string;
}): ChatHubInputModality[];
private getUniqueNodeName;
private buildChatWorkflow;
private buildTitleGenerationWorkflow;
private buildChatTriggerNode;
getSystemMessageMetadata(timeZone: string): string;
private getBaseSystemMessage;
private buildToolsAgentNode;
private buildModelNode;
private buildMemoryNode;
private buildRestoreMemoryNode;
private buildMessageValuesWithAttachments;
private buildContentBlockForAttachment;
private isTextFile;
private buildClearMemoryNode;
private buildMergeNode;
private buildTitleGeneratorAgentNode;
private getMimeTypeModality;
}