1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-09-11 13:15:28 +03:00

fix: Chat Trigger exclude summarization node from valid ai nodes (#8875)

This commit is contained in:
Michael Kret 2024-03-14 09:43:56 +02:00 committed by GitHub
parent 5201484d7a
commit 4861556a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 3 deletions

View File

@ -128,6 +128,7 @@ import {
AI_CATEGORY_CHAINS,
AI_CODE_NODE_TYPE,
AI_SUBCATEGORY,
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
CHAT_EMBED_MODAL_KEY,
CHAT_TRIGGER_NODE_TYPE,
MANUAL_CHAT_TRIGGER_NODE_TYPE,
@ -297,6 +298,7 @@ export default defineComponent({
const workflow = this.workflowHelpers.getCurrentWorkflow();
const chatNode = this.workflowsStore.getNodes().find((node: INodeUi): boolean => {
if (node.type === CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE) return false;
const nodeType = this.nodeTypesStore.getNodeType(node.type, node.typeVersion);
if (!nodeType) return false;
@ -335,7 +337,7 @@ export default defineComponent({
if (!chatNode) {
this.showError(
new Error(
'Chat only works when an AI agent or chain is connected to the chat trigger node',
'Chat only works when an AI agent or chain(except summarization chain) is connected to the chat trigger node',
),
'Missing AI node',
);

View File

@ -105,7 +105,7 @@ describe('WorkflowLMChatModal', () => {
await waitFor(() =>
expect(document.querySelectorAll('.el-notification')[0]).toHaveTextContent(
'Missing AI node Chat only works when an AI agent or chain is connected to the chat trigger node',
'Missing AI node Chat only works when an AI agent or chain(except summarization chain) is connected to the chat trigger node',
),
);
});
@ -120,7 +120,7 @@ describe('WorkflowLMChatModal', () => {
await waitFor(() =>
expect(document.querySelectorAll('.el-notification')[1]).toHaveTextContent(
'Missing AI node Chat only works when an AI agent or chain is connected to the chat trigger node',
'Missing AI node Chat only works when an AI agent or chain(except summarization chain) is connected to the chat trigger node',
),
);
});

View File

@ -181,6 +181,8 @@ export const CRYPTO_NODE_TYPE = 'n8n-nodes-base.crypto';
export const RSS_READ_NODE_TYPE = 'n8n-nodes-base.rssFeedRead';
export const COMPRESSION_NODE_TYPE = 'n8n-nodes-base.compression';
export const EDIT_IMAGE_NODE_TYPE = 'n8n-nodes-base.editImage';
export const CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE =
'@n8n/n8n-nodes-langchain.chainSummarization';
export const CREDENTIAL_ONLY_NODE_PREFIX = 'n8n-creds-base';
export const CREDENTIAL_ONLY_HTTP_NODE_VERSION = 4.1;