File tree 3 files changed +24
-0
lines changed
3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,15 @@ const Welcome: FC<IWelcomeProps> = ({
122
122
onChange = { ( e ) => { setInputs ( { ...inputs , [ item . key ] : e . target . value } ) } }
123
123
/>
124
124
) }
125
+ { item . type === 'number' && (
126
+ < input
127
+ type = "number"
128
+ className = "block w-full p-2 text-gray-900 border border-gray-300 rounded-lg bg-gray-50 sm:text-xs focus:ring-blue-500 focus:border-blue-500 "
129
+ placeholder = { `${ item . name } ${ ! item . required ? `(${ t ( 'appDebug.variableTable.optional' ) } )` : '' } ` }
130
+ value = { inputs [ item . key ] }
131
+ onChange = { ( e ) => { onInputsChange ( { ...inputs , [ item . key ] : e . target . value } ) } }
132
+ />
133
+ ) }
125
134
</ div >
126
135
) ) }
127
136
</ div >
Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ export type UserInputFormItem = {
37
37
'text-input' : TextTypeFormItem
38
38
} | {
39
39
'select' : SelectTypeFormItem
40
+ } | {
41
+ 'paragraph' : TextTypeFormItem
40
42
}
41
43
42
44
export const MessageRatings = [ 'like' , 'dislike' , null ] as const
Original file line number Diff line number Diff line change @@ -24,8 +24,12 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] |
24
24
if ( item [ 'text-input' ] )
25
25
return [ 'string' , item [ 'text-input' ] ]
26
26
27
+ if ( item . number )
28
+ return [ 'number' , item . number ]
29
+
27
30
return [ 'select' , item . select ]
28
31
} ) ( )
32
+
29
33
if ( type === 'string' || type === 'paragraph' ) {
30
34
promptVariables . push ( {
31
35
key : content . variable ,
@@ -36,6 +40,15 @@ export const userInputsFormToPromptVariables = (useInputs: UserInputFormItem[] |
36
40
options : [ ] ,
37
41
} )
38
42
}
43
+ else if ( type === 'number' ) {
44
+ promptVariables . push ( {
45
+ key : content . variable ,
46
+ name : content . label ,
47
+ required : content . required ,
48
+ type,
49
+ options : [ ] ,
50
+ } )
51
+ }
39
52
else {
40
53
promptVariables . push ( {
41
54
key : content . variable ,
You can’t perform that action at this time.
0 commit comments