Skip to content

Commit 23424e6

Browse files
HenryHengZJtenuar
authored andcommitted
Bugfix/Add date input type for custom tool (FlowiseAI#4087)
add date input type for custom tool
1 parent b0a487a commit 23424e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/components/src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,12 @@ export const convertSchemaToZod = (schema: string | object): ICommonObject => {
820820
} else {
821821
zodObj[sch.property] = z.boolean().describe(sch.description).optional()
822822
}
823+
} else if (sch.type === 'date') {
824+
if (sch.required) {
825+
zodObj[sch.property] = z.date({ required_error: `${sch.property} required` }).describe(sch.description)
826+
} else {
827+
zodObj[sch.property] = z.date().describe(sch.description).optional()
828+
}
823829
}
824830
}
825831
return zodObj

0 commit comments

Comments
 (0)