mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
disabled ouput parser streaming
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { getBaseClasses, INode, INodeData, INodeParams } from '../../../src'
|
||||
import { BaseOutputParser } from 'langchain/schema/output_parser'
|
||||
import { CommaSeparatedListOutputParser } from 'langchain/output_parsers'
|
||||
import { CATEGORY } from '../OutputParserHelpers'
|
||||
|
||||
class CSVListOutputParser implements INode {
|
||||
label: string
|
||||
name: string
|
||||
version: number
|
||||
description: string
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
baseClasses: string[]
|
||||
inputs: INodeParams[]
|
||||
credential: INodeParams
|
||||
|
||||
constructor() {
|
||||
this.label = 'CSV Output Parser'
|
||||
this.name = 'csvOutputParser'
|
||||
this.version = 1.0
|
||||
this.type = 'CSVListOutputParser'
|
||||
this.description = 'Parse the output of an LLM call as a comma-separated list of values'
|
||||
this.icon = 'csv.png'
|
||||
this.category = CATEGORY
|
||||
this.baseClasses = [this.type, ...getBaseClasses(BaseOutputParser)]
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Autofix',
|
||||
name: 'autofixParser',
|
||||
type: 'boolean',
|
||||
optional: true,
|
||||
description: 'In the event that the first call fails, will make another call to the model to fix any errors.'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData): Promise<any> {
|
||||
const autoFix = nodeData.inputs?.autofixParser as boolean
|
||||
|
||||
const commaSeparatedListOutputParser = new CommaSeparatedListOutputParser()
|
||||
Object.defineProperty(commaSeparatedListOutputParser, 'autoFix', {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: autoFix
|
||||
})
|
||||
return commaSeparatedListOutputParser
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: CSVListOutputParser }
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
Reference in New Issue
Block a user