Fix/2969 add model provider ollama not work (#2973)

This commit is contained in:
crazywoola
2024-03-26 10:26:34 +08:00
committed by GitHub
parent 7c8c233cf4
commit eeaa3c1643
9 changed files with 309 additions and 133 deletions

View File

@@ -161,7 +161,7 @@ const Form: FC<FormProps> = ({
flex justify-center items-center mr-2 w-4 h-4 border border-gray-300 rounded-full
${value[variable] === option.value && 'border-[5px] border-primary-600'}
`} />
<div className='text-sm text-gray-900'>{option.label[language]}</div>
<div className='text-sm text-gray-900'>{option.label[language] || option.label.en_US}</div>
</div>
))
}
@@ -206,9 +206,9 @@ const Form: FC<FormProps> = ({
return option.show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value)
return true
}).map(option => ({ value: option.value, name: option.label[language] }))}
}).map(option => ({ value: option.value, name: option.label[language] || option.label.en_US }))}
onSelect={item => handleFormChange(variable, item.value as string)}
placeholder={placeholder?.[language]}
placeholder={placeholder?.[language] || placeholder?.en_US}
/>
{fieldMoreInfo?.(formSchema)}
{validating && changeKey === variable && <ValidatingTip />}

View File

@@ -219,7 +219,7 @@ const ModelModal: FC<ModelModalProps> = ({
const renderTitlePrefix = () => {
const prefix = configurateMethod === ConfigurateMethodEnum.customizableModel ? t('common.operation.add') : t('common.operation.setup')
return `${prefix} ${provider.label[language]}`
return `${prefix} ${provider.label[language] || provider.label.en_US}`
}
return (