mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 13:55:56 +08:00
### What problem does this PR solve? feat: add graph tab to header #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
258c9ea644
commit
3b50389ee7
@ -11,7 +11,7 @@ export const EmptyDsl = {
|
|||||||
graph: {
|
graph: {
|
||||||
nodes: [
|
nodes: [
|
||||||
{
|
{
|
||||||
id: 'Begin',
|
id: 'begin',
|
||||||
type: 'beginNode',
|
type: 'beginNode',
|
||||||
position: {
|
position: {
|
||||||
x: 50,
|
x: 50,
|
||||||
|
@ -9,6 +9,7 @@ import { useLocation } from 'umi';
|
|||||||
import Toolbar from '../right-toolbar';
|
import Toolbar from '../right-toolbar';
|
||||||
|
|
||||||
import { useFetchAppConf } from '@/hooks/logicHooks';
|
import { useFetchAppConf } from '@/hooks/logicHooks';
|
||||||
|
import { NodeIndexOutlined } from '@ant-design/icons';
|
||||||
import styles from './index.less';
|
import styles from './index.less';
|
||||||
|
|
||||||
const { Header } = Layout;
|
const { Header } = Layout;
|
||||||
@ -26,6 +27,7 @@ const RagHeader = () => {
|
|||||||
() => [
|
() => [
|
||||||
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
{ path: '/knowledge', name: t('knowledgeBase'), icon: KnowledgeBaseIcon },
|
||||||
{ path: '/chat', name: t('chat'), icon: StarIon },
|
{ path: '/chat', name: t('chat'), icon: StarIon },
|
||||||
|
{ path: '/flow', name: t('flow'), icon: NodeIndexOutlined },
|
||||||
{ path: '/file', name: t('fileManager'), icon: FileIcon },
|
{ path: '/file', name: t('fileManager'), icon: FileIcon },
|
||||||
],
|
],
|
||||||
[t],
|
[t],
|
||||||
|
@ -57,6 +57,7 @@ export default {
|
|||||||
setting: '用户设置',
|
setting: '用户设置',
|
||||||
logout: '登出',
|
logout: '登出',
|
||||||
fileManager: 'File Management',
|
fileManager: 'File Management',
|
||||||
|
flow: 'Graph',
|
||||||
},
|
},
|
||||||
knowledgeList: {
|
knowledgeList: {
|
||||||
welcome: 'Welcome back',
|
welcome: 'Welcome back',
|
||||||
|
@ -18,8 +18,8 @@ const CategorizeForm = ({ form, onValuesChange, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 9 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 15 }}
|
wrapperCol={{ span: 18 }}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={handleValuesChange}
|
onValuesChange={handleValuesChange}
|
||||||
|
@ -126,27 +126,51 @@ export const initialBeginValues = {
|
|||||||
prologue: `Hi! I'm your assistant, what can I do for you?`,
|
prologue: `Hi! I'm your assistant, what can I do for you?`,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initialGenerateValues = {
|
const initialLlmBaseValues = {
|
||||||
// parameters: ModelVariableType.Precise,
|
|
||||||
// temperatureEnabled: true,
|
|
||||||
temperature: 0.1,
|
temperature: 0.1,
|
||||||
top_p: 0.3,
|
top_p: 0.3,
|
||||||
frequency_penalty: 0.7,
|
frequency_penalty: 0.7,
|
||||||
presence_penalty: 0.4,
|
presence_penalty: 0.4,
|
||||||
max_tokens: 512,
|
max_tokens: 256,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const initialGenerateValues = {
|
||||||
|
// parameters: ModelVariableType.Precise,
|
||||||
|
// temperatureEnabled: true,
|
||||||
|
...initialLlmBaseValues,
|
||||||
prompt: `Please summarize the following paragraphs. Be careful with the numbers, do not make things up. Paragraphs as following:
|
prompt: `Please summarize the following paragraphs. Be careful with the numbers, do not make things up. Paragraphs as following:
|
||||||
{cluster_content}
|
{cluster_content}
|
||||||
The above is the content you need to summarize.`,
|
The above is the content you need to summarize.`,
|
||||||
cite: true,
|
cite: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const initialRewriteQuestionValues = {
|
||||||
|
...initialLlmBaseValues,
|
||||||
|
loop: 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const initialRelevantValues = {
|
||||||
|
...initialLlmBaseValues,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const initialCategorizeValues = {
|
||||||
|
...initialLlmBaseValues,
|
||||||
|
category_description: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const initialMessageValues = {
|
||||||
|
messages: [],
|
||||||
|
};
|
||||||
|
|
||||||
export const initialFormValuesMap = {
|
export const initialFormValuesMap = {
|
||||||
[Operator.Begin]: initialBeginValues,
|
[Operator.Begin]: initialBeginValues,
|
||||||
[Operator.Retrieval]: initialRetrievalValues,
|
[Operator.Retrieval]: initialRetrievalValues,
|
||||||
[Operator.Generate]: initialGenerateValues,
|
[Operator.Generate]: initialGenerateValues,
|
||||||
[Operator.Answer]: {},
|
[Operator.Answer]: {},
|
||||||
[Operator.Categorize]: {},
|
[Operator.Categorize]: initialCategorizeValues,
|
||||||
[Operator.Relevant]: {},
|
[Operator.Relevant]: initialRelevantValues,
|
||||||
|
[Operator.RewriteQuestion]: initialRewriteQuestionValues,
|
||||||
|
[Operator.Message]: initialMessageValues,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CategorizeAnchorPointPositions = [
|
export const CategorizeAnchorPointPositions = [
|
||||||
|
@ -13,8 +13,8 @@ const GenerateForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 9 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 15 }}
|
wrapperCol={{ span: 18 }}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
|
@ -23,10 +23,8 @@ const RelevantForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 16 }}
|
wrapperCol={{ span: 18 }}
|
||||||
style={{ maxWidth: 600 }}
|
|
||||||
initialValues={{ remember: true }}
|
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
|
@ -11,8 +11,8 @@ const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 8 }}
|
labelCol={{ span: 6 }}
|
||||||
wrapperCol={{ span: 16 }}
|
wrapperCol={{ span: 18 }}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
@ -24,7 +24,11 @@ const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
>
|
>
|
||||||
<LLMSelect></LLMSelect>
|
<LLMSelect></LLMSelect>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t('loop', { keyPrefix: 'flow' })} name="loop">
|
<Form.Item
|
||||||
|
label={t('loop', { keyPrefix: 'flow' })}
|
||||||
|
name="loop"
|
||||||
|
initialValue={1}
|
||||||
|
>
|
||||||
<InputNumber />
|
<InputNumber />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user