mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-15 21:55:55 +08:00
### What problem does this PR solve? feat: Add agent interface document link to agent page #3189 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
16b6a78c1e
commit
57f23e0808
@ -447,6 +447,7 @@ The above is the content you need to summarize.`,
|
|||||||
multiTurn: 'Multi-turn optimization',
|
multiTurn: 'Multi-turn optimization',
|
||||||
multiTurnTip:
|
multiTurnTip:
|
||||||
'In multi-round conversations, the query to the knowledge base is optimized. The large model will be called to consume additional tokens.',
|
'In multi-round conversations, the query to the knowledge base is optimized. The large model will be called to consume additional tokens.',
|
||||||
|
howUseId: 'How to use chat ID?',
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
profile: 'Profile',
|
profile: 'Profile',
|
||||||
@ -1031,6 +1032,7 @@ The above is the content you need to summarize.`,
|
|||||||
reference: 'Reference',
|
reference: 'Reference',
|
||||||
input: 'Input',
|
input: 'Input',
|
||||||
parameter: 'Parameter',
|
parameter: 'Parameter',
|
||||||
|
howUseId: 'How to use agent ID?',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -416,6 +416,7 @@ export default {
|
|||||||
multiTurn: '多輪對話優化',
|
multiTurn: '多輪對話優化',
|
||||||
multiTurnTip:
|
multiTurnTip:
|
||||||
'在多輪對話的中,對去知識庫查詢的問題進行最佳化。會呼叫大模型額外消耗token。',
|
'在多輪對話的中,對去知識庫查詢的問題進行最佳化。會呼叫大模型額外消耗token。',
|
||||||
|
howUseId: '如何使用聊天ID?',
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
profile: '概述',
|
profile: '概述',
|
||||||
@ -979,6 +980,7 @@ export default {
|
|||||||
reference: '引用',
|
reference: '引用',
|
||||||
input: '輸入',
|
input: '輸入',
|
||||||
parameter: '參數',
|
parameter: '參數',
|
||||||
|
howUseId: '如何使用Agent ID?',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: '“保留所有權利 @ react”',
|
profile: '“保留所有權利 @ react”',
|
||||||
|
@ -433,6 +433,7 @@ export default {
|
|||||||
multiTurn: '多轮对话优化',
|
multiTurn: '多轮对话优化',
|
||||||
multiTurnTip:
|
multiTurnTip:
|
||||||
'在多轮对话的中,对去知识库查询的问题进行优化。会调用大模型额外消耗token。',
|
'在多轮对话的中,对去知识库查询的问题进行优化。会调用大模型额外消耗token。',
|
||||||
|
howUseId: '如何使用聊天ID?',
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
profile: '概要',
|
profile: '概要',
|
||||||
@ -999,6 +1000,7 @@ export default {
|
|||||||
reference: '引用',
|
reference: '引用',
|
||||||
input: '输入',
|
input: '输入',
|
||||||
parameter: '参数',
|
parameter: '参数',
|
||||||
|
howUseId: '如何使用Agent ID?',
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
profile: 'All rights reserved @ React',
|
profile: 'All rights reserved @ React',
|
||||||
|
@ -4,7 +4,7 @@ import { Modal, Typography } from 'antd';
|
|||||||
|
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
const { Paragraph } = Typography;
|
const { Paragraph, Link } = Typography;
|
||||||
|
|
||||||
const ChatIdModal = ({
|
const ChatIdModal = ({
|
||||||
visible,
|
visible,
|
||||||
@ -14,20 +14,24 @@ const ChatIdModal = ({
|
|||||||
const { t } = useTranslate('chat');
|
const { t } = useTranslate('chat');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Modal
|
||||||
<Modal
|
title={t('overview')}
|
||||||
title={t('overview')}
|
open={visible}
|
||||||
open={visible}
|
onCancel={hideModal}
|
||||||
onCancel={hideModal}
|
cancelButtonProps={{ style: { display: 'none' } }}
|
||||||
cancelButtonProps={{ style: { display: 'none' } }}
|
onOk={hideModal}
|
||||||
onOk={hideModal}
|
okText={t('close', { keyPrefix: 'common' })}
|
||||||
okText={t('close', { keyPrefix: 'common' })}
|
>
|
||||||
|
<Paragraph copyable={{ text: id }} className={styles.id}>
|
||||||
|
{id}
|
||||||
|
</Paragraph>
|
||||||
|
<Link
|
||||||
|
href="https://ragflow.io/docs/dev/http_api_reference#create-session"
|
||||||
|
target="_blank"
|
||||||
>
|
>
|
||||||
<Paragraph copyable={{ text: id }} className={styles.id}>
|
{t('howUseId')}
|
||||||
{id}
|
</Link>
|
||||||
</Paragraph>
|
</Modal>
|
||||||
</Modal>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
3
web/src/pages/flow/flow-id-modal/index.less
Normal file
3
web/src/pages/flow/flow-id-modal/index.less
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.id {
|
||||||
|
.linkText();
|
||||||
|
}
|
36
web/src/pages/flow/flow-id-modal/index.tsx
Normal file
36
web/src/pages/flow/flow-id-modal/index.tsx
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { useTranslate } from '@/hooks/common-hooks';
|
||||||
|
import { IModalProps } from '@/interfaces/common';
|
||||||
|
import { Modal, Typography } from 'antd';
|
||||||
|
|
||||||
|
import { useParams } from 'umi';
|
||||||
|
import styles from './index.less';
|
||||||
|
|
||||||
|
const { Paragraph, Link } = Typography;
|
||||||
|
|
||||||
|
const FlowIdModal = ({ hideModal }: IModalProps<any>) => {
|
||||||
|
const { t } = useTranslate('flow');
|
||||||
|
const { id } = useParams();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
title={'Agent ID'}
|
||||||
|
open
|
||||||
|
onCancel={hideModal}
|
||||||
|
cancelButtonProps={{ style: { display: 'none' } }}
|
||||||
|
onOk={hideModal}
|
||||||
|
okText={t('close', { keyPrefix: 'common' })}
|
||||||
|
>
|
||||||
|
<Paragraph copyable={{ text: id }} className={styles.id}>
|
||||||
|
{id}
|
||||||
|
</Paragraph>
|
||||||
|
<Link
|
||||||
|
href="https://ragflow.io/docs/dev/http_api_reference#create-agent-session"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
{t('howUseId')}
|
||||||
|
</Link>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default FlowIdModal;
|
@ -4,6 +4,7 @@ import { useFetchFlow } from '@/hooks/flow-hooks';
|
|||||||
import { ArrowLeftOutlined } from '@ant-design/icons';
|
import { ArrowLeftOutlined } from '@ant-design/icons';
|
||||||
import { Button, Flex, Space } from 'antd';
|
import { Button, Flex, Space } from 'antd';
|
||||||
import { Link, useParams } from 'umi';
|
import { Link, useParams } from 'umi';
|
||||||
|
import FlowIdModal from '../flow-id-modal';
|
||||||
import { useSaveGraph, useSaveGraphBeforeOpeningDebugDrawer } from '../hooks';
|
import { useSaveGraph, useSaveGraphBeforeOpeningDebugDrawer } from '../hooks';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
@ -21,6 +22,7 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
|
|||||||
hideModal: hideOverviewModal,
|
hideModal: hideOverviewModal,
|
||||||
showModal: showOverviewModal,
|
showModal: showOverviewModal,
|
||||||
} = useSetModalState();
|
} = useSetModalState();
|
||||||
|
const { visible, hideModal, showModal } = useSetModalState();
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -44,8 +46,11 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
|
|||||||
<Button type="primary" onClick={saveGraph}>
|
<Button type="primary" onClick={saveGraph}>
|
||||||
<b>{t('save')}</b>
|
<b>{t('save')}</b>
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="primary" onClick={showOverviewModal} disabled>
|
{/* <Button type="primary" onClick={showOverviewModal} disabled>
|
||||||
<b>{t('publish')}</b>
|
<b>{t('publish')}</b>
|
||||||
|
</Button> */}
|
||||||
|
<Button type="primary" onClick={showModal}>
|
||||||
|
<b>Agent ID</b>
|
||||||
</Button>
|
</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</Flex>
|
</Flex>
|
||||||
@ -57,6 +62,7 @@ const FlowHeader = ({ showChatDrawer }: IProps) => {
|
|||||||
idKey="canvasId"
|
idKey="canvasId"
|
||||||
></ChatOverviewModal>
|
></ChatOverviewModal>
|
||||||
)}
|
)}
|
||||||
|
{visible && <FlowIdModal hideModal={hideModal}></FlowIdModal>}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user