mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 11:26:52 +08:00
feat: support dialogue count in chatflow (#7440)
This commit is contained in:
@@ -3,7 +3,9 @@ import type { FC } from 'react'
|
||||
import React, { useCallback } from 'react'
|
||||
import type { VariantProps } from 'class-variance-authority'
|
||||
import { cva } from 'class-variance-authority'
|
||||
import { RiQuestionLine } from '@remixicon/react'
|
||||
import cn from '@/utils/classnames'
|
||||
import TooltipPlus from '@/app/components/base/tooltip-plus'
|
||||
|
||||
const variants = cva([], {
|
||||
variants: {
|
||||
@@ -26,6 +28,7 @@ type Props = {
|
||||
selected: boolean
|
||||
disabled?: boolean
|
||||
align?: 'left' | 'center' | 'right'
|
||||
tooltip?: string
|
||||
} & VariantProps<typeof variants>
|
||||
|
||||
const OptionCard: FC<Props> = ({
|
||||
@@ -35,6 +38,7 @@ const OptionCard: FC<Props> = ({
|
||||
selected,
|
||||
disabled,
|
||||
align = 'center',
|
||||
tooltip,
|
||||
}) => {
|
||||
const handleSelect = useCallback(() => {
|
||||
if (selected || disabled)
|
||||
@@ -54,7 +58,14 @@ const OptionCard: FC<Props> = ({
|
||||
)}
|
||||
onClick={handleSelect}
|
||||
>
|
||||
{title}
|
||||
<span>{title}</span>
|
||||
{tooltip && <TooltipPlus
|
||||
popupContent={<div className='w-[240px]'>
|
||||
{tooltip}
|
||||
</div>}
|
||||
>
|
||||
<RiQuestionLine className='ml-0.5 w-[14px] h-[14px] text-text-quaternary' />
|
||||
</TooltipPlus>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -99,6 +99,10 @@ const formatItem = (
|
||||
variable: 'sys.query',
|
||||
type: VarType.string,
|
||||
})
|
||||
res.vars.push({
|
||||
variable: 'sys.dialogue_count',
|
||||
type: VarType.number,
|
||||
})
|
||||
res.vars.push({
|
||||
variable: 'sys.conversation_id',
|
||||
type: VarType.string,
|
||||
|
||||
Reference in New Issue
Block a user