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
@@ -174,7 +174,7 @@ class ChatflowTool extends StructuredTool {
schema = z.object({
input: z.string().describe('input question')
})
}) as any
constructor({
name,
@@ -42,6 +42,7 @@ export class DynamicStructuredTool<
func: DynamicStructuredToolInput['func']
// @ts-ignore
schema: T
private variables: any[]
private flowObj: any
@@ -63,7 +63,7 @@ export class ReadFileTool extends StructuredTool {
schema = z.object({
file_path: z.string().describe('name of file')
})
}) as any
name = 'read_file'
@@ -77,7 +77,7 @@ class Retriever_Tools implements INode {
const schema = z.object({
input: z.string().describe('input to look up in retriever')
})
}) as any
const tool = new DynamicStructuredTool({ ...input, func, schema })
return tool
@@ -64,7 +64,7 @@ export class WriteFileTool extends StructuredTool {
schema = z.object({
file_path: z.string().describe('name of file'),
text: z.string().describe('text to write to file')
})
}) as any
name = 'write_file'