feat: support OPENAI json_schema (#7258)

This commit is contained in:
非法操作
2024-08-15 11:29:19 +08:00
committed by GitHub
parent 5aa373dc04
commit 6ff7fd80a1
6 changed files with 44 additions and 10 deletions

View File

@@ -100,7 +100,7 @@ const ParameterItem: FC<ParameterItemProps> = ({
handleInputChange(v === 1)
}
const handleStringInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const handleStringInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
handleInputChange(e.target.value)
}
@@ -190,6 +190,16 @@ const ParameterItem: FC<ParameterItemProps> = ({
)
}
if (parameterRule.type === 'text') {
return (
<textarea
className='w-full h-20 ml-4 px-1 rounded-lg bg-gray-100 outline-none text-[12px] text-gray-900'
value={renderValue as string}
onChange={handleStringInputChange}
/>
)
}
if (parameterRule.type === 'string' && !!parameterRule?.options?.length) {
return (
<SimpleSelect