Bugfix/Add date input type for custom tool (#4087)
add date input type for custom tool
This commit is contained in:
parent
97a196e11a
commit
a8d74336dd
|
|
@ -820,6 +820,12 @@ export const convertSchemaToZod = (schema: string | object): ICommonObject => {
|
|||
} else {
|
||||
zodObj[sch.property] = z.boolean().describe(sch.description).optional()
|
||||
}
|
||||
} else if (sch.type === 'date') {
|
||||
if (sch.required) {
|
||||
zodObj[sch.property] = z.date({ required_error: `${sch.property} required` }).describe(sch.description)
|
||||
} else {
|
||||
zodObj[sch.property] = z.date().describe(sch.description).optional()
|
||||
}
|
||||
}
|
||||
}
|
||||
return zodObj
|
||||
|
|
|
|||
Loading…
Reference in New Issue