Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/editor-ui/src/components/WorkflowLMChat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
);
});
Expand All @@ -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',
),
);
});
Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading