mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Merge branch 'main' into chore/Upgrade-LC-version
# Conflicts: # packages/components/nodes/cache/RedisCache/RedisCache.ts # packages/components/nodes/cache/RedisCache/RedisEmbeddingsCache.ts # packages/components/nodes/chains/ConversationChain/ConversationChain.ts # packages/components/nodes/tools/RetrieverTool/RetrieverTool.ts # packages/components/nodes/vectorstores/Qdrant/Qdrant.ts # packages/components/nodes/vectorstores/Redis/Redis.ts # packages/components/nodes/vectorstores/Redis/RedisSearchBase.ts # packages/components/nodes/vectorstores/Redis/Redis_Existing.ts # packages/components/nodes/vectorstores/Redis/Redis_Upsert.ts # packages/components/src/agents.ts
This commit is contained in:
+8
-6
@@ -28,16 +28,17 @@ class CustomListOutputParser implements INode {
|
||||
label: 'Length',
|
||||
name: 'length',
|
||||
type: 'number',
|
||||
default: 5,
|
||||
step: 1,
|
||||
description: 'Number of values to return'
|
||||
description: 'Number of values to return',
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'Separator',
|
||||
name: 'separator',
|
||||
type: 'string',
|
||||
description: 'Separator between values',
|
||||
default: ','
|
||||
default: ',',
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'Autofix',
|
||||
@@ -53,10 +54,11 @@ class CustomListOutputParser implements INode {
|
||||
const separator = nodeData.inputs?.separator as string
|
||||
const lengthStr = nodeData.inputs?.length as string
|
||||
const autoFix = nodeData.inputs?.autofixParser as boolean
|
||||
let length = 5
|
||||
if (lengthStr) length = parseInt(lengthStr, 10)
|
||||
|
||||
const parser = new LangchainCustomListOutputParser({ length: length, separator: separator })
|
||||
const parser = new LangchainCustomListOutputParser({
|
||||
length: lengthStr ? parseInt(lengthStr, 10) : undefined,
|
||||
separator: separator
|
||||
})
|
||||
Object.defineProperty(parser, 'autoFix', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
|
||||
Reference in New Issue
Block a user