@n8n/n8n-nodes-langchain
Version:

73 lines • 3.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutputParserItemList = void 0;
const n8n_workflow_1 = require("n8n-workflow");
const N8nItemListOutputParser_1 = require("../../../utils/output_parsers/N8nItemListOutputParser");
const ai_utilities_1 = require("@n8n/ai-utilities");
class OutputParserItemList {
constructor() {
this.description = {
displayName: 'Item List Output Parser',
name: 'outputParserItemList',
icon: 'node:item-list-output-parser',
iconColor: 'black',
group: ['transform'],
version: 1,
description: 'Return the results as separate items',
defaults: {
name: 'Item List Output Parser',
},
codex: {
categories: ['AI'],
subcategories: {
AI: ['Output Parsers'],
},
resources: {
primaryDocumentation: [
{
url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.outputparseritemlist/',
},
],
},
},
inputs: [],
outputs: [n8n_workflow_1.NodeConnectionTypes.AiOutputParser],
outputNames: ['Output Parser'],
properties: [
(0, ai_utilities_1.getConnectionHintNoticeField)([n8n_workflow_1.NodeConnectionTypes.AiChain, n8n_workflow_1.NodeConnectionTypes.AiAgent]),
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
options: [
{
displayName: 'Number Of Items',
name: 'numberOfItems',
type: 'number',
default: -1,
description: 'Defines how many items should be returned maximally. If set to -1, there is no limit.',
},
{
displayName: 'Separator',
name: 'separator',
type: 'string',
default: '\\n',
description: 'Defines the separator that should be used to split the results into separate items. Defaults to a new line but can be changed depending on the data that should be returned.',
},
],
},
],
};
}
async supplyData(itemIndex) {
const options = this.getNodeParameter('options', itemIndex, {});
const parser = new N8nItemListOutputParser_1.N8nItemListOutputParser(options);
return {
response: parser,
};
}
}
exports.OutputParserItemList = OutputParserItemList;
//# sourceMappingURL=OutputParserItemList.node.js.map