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:
parent
5201484d7a
commit
4861556a1c
@ -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',
|
||||
);
|
||||
|
@ -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',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user