mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-20 01:29:04 +08:00
chore: llm upgrade
This commit is contained in:
parent
651547c3ef
commit
51cec1b9ba
@ -5,6 +5,7 @@ import {
|
|||||||
RiAddLine,
|
RiAddLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
|
import Button from '@/app/components/base/button'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string
|
className?: string
|
||||||
@ -18,13 +19,15 @@ const AddButton: FC<Props> = ({
|
|||||||
onClick,
|
onClick,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<Button
|
||||||
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')}
|
className={cn('w-full', className)}
|
||||||
|
variant='tertiary'
|
||||||
|
size='medium'
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
<RiAddLine className='w-3.5 h-3.5' />
|
<RiAddLine className='mr-1 w-3.5 h-3.5' />
|
||||||
<div>{text}</div>
|
<div>{text}</div>
|
||||||
</div>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export default React.memo(AddButton)
|
export default React.memo(AddButton)
|
||||||
|
@ -9,6 +9,7 @@ import cn from '@/utils/classnames'
|
|||||||
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
||||||
import Switch from '@/app/components/base/switch'
|
import Switch from '@/app/components/base/switch'
|
||||||
import Slider from '@/app/components/base/slider'
|
import Slider from '@/app/components/base/slider'
|
||||||
|
import Input from '@/app/components/base/input'
|
||||||
|
|
||||||
const i18nPrefix = 'workflow.nodes.common.memory'
|
const i18nPrefix = 'workflow.nodes.common.memory'
|
||||||
const WINDOW_SIZE_MIN = 1
|
const WINDOW_SIZE_MIN = 1
|
||||||
@ -144,14 +145,14 @@ const MemoryConfig: FC<Props> = ({
|
|||||||
<>
|
<>
|
||||||
{/* window size */}
|
{/* window size */}
|
||||||
<div className='flex justify-between'>
|
<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
|
<Switch
|
||||||
defaultValue={payload?.window?.enabled}
|
defaultValue={payload?.window?.enabled}
|
||||||
onChange={handleWindowEnabledChange}
|
onChange={handleWindowEnabledChange}
|
||||||
size='md'
|
size='md'
|
||||||
disabled={readonly}
|
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>
|
||||||
<div className='flex items-center h-8 space-x-2'>
|
<div className='flex items-center h-8 space-x-2'>
|
||||||
<Slider
|
<Slider
|
||||||
@ -163,16 +164,17 @@ const MemoryConfig: FC<Props> = ({
|
|||||||
onChange={handleWindowSizeChange}
|
onChange={handleWindowSizeChange}
|
||||||
disabled={readonly || !payload.window?.enabled}
|
disabled={readonly || !payload.window?.enabled}
|
||||||
/>
|
/>
|
||||||
<input
|
<Input
|
||||||
value={(payload.window?.size || WINDOW_SIZE_DEFAULT) as number}
|
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'
|
type='number'
|
||||||
min={WINDOW_SIZE_MIN}
|
min={WINDOW_SIZE_MIN}
|
||||||
max={WINDOW_SIZE_MAX}
|
max={WINDOW_SIZE_MAX}
|
||||||
step={1}
|
step={1}
|
||||||
onChange={e => handleWindowSizeChange(e.target.value)}
|
onChange={e => handleWindowSizeChange(e.target.value)}
|
||||||
onBlur={handleBlur}
|
onBlur={handleBlur}
|
||||||
disabled={readonly}
|
disabled={readonly || !payload.window?.enabled}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user