chore: llm upgrade

This commit is contained in:
Joel 2024-08-22 14:34:58 +08:00
parent 651547c3ef
commit 51cec1b9ba
3 changed files with 16 additions and 11 deletions

View File

@ -72,11 +72,11 @@ const Input = ({
/>
{showClearIcon && value && !disabled && !destructive && (
<div className={cn('absolute right-2 top-1/2 -translate-y-1/2 group p-[1px] cursor-pointer')} onClick={onClear}>
<RiCloseCircleFill className='w-3.5 h-3.5 text-text-quaternary cursor-pointer group-hover:text-text-tertiary'/>
<RiCloseCircleFill className='w-3.5 h-3.5 text-text-quaternary cursor-pointer group-hover:text-text-tertiary' />
</div>
)}
{destructive && (
<RiErrorWarningLine className='absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-text-destructive-secondary'/>
<RiErrorWarningLine className='absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-text-destructive-secondary' />
)}
</div>
)

View File

@ -5,6 +5,7 @@ import {
RiAddLine,
} from '@remixicon/react'
import cn from '@/utils/classnames'
import Button from '@/app/components/base/button'
type Props = {
className?: string
@ -18,13 +19,15 @@ const AddButton: FC<Props> = ({
onClick,
}) => {
return (
<div
className={cn(className, 'flex items-center h-7 justify-center bg-gray-100 hover:bg-gray-200 rounded-lg cursor-pointer text-xs font-medium text-gray-700 space-x-1')}
<Button
className={cn('w-full', className)}
variant='tertiary'
size='medium'
onClick={onClick}
>
<RiAddLine className='w-3.5 h-3.5' />
<RiAddLine className='mr-1 w-3.5 h-3.5' />
<div>{text}</div>
</div>
</Button>
)
}
export default React.memo(AddButton)

View File

@ -9,6 +9,7 @@ import cn from '@/utils/classnames'
import Field from '@/app/components/workflow/nodes/_base/components/field'
import Switch from '@/app/components/base/switch'
import Slider from '@/app/components/base/slider'
import Input from '@/app/components/base/input'
const i18nPrefix = 'workflow.nodes.common.memory'
const WINDOW_SIZE_MIN = 1
@ -144,14 +145,14 @@ const MemoryConfig: FC<Props> = ({
<>
{/* window size */}
<div className='flex justify-between'>
<div className='flex items-center h-8 space-x-1'>
<div className='flex items-center h-8 space-x-2'>
<Switch
defaultValue={payload?.window?.enabled}
onChange={handleWindowEnabledChange}
size='md'
disabled={readonly}
/>
<div className='leading-[18px] text-xs font-medium text-gray-500 uppercase'>{t(`${i18nPrefix}.windowSize`)}</div>
<div className='text-text-tertiary system-xs-medium-uppercase'>{t(`${i18nPrefix}.windowSize`)}</div>
</div>
<div className='flex items-center h-8 space-x-2'>
<Slider
@ -163,16 +164,17 @@ const MemoryConfig: FC<Props> = ({
onChange={handleWindowSizeChange}
disabled={readonly || !payload.window?.enabled}
/>
<input
<Input
value={(payload.window?.size || WINDOW_SIZE_DEFAULT) as number}
className='shrink-0 block ml-4 pl-3 w-12 h-8 appearance-none outline-none rounded-lg bg-gray-100 text-[13px] text-gra-900'
wrapperClassName='w-12'
className='pr-0 appearance-none'
type='number'
min={WINDOW_SIZE_MIN}
max={WINDOW_SIZE_MAX}
step={1}
onChange={e => handleWindowSizeChange(e.target.value)}
onBlur={handleBlur}
disabled={readonly}
disabled={readonly || !payload.window?.enabled}
/>
</div>
</div>