Update docs and response tag in share page (#694)

* perf: chunk index show

* share response

* perf: vector query

* web printFinger

* remove log

* fix: bucket name

* perf: training schema

* perf: sort index
This commit is contained in:
Archer
2024-01-05 18:02:37 +08:00
committed by GitHub
parent 331d18c88f
commit 3f088bce6a
23 changed files with 242 additions and 181 deletions

View File

@@ -32,7 +32,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
};
const [data, total] = await Promise.all([
MongoDatasetData.find(match, '_id datasetId collectionId q a indexes')
MongoDatasetData.find(match, '_id datasetId collectionId q a chunkIndex indexes')
.sort({ chunkIndex: 1, updateTime: -1 })
.skip((pageNum - 1) * pageSize)
.limit(pageSize)

View File

@@ -10,6 +10,7 @@ import { updateApiKeyUsage } from '@fastgpt/service/support/openapi/tools';
import { getBillSourceByAuthType } from '@fastgpt/global/support/wallet/bill/tools';
type Props = GetVectorProps & {
input: string | string[];
billId?: string;
};
@@ -22,6 +23,8 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
throw new Error('input is nor array or string');
}
const query = Array.isArray(input) ? input[0] : input;
const { teamId, tmbId, apikey, authType } = await authCert({
req,
authToken: true,
@@ -30,7 +33,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
await authTeamBalance(teamId);
const { tokens, vectors } = await getVectorsByText({ input, model });
const { tokens, vectors } = await getVectorsByText({ input: query, model });
jsonRes(res, {
data: {

View File

@@ -96,7 +96,7 @@ const Share = ({ appId }: { appId: string }) => {
<Tr>
<Th></Th>
<Th></Th>
<Th></Th>
<Th></Th>
{feConfigs?.isPlus && (
<>
<Th>IP限流/</Th>
@@ -373,8 +373,8 @@ function EditLinkModal({
<Flex alignItems={'center'} mt={4}>
<Flex flex={'0 0 90px'} alignItems={'center'}>
{t('outlink.Response Detail')}
<MyTooltip label={t('outlink.Response Detail tips' || '')}>
{t('support.outlink.share.Response Quote')}
<MyTooltip label={t('support.outlink.share.Response Quote tips' || '')}>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
</Flex>

View File

@@ -307,7 +307,7 @@ const DataCard = () => {
>
<Flex zIndex={1} alignItems={'center'} justifyContent={'space-between'}>
<Box border={theme.borders.base} px={2} fontSize={'sm'} mr={1} borderRadius={'md'}>
# {index + 1}
# {item.chunkIndex ?? '-'}
</Box>
<Box className={'textEllipsis'} color={'myGray.500'} fontSize={'xs'}>
ID:{item._id}