Skip to content

Commit

Permalink
Fix/2969 add model provider ollama not work (langgenius#2973)
Browse files Browse the repository at this point in the history
  • Loading branch information
crazywoola authored Mar 26, 2024
1 parent 7c8c233 commit eeaa3c1
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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>
))
}
Expand Down Expand Up @@ -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 />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ const ProviderCard: FC<ProviderCardProps> = ({
return (
<Button
key={method}
className='h-7 bg-white text-xs text-gray-700'
className={'h-7 bg-white text-xs text-gray-700 shrink-0'}
onClick={() => onOpenModal(method)}
>
<Settings01 className='mr-[5px] w-3.5 h-3.5' />
{t('common.operation.setup')}
<Settings01 className={`mr-[5px] w-3.5 h-3.5 ${s.icon}`} />
<span className='text-xs inline-flex items-center justify-center overflow-ellipsis shrink-0'>{t('common.operation.setup')}</span>
</Button>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ProviderIcon: FC<ProviderIconProps> = ({
return (
<div className={`inline-flex items-center ${className}`}>
<div className='text-xs font-semibold text-black'>
{provider.label[language]}
{provider.label[language] || provider.label.en_US}
</div>
</div>
)
Expand Down
Loading

0 comments on commit eeaa3c1

Please sign in to comment.