mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Add component GitHub #1739 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -3,6 +3,7 @@ import { ReactComponent as BaiduIcon } from '@/assets/svg/baidu.svg';
|
||||
import { ReactComponent as BingIcon } from '@/assets/svg/bing.svg';
|
||||
import { ReactComponent as DeepLIcon } from '@/assets/svg/deepl.svg';
|
||||
import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
|
||||
import { ReactComponent as GithubIcon } from '@/assets/svg/github.svg';
|
||||
import { ReactComponent as GoogleScholarIcon } from '@/assets/svg/google-scholar.svg';
|
||||
import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
|
||||
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
|
||||
@ -48,6 +49,7 @@ export enum Operator {
|
||||
Bing = 'Bing',
|
||||
GoogleScholar = 'GoogleScholar',
|
||||
DeepL = 'DeepL',
|
||||
GitHub = 'GitHub',
|
||||
}
|
||||
|
||||
export const operatorIconMap = {
|
||||
@ -69,6 +71,7 @@ export const operatorIconMap = {
|
||||
[Operator.Bing]: BingIcon,
|
||||
[Operator.GoogleScholar]: GoogleScholarIcon,
|
||||
[Operator.DeepL]: DeepLIcon,
|
||||
[Operator.GitHub]: GithubIcon,
|
||||
};
|
||||
|
||||
export const operatorMap = {
|
||||
@ -153,6 +156,7 @@ export const operatorMap = {
|
||||
[Operator.Bing]: {},
|
||||
[Operator.GoogleScholar]: {},
|
||||
[Operator.DeepL]: {},
|
||||
[Operator.GitHub]: {},
|
||||
};
|
||||
|
||||
export const componentMenuList = [
|
||||
@ -207,6 +211,9 @@ export const componentMenuList = [
|
||||
{
|
||||
name: Operator.DeepL,
|
||||
},
|
||||
{
|
||||
name: Operator.GitHub,
|
||||
},
|
||||
];
|
||||
|
||||
export const initialRetrievalValues = {
|
||||
@ -316,6 +323,10 @@ export const initialDeepLValues = {
|
||||
auth_key: 'relevance',
|
||||
};
|
||||
|
||||
export const initialGithubValues = {
|
||||
top_n: 5,
|
||||
};
|
||||
|
||||
export const CategorizeAnchorPointPositions = [
|
||||
{ top: 1, right: 34 },
|
||||
{ top: 8, right: 18 },
|
||||
@ -381,6 +392,7 @@ export const RestrictedUpstreamMap = {
|
||||
[Operator.Bing]: [Operator.Begin, Operator.Retrieval],
|
||||
[Operator.GoogleScholar]: [Operator.Begin, Operator.Retrieval],
|
||||
[Operator.DeepL]: [Operator.Begin, Operator.Retrieval],
|
||||
[Operator.GitHub]: [Operator.Begin, Operator.Retrieval],
|
||||
};
|
||||
|
||||
export const NodeMap = {
|
||||
@ -402,6 +414,7 @@ export const NodeMap = {
|
||||
[Operator.Bing]: 'ragNode',
|
||||
[Operator.GoogleScholar]: 'ragNode',
|
||||
[Operator.DeepL]: 'ragNode',
|
||||
[Operator.GitHub]: 'ragNode',
|
||||
};
|
||||
|
||||
export const LanguageOptions = [
|
||||
|
||||
@ -12,6 +12,7 @@ import CategorizeForm from '../categorize-form';
|
||||
import { Operator } from '../constant';
|
||||
import DuckDuckGoForm from '../duckduckgo-form';
|
||||
import GenerateForm from '../generate-form';
|
||||
import GithubForm from '../github-form';
|
||||
import GoogleForm from '../google-form';
|
||||
import GoogleScholarForm from '../google-scholar-form';
|
||||
import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks';
|
||||
@ -50,6 +51,7 @@ const FormMap = {
|
||||
[Operator.Bing]: BingForm,
|
||||
[Operator.GoogleScholar]: GoogleScholarForm,
|
||||
[Operator.DeepL]: DeepLForm,
|
||||
[Operator.GitHub]: GithubForm,
|
||||
};
|
||||
|
||||
const EmptyContent = () => <div>empty</div>;
|
||||
|
||||
20
web/src/pages/flow/github-form/index.tsx
Normal file
20
web/src/pages/flow/github-form/index.tsx
Normal file
@ -0,0 +1,20 @@
|
||||
import TopNItem from '@/components/top-n-item';
|
||||
import { Form } from 'antd';
|
||||
import { IOperatorForm } from '../interface';
|
||||
|
||||
const GithubForm = ({ onValuesChange, form }: IOperatorForm) => {
|
||||
return (
|
||||
<Form
|
||||
name="basic"
|
||||
labelCol={{ span: 6 }}
|
||||
wrapperCol={{ span: 18 }}
|
||||
autoComplete="off"
|
||||
form={form}
|
||||
onValuesChange={onValuesChange}
|
||||
>
|
||||
<TopNItem initialValue={5}></TopNItem>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
export default GithubForm;
|
||||
@ -38,6 +38,7 @@ import {
|
||||
initialDeepLValues,
|
||||
initialDuckValues,
|
||||
initialGenerateValues,
|
||||
initialGithubValues,
|
||||
initialGoogleScholarValues,
|
||||
initialGoogleValues,
|
||||
initialKeywordExtractValues,
|
||||
@ -101,6 +102,7 @@ export const useInitializeOperatorParams = () => {
|
||||
[Operator.Bing]: initialBingValues,
|
||||
[Operator.GoogleScholar]: initialGoogleScholarValues,
|
||||
[Operator.DeepL]: initialDeepLValues,
|
||||
[Operator.GitHub]: initialGithubValues,
|
||||
};
|
||||
}, [llmId]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user