@n8n/n8n-nodes-langchain 1.108.0 → 1.108.1-exp.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,7 +37,7 @@ function getInputs(parameters) {
|
|
|
37
37
|
}
|
|
38
38
|
];
|
|
39
39
|
const needsFallback = parameters?.needsFallback;
|
|
40
|
-
if (needsFallback ===
|
|
40
|
+
if (needsFallback === true) {
|
|
41
41
|
inputs.push({
|
|
42
42
|
displayName: "Fallback Model",
|
|
43
43
|
maxConnections: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/config.ts"],"sourcesContent":["import {\n\tAIMessagePromptTemplate,\n\tHumanMessagePromptTemplate,\n\tSystemMessagePromptTemplate,\n} from '@langchain/core/prompts';\nimport type { IDataObject, INodeInputConfiguration, INodeProperties } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport { promptTypeOptions, textFromPreviousNode } from '@utils/descriptions';\nimport { getBatchingOptionFields, getTemplateNoticeField } from '@utils/sharedFields';\n\n/**\n * Dynamic input configuration generation based on node parameters\n */\nexport function getInputs(parameters: IDataObject) {\n\tconst inputs: INodeInputConfiguration[] = [\n\t\t{ displayName: '', type: 'main' },\n\t\t{\n\t\t\tdisplayName: 'Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t},\n\t];\n\n\tconst needsFallback = parameters?.needsFallback;\n\n\tif (needsFallback === undefined || needsFallback === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Fallback Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t});\n\t}\n\n\t// If `hasOutputParser` is undefined it must be version 1.3 or earlier so we\n\t// always add the output parser input\n\tconst hasOutputParser = parameters?.hasOutputParser;\n\tif (hasOutputParser === undefined || hasOutputParser === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Output Parser',\n\t\t\ttype: 'ai_outputParser',\n\t\t\tmaxConnections: 1,\n\t\t\trequired: false,\n\t\t});\n\t}\n\n\treturn inputs;\n}\n\n/**\n * Node properties configuration\n */\nexport const nodeProperties: INodeProperties[] = [\n\tgetTemplateNoticeField(1978),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chat_input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.1, 1.2],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chatInput }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptions,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.2, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: { show: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\tdisplayName: 'Prompt (User Message)',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Require Specific Output Format',\n\t\tname: 'hasOutputParser',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Enable Fallback Model',\n\t\tname: 'needsFallback',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Chat Messages (if Using a Chat Model)',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add prompt',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'messageValues',\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Type Name or ID',\n\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'AI',\n\t\t\t\t\t\t\t\tvalue: AIMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'System',\n\t\t\t\t\t\t\t\tvalue: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: HumanMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message Type',\n\t\t\t\t\t\tname: 'messageType',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Simple text message',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (Binary)',\n\t\t\t\t\t\t\t\tvalue: 'imageBinary',\n\t\t\t\t\t\t\t\tdescription: 'Process the binary input from the previous node',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (URL)',\n\t\t\t\t\t\t\t\tvalue: 'imageUrl',\n\t\t\t\t\t\t\t\tdescription: 'Process the image from the specified URL',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Data Field Name',\n\t\t\t\t\t\tname: 'binaryImageDataKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: 'data',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The name of the field in the chain's input that contains the binary image file to be processed\",\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image URL',\n\t\t\t\t\t\tname: 'imageUrl',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription: 'URL to the image to be processed',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Details',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Control how the model processes the image and generates its textual understanding',\n\t\t\t\t\t\tname: 'imageDetail',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Low',\n\t\t\t\t\t\t\t\tvalue: 'low',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'High',\n\t\t\t\t\t\t\t\tvalue: 'high',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t},\n\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message',\n\t\t\t\t\t\tname: 'message',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tgetBatchingOptionFields({\n\t\tshow: {\n\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t},\n\t}),\n\t{\n\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\tname: 'notice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\thasOutputParser: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\tname: 'fallbackNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tneedsFallback: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAIO;AAEP,0BAAoC;AAEpC,0BAAwD;AACxD,0BAAgE;AAKzD,SAAS,UAAU,YAAyB;AAClD,QAAM,SAAoC;AAAA,IACzC,EAAE,aAAa,IAAI,MAAM,OAAO;AAAA,IAChC;AAAA,MACC,aAAa;AAAA,MACb,gB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;AAAA,gBAC3C,aAAa,CAAC,eAAe,UAAU;AAAA,cACxC;AAAA,YACD;AAAA,YACA,SAAS;AAAA,cACR;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aACC;AAAA,cACF;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aACC;AAAA,cACF;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aACC;AAAA,cACF;AAAA,YACD;AAAA,YACA,SAAS;AAAA,UACV;AAAA,UAEA;AAAA,YACC,aAAa;AAAA,YACb,MAAM;AAAA,YACN,MAAM;AAAA,YACN,UAAU;AAAA,YACV,gBAAgB;AAAA,cACf,MAAM;AAAA,gBACL,aAAa,CAAC,eAAe,UAAU;AAAA,cACxC;AAAA,YACD;AAAA,YACA,SAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,MACA,6CAAwB;AAAA,IACvB,MAAM;AAAA,MACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,IACpC;AAAA,EACD,CAAC;AAAA,EACD;AAAA,IACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,IAC7I,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,iBAAiB,CAAC,IAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aACC;AAAA,IACD,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,eAAe,CAAC,IAAI;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../nodes/chains/ChainLLM/methods/config.ts"],"sourcesContent":["import {\n\tAIMessagePromptTemplate,\n\tHumanMessagePromptTemplate,\n\tSystemMessagePromptTemplate,\n} from '@langchain/core/prompts';\nimport type { IDataObject, INodeInputConfiguration, INodeProperties } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport { promptTypeOptions, textFromPreviousNode } from '@utils/descriptions';\nimport { getBatchingOptionFields, getTemplateNoticeField } from '@utils/sharedFields';\n\n/**\n * Dynamic input configuration generation based on node parameters\n */\nexport function getInputs(parameters: IDataObject) {\n\tconst inputs: INodeInputConfiguration[] = [\n\t\t{ displayName: '', type: 'main' },\n\t\t{\n\t\t\tdisplayName: 'Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t},\n\t];\n\n\tconst needsFallback = parameters?.needsFallback;\n\n\tif (needsFallback === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Fallback Model',\n\t\t\tmaxConnections: 1,\n\t\t\ttype: 'ai_languageModel',\n\t\t\trequired: true,\n\t\t});\n\t}\n\n\t// If `hasOutputParser` is undefined it must be version 1.3 or earlier so we\n\t// always add the output parser input\n\tconst hasOutputParser = parameters?.hasOutputParser;\n\tif (hasOutputParser === undefined || hasOutputParser === true) {\n\t\tinputs.push({\n\t\t\tdisplayName: 'Output Parser',\n\t\t\ttype: 'ai_outputParser',\n\t\t\tmaxConnections: 1,\n\t\t\trequired: false,\n\t\t});\n\t}\n\n\treturn inputs;\n}\n\n/**\n * Node properties configuration\n */\nexport const nodeProperties: INodeProperties[] = [\n\tgetTemplateNoticeField(1978),\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chat_input }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.1, 1.2],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '={{ $json.chatInput }}',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\t'@version': [1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...promptTypeOptions,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.2, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\t...textFromPreviousNode,\n\t\tdisplayOptions: { show: { promptType: ['auto'], '@version': [{ _cnd: { gte: 1.5 } }] } },\n\t},\n\t{\n\t\tdisplayName: 'Prompt (User Message)',\n\t\tname: 'text',\n\t\ttype: 'string',\n\t\trequired: true,\n\t\tdefault: '',\n\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tpromptType: ['define'],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Require Specific Output Format',\n\t\tname: 'hasOutputParser',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Enable Fallback Model',\n\t\tname: 'needsFallback',\n\t\ttype: 'boolean',\n\t\tdefault: false,\n\t\tnoDataExpression: true,\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\t'@version': [1, 1.1, 1.3],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Chat Messages (if Using a Chat Model)',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tdefault: {},\n\t\tplaceholder: 'Add prompt',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'messageValues',\n\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Type Name or ID',\n\t\t\t\t\t\tname: 'type',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'AI',\n\t\t\t\t\t\t\t\tvalue: AIMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'System',\n\t\t\t\t\t\t\t\tvalue: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: HumanMessagePromptTemplate.lc_name(),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: SystemMessagePromptTemplate.lc_name(),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message Type',\n\t\t\t\t\t\tname: 'messageType',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Text',\n\t\t\t\t\t\t\t\tvalue: 'text',\n\t\t\t\t\t\t\t\tdescription: 'Simple text message',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (Binary)',\n\t\t\t\t\t\t\t\tvalue: 'imageBinary',\n\t\t\t\t\t\t\t\tdescription: 'Process the binary input from the previous node',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Image (URL)',\n\t\t\t\t\t\t\t\tvalue: 'imageUrl',\n\t\t\t\t\t\t\t\tdescription: 'Process the image from the specified URL',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'text',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Data Field Name',\n\t\t\t\t\t\tname: 'binaryImageDataKey',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: 'data',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"The name of the field in the chain's input that contains the binary image file to be processed\",\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image URL',\n\t\t\t\t\t\tname: 'imageUrl',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdescription: 'URL to the image to be processed',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\tmessageType: ['imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Image Details',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t'Control how the model processes the image and generates its textual understanding',\n\t\t\t\t\t\tname: 'imageDetail',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t\ttype: [HumanMessagePromptTemplate.lc_name()],\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Auto',\n\t\t\t\t\t\t\t\tvalue: 'auto',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Low',\n\t\t\t\t\t\t\t\tvalue: 'low',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'High',\n\t\t\t\t\t\t\t\tvalue: 'high',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t'Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens.',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'auto',\n\t\t\t\t\t},\n\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Message',\n\t\t\t\t\t\tname: 'message',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\trequired: true,\n\t\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\t\thide: {\n\t\t\t\t\t\t\t\tmessageType: ['imageBinary', 'imageUrl'],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\tgetBatchingOptionFields({\n\t\tshow: {\n\t\t\t'@version': [{ _cnd: { gte: 1.7 } }],\n\t\t},\n\t}),\n\t{\n\t\tdisplayName: `Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='${NodeConnectionTypes.AiOutputParser}'>output parser</a> on the canvas to specify the output format you require`,\n\t\tname: 'notice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\thasOutputParser: [true],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName:\n\t\t\t'Connect an additional language model on the canvas to use it as a fallback if the main model fails',\n\t\tname: 'fallbackNotice',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tneedsFallback: [true],\n\t\t\t},\n\t\t},\n\t},\n];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAIO;AAEP,0BAAoC;AAEpC,0BAAwD;AACxD,0BAAgE;AAKzD,SAAS,UAAU,YAAyB;AAClD,QAAM,SAAoC;AAAA,IACzC,EAAE,aAAa,IAAI,MAAM,OAAO;AAAA,IAChC;AAAA,MACC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,IACX;AAAA,EACD;AAEA,QAAM,gBAAgB,YAAY;AAElC,MAAI,kBAAkB,MAAM;AAC3B,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,MAAM;AAAA,MACN,UAAU;AAAA,IACX,CAAC;AAAA,EACF;AAIA,QAAM,kBAAkB,YAAY;AACpC,MAAI,oBAAoB,UAAa,oBAAoB,MAAM;AAC9D,WAAO,KAAK;AAAA,MACX,aAAa;AAAA,MACb,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACX,CAAC;AAAA,EACF;AAEA,SAAO;AACR;AAKO,MAAM,iBAAoC;AAAA,MAChD,4CAAuB,IAAI;AAAA,EAC3B;AAAA,IACC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A,YACA,SAAS;AAAA,UACV;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,MACA,6CAAwB;AAAA,IACvB,MAAM;AAAA,MACL,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC;AAAA,IACpC;AAAA,EACD,CAAC;AAAA,EACD;AAAA,IACC,aAAa,8FAA8F,wCAAoB,cAAc;AAAA,IAC7I,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,iBAAiB,CAAC,IAAI;AAAA,MACvB;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aACC;AAAA,IACD,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,gBAAgB;AAAA,MACf,MAAM;AAAA,QACL,eAAe,CAAC,IAAI;AAAA,MACrB;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
|
package/dist/types/nodes.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{"displayName":"OpenAI Assistant","name":"openAiAssistant","hidden":true,"icon":"fa:robot","group":["transform"],"version":[1,1.1],"description":"Utilizes Assistant API from Open AI.","subtitle":"Open AI Assistant","defaults":{"name":"OpenAI Assistant","color":"#404040"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Agents","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.openaiassistant/"}]}},"inputs":[{"type":"main"},{"type":"ai_tool","displayName":"Tools"}],"outputs":["main"],"credentials":[{"name":"openAiApi","required":true}],"requestDefaults":{"ignoreHttpStatusErrors":true,"baseURL":"={{ $parameter.options?.baseURL?.split(\"/\").slice(0,-1).join(\"/\") || \"https://api.openai.com\" }}"},"properties":[{"displayName":"Operation","name":"mode","type":"options","noDataExpression":true,"default":"existing","options":[{"name":"Use New Assistant","value":"new"},{"name":"Use Existing Assistant","value":"existing"}]},{"displayName":"Name","name":"name","type":"string","default":"","required":true,"displayOptions":{"show":{"/mode":["new"]}}},{"displayName":"Instructions","name":"instructions","type":"string","description":"How the Assistant and model should behave or respond","default":"","typeOptions":{"rows":5},"displayOptions":{"show":{"/mode":["new"]}}},{"displayName":"Model","name":"model","type":"options","description":"The model which will be used to power the assistant. <a href=\"https://beta.openai.com/docs/models/overview\">Learn more</a>. The Retrieval tool requires gpt-3.5-turbo-1106 and gpt-4-1106-preview models.","required":true,"displayOptions":{"show":{"/mode":["new"]}},"typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","url":"={{ $parameter.options?.baseURL?.split(\"/\").slice(-1).pop() || \"v1\" }}/models"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"filter","properties":{"pass":"={{ $responseItem.id.startsWith('gpt-') && !$responseItem.id.includes('instruct') }}"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.id}}","value":"={{$responseItem.id}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"model"}},"default":"gpt-3.5-turbo-1106"},{"displayName":"Assistant","name":"assistantId","type":"options","noDataExpression":true,"displayOptions":{"show":{"/mode":["existing"]}},"description":"The assistant to use. <a href=\"https://beta.openai.com/docs/assistants/overview\">Learn more</a>.","typeOptions":{"loadOptions":{"routing":{"request":{"method":"GET","headers":{"OpenAI-Beta":"assistants=v1"},"url":"={{ $parameter.options?.baseURL?.split(\"/\").slice(-1).pop() || \"v1\" }}/assistants"},"output":{"postReceive":[{"type":"rootProperty","properties":{"property":"data"}},{"type":"setKeyValue","properties":{"name":"={{$responseItem.name}}","value":"={{$responseItem.id}}","description":"={{$responseItem.model}}"}},{"type":"sort","properties":{"key":"name"}}]}}}},"routing":{"send":{"type":"body","property":"assistant"}},"required":true,"default":""},{"displayName":"Text","name":"text","type":"string","required":true,"default":"={{ $json.chat_input }}","displayOptions":{"show":{"@version":[1]}}},{"displayName":"Text","name":"text","type":"string","required":true,"default":"={{ $json.chatInput }}","displayOptions":{"show":{"@version":[1.1]}}},{"displayName":"OpenAI Tools","name":"nativeTools","type":"multiOptions","default":[],"options":[{"name":"Code Interpreter","value":"code_interpreter"},{"name":"Knowledge Retrieval","value":"retrieval"}]},{"displayName":"Connect your own custom tools to this node on the canvas","name":"noticeTools","type":"notice","default":""},{"displayName":"Upload files for retrieval using the <a href=\"https://platform.openai.com/playground\" target=\"_blank\">OpenAI website<a/>","name":"noticeTools","type":"notice","typeOptions":{"noticeTheme":"info"},"displayOptions":{"show":{"/nativeTools":["retrieval"]}},"default":""},{"displayName":"Options","name":"options","placeholder":"Add Option","description":"Additional options to add","type":"collection","default":{},"options":[{"displayName":"Base URL","name":"baseURL","default":"https://api.openai.com/v1","description":"Override the default base URL for the API","type":"string"},{"displayName":"Max Retries","name":"maxRetries","default":2,"description":"Maximum number of retries to attempt","type":"number"},{"displayName":"Timeout","name":"timeout","default":10000,"description":"Maximum amount of time a request is allowed to take in milliseconds","type":"number"}]}]},
|
|
9
9
|
{"displayName":"Summarization Chain","name":"chainSummarization","icon":"fa:link","iconColor":"black","group":["transform"],"description":"Transforms text into a concise summary","codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainsummarization/"}]}},"defaultVersion":2.1,"version":[2,2.1],"defaults":{"name":"Summarization Chain","color":"#909298"},"inputs":"={{ ((parameter) => { function getInputs(parameters) {\n const chunkingMode = parameters?.chunkingMode;\n const operationMode = parameters?.operationMode;\n const inputs = [\n { displayName: \"\", type: \"main\" },\n {\n displayName: \"Model\",\n maxConnections: 1,\n type: \"ai_languageModel\",\n required: true\n }\n ];\n if (operationMode === \"documentLoader\") {\n inputs.push({\n displayName: \"Document\",\n type: \"ai_document\",\n required: true,\n maxConnections: 1\n });\n return inputs;\n }\n if (chunkingMode === \"advanced\") {\n inputs.push({\n displayName: \"Text Splitter\",\n type: \"ai_textSplitter\",\n required: false,\n maxConnections: 1\n });\n return inputs;\n }\n return inputs;\n}; return getInputs(parameter) })($parameter) }}","outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1951\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Data to Summarize","name":"operationMode","noDataExpression":true,"type":"options","description":"How to pass data into the summarization chain","default":"nodeInputJson","options":[{"name":"Use Node Input (JSON)","value":"nodeInputJson","description":"Summarize the JSON data coming into this node from the previous one"},{"name":"Use Node Input (Binary)","value":"nodeInputBinary","description":"Summarize the binary data coming into this node from the previous one"},{"name":"Use Document Loader","value":"documentLoader","description":"Use a loader sub-node with more configuration options"}]},{"displayName":"Chunking Strategy","name":"chunkingMode","noDataExpression":true,"type":"options","description":"Chunk splitting strategy","default":"simple","options":[{"name":"Simple (Define Below)","value":"simple"},{"name":"Advanced","value":"advanced","description":"Use a splitter sub-node with more configuration options"}],"displayOptions":{"show":{"/operationMode":["nodeInputJson","nodeInputBinary"]}}},{"displayName":"Characters Per Chunk","name":"chunkSize","description":"Controls the max size (in terms of number of characters) of the final document chunk","type":"number","default":1000,"displayOptions":{"show":{"/chunkingMode":["simple"]}}},{"displayName":"Chunk Overlap (Characters)","name":"chunkOverlap","type":"number","description":"Specifies how much characters overlap there should be between chunks","default":200,"displayOptions":{"show":{"/chunkingMode":["simple"]}}},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"Input Data Field Name","name":"binaryDataKey","type":"string","default":"data","description":"The name of the field in the agent or chain’s input that contains the binary file to be processed","displayOptions":{"show":{"/operationMode":["nodeInputBinary"]}}},{"displayName":"Summarization Method and Prompts","name":"summarizationMethodAndPrompts","type":"fixedCollection","default":{"values":{"summarizationMethod":"map_reduce","prompt":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","combineMapPrompt":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:"}},"placeholder":"Add Option","typeOptions":{},"options":[{"name":"values","displayName":"Values","values":[{"displayName":"Summarization Method","name":"summarizationMethod","type":"options","description":"The type of summarization to run","default":"map_reduce","options":[{"name":"Map Reduce (Recommended)","value":"map_reduce","description":"Summarize each document (or chunk) individually, then summarize those summaries"},{"name":"Refine","value":"refine","description":"Summarize the first document (or chunk). Then update that summary based on the next document (or chunk), and repeat."},{"name":"Stuff","value":"stuff","description":"Pass all documents (or chunks) at once. Ideal for small datasets."}]},{"displayName":"Individual Summary Prompt","name":"combineMapPrompt","type":"string","hint":"The prompt to summarize an individual document (or chunk)","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","refine"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","typeOptions":{"rows":9}},{"displayName":"Final Prompt to Combine","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt to combine individual summaries","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","refine"]}},"typeOptions":{"rows":9}},{"displayName":"Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["refine","map_reduce"]}},"typeOptions":{"rows":9}},{"displayName":"Subsequent (Refine) Prompt","name":"refinePrompt","type":"string","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","map_reduce"]}},"default":"Your job is to produce a final summary\nWe have provided an existing summary up to a certain point: \"{existing_answer}\"\nWe have the opportunity to refine the existing summary\n(only if needed) with some more context below.\n------------\n\"{text}\"\n------------\n\nGiven the new context, refine the original summary\nIf the context isn't useful, return the original summary.\n\nREFINED SUMMARY:","hint":"The prompt to refine the summary based on the next document (or chunk)","typeOptions":{"rows":9}},{"displayName":"Initial Prompt","name":"refineQuestionPrompt","type":"string","displayOptions":{"hide":{"/options.summarizationMethodAndPrompts.values.summarizationMethod":["stuff","map_reduce"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt for the first document (or chunk)","typeOptions":{"rows":9}}]}]},{"displayName":"Batch Processing","name":"batching","type":"collection","placeholder":"Add Batch Processing Option","description":"Batch processing options for rate limiting","default":{},"options":[{"displayName":"Batch Size","name":"batchSize","default":5,"type":"number","description":"How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering."},{"displayName":"Delay Between Batches","name":"delayBetweenBatches","default":0,"type":"number","description":"Delay in milliseconds between batches. This is useful for rate limiting."}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":2.1}}]}}}]}]},
|
|
10
10
|
{"displayName":"Summarization Chain","name":"chainSummarization","icon":"fa:link","iconColor":"black","group":["transform"],"description":"Transforms text into a concise summary","codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainsummarization/"}]}},"defaultVersion":2.1,"version":1,"defaults":{"name":"Summarization Chain","color":"#909298"},"inputs":["main",{"displayName":"Model","maxConnections":1,"type":"ai_languageModel","required":true},{"displayName":"Document","maxConnections":1,"type":"ai_document","required":true}],"outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1951\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Type","name":"type","type":"options","description":"The type of summarization to run","default":"map_reduce","options":[{"name":"Map Reduce (Recommended)","value":"map_reduce","description":"Summarize each document (or chunk) individually, then summarize those summaries"},{"name":"Refine","value":"refine","description":"Summarize the first document (or chunk). Then update that summary based on the next document (or chunk), and repeat."},{"name":"Stuff","value":"stuff","description":"Pass all documents (or chunks) at once. Ideal for small datasets."}]},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"Final Prompt to Combine","name":"combineMapPrompt","type":"string","hint":"The prompt to combine individual summaries","displayOptions":{"show":{"/type":["map_reduce"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","typeOptions":{"rows":6}},{"displayName":"Individual Summary Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt to summarize an individual document (or chunk)","displayOptions":{"show":{"/type":["map_reduce"]}},"typeOptions":{"rows":6}},{"displayName":"Prompt","name":"prompt","type":"string","default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","displayOptions":{"show":{"/type":["stuff"]}},"typeOptions":{"rows":6}},{"displayName":"Subsequent (Refine) Prompt","name":"refinePrompt","type":"string","displayOptions":{"show":{"/type":["refine"]}},"default":"Your job is to produce a final summary\nWe have provided an existing summary up to a certain point: \"{existing_answer}\"\nWe have the opportunity to refine the existing summary\n(only if needed) with some more context below.\n------------\n\"{text}\"\n------------\n\nGiven the new context, refine the original summary\nIf the context isn't useful, return the original summary.\n\nREFINED SUMMARY:","hint":"The prompt to refine the summary based on the next document (or chunk)","typeOptions":{"rows":6}},{"displayName":"Initial Prompt","name":"refineQuestionPrompt","type":"string","displayOptions":{"show":{"/type":["refine"]}},"default":"Write a concise summary of the following:\n\n\n\"{text}\"\n\n\nCONCISE SUMMARY:","hint":"The prompt for the first document (or chunk)","typeOptions":{"rows":6}}]}]},
|
|
11
|
-
{"displayName":"Basic LLM Chain","name":"chainLlm","icon":"fa:link","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],"description":"A simple chain to prompt a large language model","defaults":{"name":"Basic LLM Chain","color":"#909298"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/"}]}},"inputs":"={{ ((parameter) => { function getInputs(parameters) {\n const inputs = [\n { displayName: \"\", type: \"main\" },\n {\n displayName: \"Model\",\n maxConnections: 1,\n type: \"ai_languageModel\",\n required: true\n }\n ];\n const needsFallback = parameters?.needsFallback;\n if (needsFallback ===
|
|
11
|
+
{"displayName":"Basic LLM Chain","name":"chainLlm","icon":"fa:link","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3,1.4,1.5,1.6,1.7],"description":"A simple chain to prompt a large language model","defaults":{"name":"Basic LLM Chain","color":"#909298"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainllm/"}]}},"inputs":"={{ ((parameter) => { function getInputs(parameters) {\n const inputs = [\n { displayName: \"\", type: \"main\" },\n {\n displayName: \"Model\",\n maxConnections: 1,\n type: \"ai_languageModel\",\n required: true\n }\n ];\n const needsFallback = parameters?.needsFallback;\n if (needsFallback === true) {\n inputs.push({\n displayName: \"Fallback Model\",\n maxConnections: 1,\n type: \"ai_languageModel\",\n required: true\n });\n }\n const hasOutputParser = parameters?.hasOutputParser;\n if (hasOutputParser === void 0 || hasOutputParser === true) {\n inputs.push({\n displayName: \"Output Parser\",\n type: \"ai_outputParser\",\n maxConnections: 1,\n required: false\n });\n }\n return inputs;\n}; return getInputs(parameter) })($parameter) }}","outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1978\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Prompt","name":"prompt","type":"string","required":true,"default":"={{ $json.input }}","displayOptions":{"show":{"@version":[1]}}},{"displayName":"Prompt","name":"prompt","type":"string","required":true,"default":"={{ $json.chat_input }}","displayOptions":{"show":{"@version":[1.1,1.2]}}},{"displayName":"Prompt","name":"prompt","type":"string","required":true,"default":"={{ $json.chatInput }}","displayOptions":{"show":{"@version":[1.3]}}},{"displayName":"Source for Prompt (User Message)","name":"promptType","type":"options","options":[{"name":"Connected Chat Trigger Node","value":"auto","description":"Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger"},{"name":"Define below","value":"define","description":"Use an expression to reference data in previous nodes or enter static text"}],"default":"auto","displayOptions":{"hide":{"@version":[1,1.1,1.2,1.3]}}},{"displayName":"Prompt (User Message)","name":"text","type":"string","required":true,"default":"={{ $json.chatInput }}","typeOptions":{"rows":2},"disabledOptions":{"show":{"promptType":["auto"]}},"displayOptions":{"show":{"promptType":["auto"],"@version":[{"_cnd":{"gte":1.5}}]}}},{"displayName":"Prompt (User Message)","name":"text","type":"string","required":true,"default":"","placeholder":"e.g. Hello, how can you help me?","typeOptions":{"rows":2},"displayOptions":{"show":{"promptType":["define"]}}},{"displayName":"Require Specific Output Format","name":"hasOutputParser","type":"boolean","default":false,"noDataExpression":true,"displayOptions":{"hide":{"@version":[1,1.1,1.3]}}},{"displayName":"Enable Fallback Model","name":"needsFallback","type":"boolean","default":false,"noDataExpression":true,"displayOptions":{"hide":{"@version":[1,1.1,1.3]}}},{"displayName":"Chat Messages (if Using a Chat Model)","name":"messages","type":"fixedCollection","typeOptions":{"multipleValues":true},"default":{},"placeholder":"Add prompt","options":[{"name":"messageValues","displayName":"Prompt","values":[{"displayName":"Type Name or ID","name":"type","type":"options","options":[{"name":"AI","value":"AIMessagePromptTemplate"},{"name":"System","value":"SystemMessagePromptTemplate"},{"name":"User","value":"HumanMessagePromptTemplate"}],"default":"SystemMessagePromptTemplate"},{"displayName":"Message Type","name":"messageType","type":"options","displayOptions":{"show":{"type":["HumanMessagePromptTemplate"]}},"options":[{"name":"Text","value":"text","description":"Simple text message"},{"name":"Image (Binary)","value":"imageBinary","description":"Process the binary input from the previous node"},{"name":"Image (URL)","value":"imageUrl","description":"Process the image from the specified URL"}],"default":"text"},{"displayName":"Image Data Field Name","name":"binaryImageDataKey","type":"string","default":"data","required":true,"description":"The name of the field in the chain's input that contains the binary image file to be processed","displayOptions":{"show":{"messageType":["imageBinary"]}}},{"displayName":"Image URL","name":"imageUrl","type":"string","default":"","required":true,"description":"URL to the image to be processed","displayOptions":{"show":{"messageType":["imageUrl"]}}},{"displayName":"Image Details","description":"Control how the model processes the image and generates its textual understanding","name":"imageDetail","type":"options","displayOptions":{"show":{"type":["HumanMessagePromptTemplate"],"messageType":["imageBinary","imageUrl"]}},"options":[{"name":"Auto","value":"auto","description":"Model will use the auto setting which will look at the image input size and decide if it should use the low or high setting"},{"name":"Low","value":"low","description":"The model will receive a low-res 512px x 512px version of the image, and represent the image with a budget of 65 tokens. This allows the API to return faster responses and consume fewer input tokens for use cases that do not require high detail."},{"name":"High","value":"high","description":"Allows the model to see the low res image and then creates detailed crops of input images as 512px squares based on the input image size. Each of the detailed crops uses twice the token budget (65 tokens) for a total of 129 tokens."}],"default":"auto"},{"displayName":"Message","name":"message","type":"string","required":true,"displayOptions":{"hide":{"messageType":["imageBinary","imageUrl"]}},"default":""}]}]},{"displayName":"Batch Processing","name":"batching","type":"collection","placeholder":"Add Batch Processing Option","description":"Batch processing options for rate limiting","default":{},"options":[{"displayName":"Batch Size","name":"batchSize","default":5,"type":"number","description":"How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering."},{"displayName":"Delay Between Batches","name":"delayBetweenBatches","default":0,"type":"number","description":"Delay in milliseconds between batches. This is useful for rate limiting."}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.7}}]}}},{"displayName":"Connect an <a data-action='openSelectiveNodeCreator' data-action-parameter-connectiontype='ai_outputParser'>output parser</a> on the canvas to specify the output format you require","name":"notice","type":"notice","default":"","displayOptions":{"show":{"hasOutputParser":[true]}}},{"displayName":"Connect an additional language model on the canvas to use it as a fallback if the main model fails","name":"fallbackNotice","type":"notice","default":"","displayOptions":{"show":{"needsFallback":[true]}}}]},
|
|
12
12
|
{"displayName":"Question and Answer Chain","name":"chainRetrievalQa","icon":"fa:link","iconColor":"black","group":["transform"],"version":[1,1.1,1.2,1.3,1.4,1.5,1.6],"description":"Answer questions about retrieved documents","defaults":{"name":"Question and Answer Chain","color":"#909298"},"codex":{"alias":["LangChain"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.chainretrievalqa/"}]}},"inputs":["main",{"displayName":"Model","maxConnections":1,"type":"ai_languageModel","required":true},{"displayName":"Retriever","maxConnections":1,"type":"ai_retriever","required":true}],"outputs":["main"],"credentials":[],"properties":[{"displayName":"Save time with an <a href=\"/templates/1960\" target=\"_blank\">example</a> of how this node works","name":"notice","type":"notice","default":""},{"displayName":"Query","name":"query","type":"string","required":true,"default":"={{ $json.input }}","displayOptions":{"show":{"@version":[1]}}},{"displayName":"Query","name":"query","type":"string","required":true,"default":"={{ $json.chat_input }}","displayOptions":{"show":{"@version":[1.1]}}},{"displayName":"Query","name":"query","type":"string","required":true,"default":"={{ $json.chatInput }}","displayOptions":{"show":{"@version":[1.2]}}},{"displayName":"Source for Prompt (User Message)","name":"promptType","type":"options","options":[{"name":"Connected Chat Trigger Node","value":"auto","description":"Looks for an input field called 'chatInput' that is coming from a directly connected Chat Trigger"},{"name":"Define below","value":"define","description":"Use an expression to reference data in previous nodes or enter static text"}],"default":"auto","displayOptions":{"hide":{"@version":[{"_cnd":{"lte":1.2}}]}}},{"displayName":"Prompt (User Message)","name":"text","type":"string","required":true,"default":"={{ $json.chatInput }}","typeOptions":{"rows":2},"disabledOptions":{"show":{"promptType":["auto"]}},"displayOptions":{"show":{"promptType":["auto"],"@version":[{"_cnd":{"gte":1.4}}]}}},{"displayName":"Prompt (User Message)","name":"text","type":"string","required":true,"default":"","placeholder":"e.g. Hello, how can you help me?","typeOptions":{"rows":2},"displayOptions":{"show":{"promptType":["define"]}}},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"System Prompt Template","name":"systemPromptTemplate","type":"string","default":"You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question.\nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\nContext: {context}","typeOptions":{"rows":6},"description":"Template string used for the system prompt. This should include the variable `{context}` for the provided context. For text completion models, you should also include the variable `{question}` for the user’s query.","displayOptions":{"show":{"@version":[{"_cnd":{"lt":1.5}}]}}},{"displayName":"System Prompt Template","name":"systemPromptTemplate","type":"string","default":"You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question.\nIf you don't know the answer, just say that you don't know, don't try to make up an answer.\n----------------\nContext: {context}","typeOptions":{"rows":6},"description":"Template string used for the system prompt. This should include the variable `{context}` for the provided context. For text completion models, you should also include the variable `{input}` for the user’s query.","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.5}}]}}},{"displayName":"Batch Processing","name":"batching","type":"collection","placeholder":"Add Batch Processing Option","description":"Batch processing options for rate limiting","default":{},"options":[{"displayName":"Batch Size","name":"batchSize","default":5,"type":"number","description":"How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering."},{"displayName":"Delay Between Batches","name":"delayBetweenBatches","default":0,"type":"number","description":"Delay in milliseconds between batches. This is useful for rate limiting."}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.6}}]}}}]}]},
|
|
13
13
|
{"displayName":"Sentiment Analysis","name":"sentimentAnalysis","icon":"fa:balance-scale-left","iconColor":"black","group":["transform"],"version":[1,1.1],"description":"Analyze the sentiment of your text","codex":{"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.sentimentanalysis/"}]}},"defaults":{"name":"Sentiment Analysis"},"inputs":[{"displayName":"","type":"main"},{"displayName":"Model","maxConnections":1,"type":"ai_languageModel","required":true}],"outputs":"={{((parameters, defaultCategories) => {\n const options = parameters?.options ?? {};\n const categories = options?.categories ?? defaultCategories;\n const categoriesArray = categories.split(\",\").map((cat) => cat.trim());\n const ret = categoriesArray.map((cat) => ({ type: \"main\", displayName: cat }));\n return ret;\n})($parameter, \"Positive, Neutral, Negative\")}}","properties":[{"displayName":"Text to Analyze","name":"inputText","type":"string","required":true,"default":"","description":"Use an expression to reference data in previous nodes or enter static text","typeOptions":{"rows":2}},{"displayName":"Sentiment scores are LLM-generated estimates, not statistically rigorous measurements. They may be inconsistent across runs and should be used as rough indicators only.","name":"detailedResultsNotice","type":"notice","default":"","displayOptions":{"show":{"/options.includeDetailedResults":[true]}}},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"Sentiment Categories","name":"categories","type":"string","default":"Positive, Neutral, Negative","description":"A comma-separated list of categories to analyze","noDataExpression":true,"typeOptions":{"rows":2}},{"displayName":"System Prompt Template","name":"systemPromptTemplate","type":"string","default":"You are highly intelligent and accurate sentiment analyzer. Analyze the sentiment of the provided text. Categorize it into one of the following: {categories}. Use the provided formatting instructions. Only output the JSON.","description":"String to use directly as the system prompt template","typeOptions":{"rows":6}},{"displayName":"Include Detailed Results","name":"includeDetailedResults","type":"boolean","default":false,"description":"Whether to include sentiment strength and confidence scores in the output"},{"displayName":"Enable Auto-Fixing","name":"enableAutoFixing","type":"boolean","default":true,"description":"Whether to enable auto-fixing (may trigger an additional LLM call if output is broken)"},{"displayName":"Batch Processing","name":"batching","type":"collection","placeholder":"Add Batch Processing Option","description":"Batch processing options for rate limiting","default":{},"options":[{"displayName":"Batch Size","name":"batchSize","default":5,"type":"number","description":"How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering."},{"displayName":"Delay Between Batches","name":"delayBetweenBatches","default":0,"type":"number","description":"Delay in milliseconds between batches. This is useful for rate limiting."}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.1}}]}}}]}]},
|
|
14
14
|
{"displayName":"Information Extractor","name":"informationExtractor","icon":"fa:project-diagram","iconColor":"black","group":["transform"],"version":[1,1.1,1.2],"defaultVersion":1.2,"description":"Extract information from text in a structured format","codex":{"alias":["NER","parse","parsing","JSON","data extraction","structured"],"categories":["AI"],"subcategories":{"AI":["Chains","Root Nodes"]},"resources":{"primaryDocumentation":[{"url":"https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.information-extractor/"}]}},"defaults":{"name":"Information Extractor"},"inputs":[{"displayName":"","type":"main"},{"displayName":"Model","maxConnections":1,"type":"ai_languageModel","required":true}],"outputs":["main"],"properties":[{"displayName":"Text","name":"text","type":"string","default":"","description":"The text to extract information from","typeOptions":{"rows":2}},{"displayName":"Schema Type","name":"schemaType","type":"options","noDataExpression":true,"options":[{"name":"From Attribute Descriptions","value":"fromAttributes","description":"Extract specific attributes from the text based on types and descriptions"},{"name":"Generate From JSON Example","value":"fromJson","description":"Generate a schema from an example JSON object"},{"name":"Define using JSON Schema","value":"manual","description":"Define the JSON schema manually"}],"default":"fromAttributes","description":"How to specify the schema for the desired output"},{"displayName":"JSON Example","name":"jsonSchemaExample","type":"json","default":"{\n\t\"state\": \"California\",\n\t\"cities\": [\"Los Angeles\", \"San Francisco\", \"San Diego\"]\n}","noDataExpression":true,"typeOptions":{"rows":10},"displayOptions":{"show":{"schemaType":["fromJson"]}},"description":"Example JSON object to use to generate the schema"},{"displayName":"All properties will be required. To make them optional, use the 'JSON Schema' schema type instead","name":"notice","type":"notice","default":"","displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.2}}],"schemaType":["fromJson"]}}},{"displayName":"Input Schema","name":"inputSchema","type":"json","default":"{\n\t\"type\": \"object\",\n\t\"properties\": {\n\t\t\"state\": {\n\t\t\t\"type\": \"string\"\n\t\t},\n\t\t\"cities\": {\n\t\t\t\"type\": \"array\",\n\t\t\t\"items\": {\n\t\t\t\t\"type\": \"string\"\n\t\t\t}\n\t\t}\n\t}\n}","noDataExpression":false,"typeOptions":{"rows":10},"displayOptions":{"show":{"schemaType":["manual"]}},"description":"Schema to use for the function","hint":"Use <a target=\"_blank\" href=\"https://json-schema.org/\">JSON Schema</a> format (<a target=\"_blank\" href=\"https://json-schema.org/learn/miscellaneous-examples.html\">examples</a>). $refs syntax is currently not supported."},{"displayName":"Attributes","name":"attributes","placeholder":"Add Attribute","type":"fixedCollection","default":{},"displayOptions":{"show":{"schemaType":["fromAttributes"]}},"typeOptions":{"multipleValues":true},"options":[{"name":"attributes","displayName":"Attribute List","values":[{"displayName":"Name","name":"name","type":"string","default":"","description":"Attribute to extract","placeholder":"e.g. company_name","required":true},{"displayName":"Type","name":"type","type":"options","description":"Data type of the attribute","required":true,"options":[{"name":"Boolean","value":"boolean"},{"name":"Date","value":"date"},{"name":"Number","value":"number"},{"name":"String","value":"string"}],"default":"string"},{"displayName":"Description","name":"description","type":"string","default":"","description":"Describe your attribute","placeholder":"Add description for the attribute","required":true},{"displayName":"Required","name":"required","type":"boolean","default":false,"description":"Whether attribute is required","required":true}]}]},{"displayName":"Options","name":"options","type":"collection","default":{},"placeholder":"Add Option","options":[{"displayName":"System Prompt Template","name":"systemPromptTemplate","type":"string","default":"You are an expert extraction algorithm.\nOnly extract relevant information from the text.\nIf you do not know the value of an attribute asked to extract, you may omit the attribute's value.","description":"String to use directly as the system prompt template","typeOptions":{"rows":6}},{"displayName":"Batch Processing","name":"batching","type":"collection","placeholder":"Add Batch Processing Option","description":"Batch processing options for rate limiting","default":{},"options":[{"displayName":"Batch Size","name":"batchSize","default":5,"type":"number","description":"How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering."},{"displayName":"Delay Between Batches","name":"delayBetweenBatches","default":0,"type":"number","description":"Delay in milliseconds between batches. This is useful for rate limiting."}],"displayOptions":{"show":{"@version":[{"_cnd":{"gte":1.1}}]}}}]}]},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/n8n-nodes-langchain",
|
|
3
|
-
"version": "1.108.0",
|
|
3
|
+
"version": "1.108.1-exp.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"files": [
|
|
@@ -219,8 +219,8 @@
|
|
|
219
219
|
"@n8n/errors": "^0.4.0",
|
|
220
220
|
"@n8n/json-schema-to-zod": "1.5.0",
|
|
221
221
|
"@n8n/typescript-config": "1.3.0",
|
|
222
|
-
"n8n-
|
|
223
|
-
"n8n-
|
|
222
|
+
"n8n-workflow": "1.106.0",
|
|
223
|
+
"n8n-nodes-base": "1.107.0-exp.0"
|
|
224
224
|
},
|
|
225
225
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
226
226
|
"homepage": "https://n8n.io",
|