mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 03:01:10 +03:00
Addition of OutputParser for FewShotPromptTemplate
This commit is contained in:
@@ -62,15 +62,15 @@ class StructuredOutputParser implements INode {
|
||||
if (structure) {
|
||||
try {
|
||||
parsedStructure = JSON.parse(structure)
|
||||
if (structureType === 'fromZodSchema') {
|
||||
return LangchainStructuredOutputParser.fromZodSchema(parsedStructure)
|
||||
} else {
|
||||
return LangchainStructuredOutputParser.fromNamesAndDescriptions(parsedStructure)
|
||||
}
|
||||
} catch (exception) {
|
||||
throw new Error('Invalid JSON in StructuredOutputParser: ' + exception)
|
||||
}
|
||||
}
|
||||
if (structureType === 'fromZodSchema') {
|
||||
return LangchainStructuredOutputParser.fromZodSchema(parsedStructure)
|
||||
} else {
|
||||
return LangchainStructuredOutputParser.fromNamesAndDescriptions(parsedStructure)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user