mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Telemetry include basic llm optional promps, trigger on save workflow event (#8981)
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
||||
import { ApplicationError } from './errors/application.error';
|
||||
import {
|
||||
AGENT_LANGCHAIN_NODE_TYPE,
|
||||
CHAIN_LLM_LANGCHAIN_NODE_TYPE,
|
||||
CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE,
|
||||
HTTP_REQUEST_NODE_TYPE,
|
||||
LANGCHAIN_CUSTOM_TOOLS,
|
||||
@@ -168,7 +169,7 @@ export function generateNodesGraph(
|
||||
}
|
||||
|
||||
if (node.type === AGENT_LANGCHAIN_NODE_TYPE) {
|
||||
nodeItem.agent = (node.parameters.agent as string) || 'conversationalAgent';
|
||||
nodeItem.agent = (node.parameters.agent as string) ?? 'conversationalAgent';
|
||||
} else if (node.type === HTTP_REQUEST_NODE_TYPE && node.typeVersion === 1) {
|
||||
try {
|
||||
nodeItem.domain = new URL(node.parameters.url as string).hostname;
|
||||
@@ -228,7 +229,7 @@ export function generateNodesGraph(
|
||||
if (options?.isCloudDeployment === true) {
|
||||
if (node.type === OPENAI_LANGCHAIN_NODE_TYPE) {
|
||||
nodeItem.prompts =
|
||||
(((node.parameters?.messages as IDataObject) || {}).values as IDataObject[]) || [];
|
||||
(((node.parameters?.messages as IDataObject) ?? {}).values as IDataObject[]) ?? [];
|
||||
}
|
||||
|
||||
if (node.type === AGENT_LANGCHAIN_NODE_TYPE) {
|
||||
@@ -265,16 +266,21 @@ export function generateNodesGraph(
|
||||
|
||||
if (node.type === CHAIN_SUMMARIZATION_LANGCHAIN_NODE_TYPE) {
|
||||
nodeItem.prompts = (
|
||||
(((node.parameters?.options as IDataObject) || {})
|
||||
.summarizationMethodAndPrompts as IDataObject) || {}
|
||||
(((node.parameters?.options as IDataObject) ?? {})
|
||||
.summarizationMethodAndPrompts as IDataObject) ?? {}
|
||||
).values as IDataObject;
|
||||
}
|
||||
|
||||
if (LANGCHAIN_CUSTOM_TOOLS.includes(node.type)) {
|
||||
nodeItem.prompts = {
|
||||
description: (node.parameters?.description as string) || '',
|
||||
description: (node.parameters?.description as string) ?? '',
|
||||
};
|
||||
}
|
||||
|
||||
if (node.type === CHAIN_LLM_LANGCHAIN_NODE_TYPE) {
|
||||
nodeItem.prompts =
|
||||
(((node.parameters?.messages as IDataObject) ?? {}).messageValues as IDataObject[]) ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
nodeGraph.nodes[index.toString()] = nodeItem;
|
||||
|
||||
Reference in New Issue
Block a user