mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-26 17:16:52 +08:00
### What problem does this PR solve? Feat: Add Arxiv GoogleScholar operator #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
35
web/src/pages/agent/form/tool-form/arxiv-form/index.tsx
Normal file
35
web/src/pages/agent/form/tool-form/arxiv-form/index.tsx
Normal file
@ -0,0 +1,35 @@
|
||||
import { FormContainer } from '@/components/form-container';
|
||||
import { Form } from '@/components/ui/form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { memo } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { ArXivFormPartialSchema, ArXivFormWidgets } from '../../arxiv-form';
|
||||
import { FormWrapper } from '../../components/form-wrapper';
|
||||
import { useValues } from '../use-values';
|
||||
import { useWatchFormChange } from '../use-watch-change';
|
||||
|
||||
function ArXivForm() {
|
||||
const values = useValues();
|
||||
|
||||
const FormSchema = z.object(ArXivFormPartialSchema);
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
defaultValues: values,
|
||||
resolver: zodResolver(FormSchema),
|
||||
});
|
||||
|
||||
useWatchFormChange(form);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<FormContainer>
|
||||
<ArXivFormWidgets></ArXivFormWidgets>
|
||||
</FormContainer>
|
||||
</FormWrapper>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(ArXivForm);
|
||||
@ -1,15 +1,16 @@
|
||||
import { Operator } from '../../constant';
|
||||
import AkShareForm from '../akshare-form';
|
||||
import ArXivForm from '../arxiv-form';
|
||||
import DeepLForm from '../deepl-form';
|
||||
import GithubForm from '../github-form';
|
||||
import GoogleScholarForm from '../google-scholar-form';
|
||||
import PubMedForm from '../pubmed-form';
|
||||
import ArXivForm from './arxiv-form';
|
||||
import BingForm from './bing-form';
|
||||
import CrawlerForm from './crawler-form';
|
||||
import DuckDuckGoForm from './duckduckgo-form';
|
||||
import EmailForm from './email-form';
|
||||
import ExeSQLForm from './exesql-form';
|
||||
import GoogleForm from './google-form';
|
||||
import GoogleScholarForm from './google-scholar-form';
|
||||
import RetrievalForm from './retrieval-form';
|
||||
import TavilyForm from './tavily-form';
|
||||
import WikipediaForm from './wikipedia-form';
|
||||
@ -22,7 +23,7 @@ export const ToolFormConfigMap = {
|
||||
[Operator.Wikipedia]: WikipediaForm,
|
||||
[Operator.PubMed]: PubMedForm,
|
||||
[Operator.ArXiv]: ArXivForm,
|
||||
[Operator.Google]: TavilyForm,
|
||||
[Operator.Google]: GoogleForm,
|
||||
[Operator.Bing]: BingForm,
|
||||
[Operator.GoogleScholar]: GoogleScholarForm,
|
||||
[Operator.DeepL]: DeepLForm,
|
||||
|
||||
37
web/src/pages/agent/form/tool-form/google-form/index.tsx
Normal file
37
web/src/pages/agent/form/tool-form/google-form/index.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { FormContainer } from '@/components/form-container';
|
||||
import { Form } from '@/components/ui/form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { memo } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { ApiKeyField } from '../../components/api-key-field';
|
||||
import { FormWrapper } from '../../components/form-wrapper';
|
||||
import { GoogleFormPartialSchema, GoogleFormWidgets } from '../../google-form';
|
||||
import { useValues } from '../use-values';
|
||||
import { useWatchFormChange } from '../use-watch-change';
|
||||
|
||||
function GoogleForm() {
|
||||
const values = useValues();
|
||||
|
||||
const FormSchema = z.object(GoogleFormPartialSchema);
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
defaultValues: values,
|
||||
resolver: zodResolver(FormSchema),
|
||||
});
|
||||
|
||||
useWatchFormChange(form);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<FormContainer>
|
||||
<ApiKeyField></ApiKeyField>
|
||||
<GoogleFormWidgets></GoogleFormWidgets>
|
||||
</FormContainer>
|
||||
</FormWrapper>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(GoogleForm);
|
||||
@ -0,0 +1,38 @@
|
||||
import { FormContainer } from '@/components/form-container';
|
||||
import { Form } from '@/components/ui/form';
|
||||
import { zodResolver } from '@hookform/resolvers/zod';
|
||||
import { memo } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { z } from 'zod';
|
||||
import { FormWrapper } from '../../components/form-wrapper';
|
||||
import {
|
||||
GoogleScholarFormPartialSchema,
|
||||
GoogleScholarFormWidgets,
|
||||
} from '../../google-scholar-form';
|
||||
import { useValues } from '../use-values';
|
||||
import { useWatchFormChange } from '../use-watch-change';
|
||||
|
||||
function GoogleScholarForm() {
|
||||
const values = useValues();
|
||||
|
||||
const FormSchema = z.object(GoogleScholarFormPartialSchema);
|
||||
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
defaultValues: values,
|
||||
resolver: zodResolver(FormSchema),
|
||||
});
|
||||
|
||||
useWatchFormChange(form);
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<FormWrapper>
|
||||
<FormContainer>
|
||||
<GoogleScholarFormWidgets></GoogleScholarFormWidgets>
|
||||
</FormContainer>
|
||||
</FormWrapper>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
|
||||
export default memo(GoogleScholarForm);
|
||||
Reference in New Issue
Block a user