diff --git a/app/components/welcome/index.tsx b/app/components/welcome/index.tsx index a746fef..4edc25b 100644 --- a/app/components/welcome/index.tsx +++ b/app/components/welcome/index.tsx @@ -122,6 +122,15 @@ const Welcome: FC = ({ onChange={(e) => { setInputs({ ...inputs, [item.key]: e.target.value }) }} /> )} + {item.type === 'number' && ( + { onInputsChange({ ...inputs, [item.key]: e.target.value }) }} + /> + )} ))} diff --git a/utils/prompt.ts b/utils/prompt.ts index d851ea0..fc11182 100644 --- a/utils/prompt.ts +++ b/utils/prompt.ts @@ -24,8 +24,12 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] | if (item['text-input']) return ['string', item['text-input']] + if (item.number) + return ['number', item.number] + return ['select', item.select] })() + if (type === 'string' || type === 'paragraph') { promptVariables.push({ key: content.variable, @@ -36,6 +40,15 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] | options: [], }) } + else if (type === 'number') { + promptVariables.push({ + key: content.variable, + name: content.label, + required: content.required, + type, + options: [], + }) + } else { promptVariables.push({ key: content.variable,