This commit is contained in:
Archer
2023-10-24 17:32:36 +08:00
committed by GitHub
parent 1942cb0d67
commit 1dca5edcc6
18 changed files with 142 additions and 73 deletions

View File

@@ -41,7 +41,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
const results: any = await PgClient.query(
`BEGIN;
SET LOCAL hnsw.ef_search = ${global.systemEnv.pgHNSWEfSearch || 60};
SET LOCAL hnsw.ef_search = ${global.systemEnv.pgHNSWEfSearch || 100};
select id, q, a, dataset_id, collection_id, (vector <#> '[${
vectors[0]
}]') * -1 AS score from ${PgDatasetTableName} where dataset_id='${datasetId}' AND user_id='${userId}' ORDER BY vector <#> '[${

View File

@@ -22,7 +22,6 @@ const NodeCard = (props: Props) => {
name = '未知模块',
description,
minW = '300px',
moduleId
} = props;
const { onCopyNode, onDelNode } = useFlowStore();
@@ -81,7 +80,14 @@ const NodeCard = (props: Props) => {
);
return (
<Box minW={minW} bg={'white'} border={theme.borders.md} borderRadius={'md'} boxShadow={'sm'}>
<Box
minW={minW}
maxW={'500px'}
bg={'white'}
border={theme.borders.md}
borderRadius={'md'}
boxShadow={'sm'}
>
<Flex className="custom-drag-handle" px={4} py={3} alignItems={'center'}>
<Avatar src={logo} borderRadius={'md'} objectFit={'contain'} w={'30px'} h={'30px'} />
<Box ml={3} fontSize={'lg'} color={'myGray.600'}>

View File

@@ -498,7 +498,7 @@ var SelectDatasetRender = React.memo(function SelectDatasetRender({ item, module
return (
<>
<Grid gridTemplateColumns={'1fr 1fr'} gridGap={4}>
<Grid gridTemplateColumns={'repeat(2, minmax(0, 1fr))'} gridGap={4} w={'100%'}>
<Button h={'36px'} onClick={onOpenKbSelect}>
</Button>
@@ -512,7 +512,14 @@ var SelectDatasetRender = React.memo(function SelectDatasetRender({ item, module
borderRadius={'md'}
>
<Avatar src={item.avatar} w={'24px'}></Avatar>
<Box ml={3} fontWeight={'bold'} fontSize={['md', 'lg', 'xl']}>
<Box
ml={3}
flex={'1 0 0'}
w={0}
className="textEllipsis"
fontWeight={'bold'}
fontSize={['md', 'lg', 'xl']}
>
{item.name}
</Box>
</Flex>

View File

@@ -51,7 +51,6 @@ import { getGuideModule } from '@/global/core/app/modules/utils';
import dynamic from 'next/dynamic';
import MySelect from '@/components/Select';
import MySlider from '@/components/Slider';
import MyTooltip from '@/components/MyTooltip';
import Avatar from '@/components/Avatar';
import MyIcon from '@/components/Icon';

View File

@@ -186,7 +186,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
]}
gridGap={4}
>
{datasetTestItem?.results.map((item) => (
{datasetTestItem?.results.map((item, index) => (
<Box
key={item.id}
pb={2}
@@ -223,6 +223,15 @@ const Test = ({ datasetId }: { datasetId: string }) => {
}}
>
<Flex p={3} alignItems={'center'} color={'myGray.500'}>
<Box
border={theme.borders.base}
px={2}
fontSize={'sm'}
mr={1}
borderRadius={'md'}
>
# {index + 1}
</Box>
<MyIcon name={'kbTest'} w={'14px'} />
<Progress
mx={2}
@@ -234,13 +243,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
/>
<Box>{item.score.toFixed(4)}</Box>
</Flex>
<Box
px={2}
fontSize={'xs'}
color={'myGray.600'}
maxH={'200px'}
overflow={'overlay'}
>
<Box px={2} fontSize={'xs'} color={'myGray.600'}>
<Box>{item.q}</Box>
<Box>{item.a}</Box>
</Box>