Skip to content

Commit

Permalink
Quote Modal UI and fix doc (#432)
Browse files Browse the repository at this point in the history
  • Loading branch information
c121914yu authored Oct 25, 2023
1 parent f2fb0ae commit 008d0af
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docSite/content/docs/development/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ weight: 520
"SystemParams": {
"vectorMaxProcess": 15, // 向量生成最大进程,结合数据库性能和 key 来设置
"qaMaxProcess": 15, // QA 生成最大进程,结合数据库性能和 key 来设置
"pgHNSWEfSearch": 40 // pg vector 索引参数,越大精度高但速度慢
"pgHNSWEfSearch": 100 // pg vector 索引参数,越大精度高但速度慢
},
"ChatModels": [
{
Expand Down
2 changes: 1 addition & 1 deletion docSite/content/docs/development/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ git clone [email protected]:<github_username>/FastGPT.git

**环境变量**

复制.env.template 文件,生成一个.env.local 环境变量文件夹,修改.env.local 里内容才是有效的变量。变量说明见 .env.template
复制.env.template 文件,在同级目录下生成一个.env.local 文件,修改.env.local 里内容才是有效的变量。变量说明见 .env.template

**config 配置文件**

Expand Down
14 changes: 8 additions & 6 deletions projects/app/src/components/ChatBox/QuoteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ const QuoteModal = ({
_notLast={{ mb: 2 }}
position={'relative'}
overflow={'hidden'}
_hover={{ '& .hover-data': { display: 'flex' } }}
>
{!isShare && (
<Flex alignItems={'flex-end'} mb={1}>
<Flex alignItems={'flex-end'} mb={3} color={'myGray.500'}>
<RawSourceText sourceName={item.sourceName} sourceId={item.sourceId} />
<Box flex={1} />
<Link
as={NextLink}
display={'flex'}
className="hover-data"
display={'none'}
alignItems={'center'}
color={'myBlue.600'}
href={`/dataset/detail?datasetId=${item.datasetId}&currentTab=dataCard&collectionId=${item.collectionId}`}
Expand All @@ -112,10 +114,10 @@ const QuoteModal = ({
</Flex>
)}

<Box>{item.q}</Box>
<Box>{item.a}</Box>
<Box color={'black'}>{item.q}</Box>
<Box color={'black'}>{item.a}</Box>
{!isShare && (
<Flex alignItems={'center'} mt={2} gap={4}>
<Flex alignItems={'center'} mt={3} gap={4} color={'myGray.500'}>
{isPc && (
<MyTooltip label={t('core.dataset.data.id')}>
<Flex border={theme.borders.base} px={3} borderRadius={'md'}>
Expand All @@ -139,7 +141,7 @@ const QuoteModal = ({
value={item.score * 100}
size="sm"
borderRadius={'20px'}
colorScheme="gray"
colorScheme="myGray"
border={theme.borders.base}
/>
<Box>{item.score.toFixed(4)}</Box>
Expand Down
4 changes: 2 additions & 2 deletions projects/app/src/global/common/string/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ export function replaceVariable(text: string, obj: Record<string, string | numbe
* maxLen > overlapLen
*/
export const splitText2Chunks = ({ text = '', maxLen }: { text: string; maxLen: number }) => {
const overlapLen = Math.floor(maxLen * 0.2); // Overlap length
const overlapLen = Math.floor(maxLen * 0.15); // Overlap length
const tempMarker = 'SPLIT_HERE_SPLIT_HERE';

const stepReg: Record<number, RegExp> = {
0: /(\n\n)/g,
1: /([\n])/g,
2: /([。]|\.\s)/g,
2: /[。]|(?!<[^a-zA-Z])\.\s/g,
3: /([!?]|!\s|\?\s)/g,
4: /([;]|;\s)/g,
5: /([,]|,\s)/g
Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/api/system/getInitData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const defaultSystemEnv: SystemEnvType = {
vectorMaxProcess: 15,
qaMaxProcess: 15,
pgHNSWEfSearch: 40
pgHNSWEfSearch: 100
};
const defaultFeConfigs: FeConfigsType = {
show_emptyChat: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ ${systemPrompt}
tokens: response.usage?.total_tokens || 0
};
} catch (error) {
console.log('Your model may not support function_call');
console.log('Your model may not support function_call', error);

return {
arg: {},
Expand Down

0 comments on commit 008d0af

Please sign in to comment.