Feat/update ollama for function calling (#2892)

update ollama for function calling
This commit is contained in:
Henry Heng
2024-07-27 01:29:36 +01:00
committed by GitHub
parent 1338501658
commit 3e54d53692
12 changed files with 462 additions and 417 deletions
@@ -71,7 +71,8 @@ class StructuredOutputParser implements INode {
const autoFix = nodeData.inputs?.autofixParser as boolean
try {
const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(z.object(convertSchemaToZod(jsonStructure)))
const zodSchema = z.object(convertSchemaToZod(jsonStructure)) as any
const structuredOutputParser = LangchainStructuredOutputParser.fromZodSchema(zodSchema)
// NOTE: When we change Flowise to return a json response, the following has to be changed to: JsonStructuredOutputParser
Object.defineProperty(structuredOutputParser, 'autoFix', {