* Build the zod input schema parameters for the tool. * For chatflows: always has a mandatory `question` string. * For agentflows: only allow one of `question` or `form` (object)
(chatflow: ChatFlow)
| 65 | * For agentflows: only allow one of `question` or `form` (object) |
| 66 | */ |
| 67 | function buildInputSchema(chatflow: ChatFlow) { |
| 68 | const inputType = getToolInputType(chatflow) |
| 69 | if (inputType === 'form') { |
| 70 | return buildFormInputSchema(chatflow) |
| 71 | } |
| 72 | return { |
| 73 | question: z.string().describe('The question or prompt to send to the chatflow') |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Build the zod schema for form input, based on the `startAgentflow` node configuration. |
no test coverage detected