mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-17 05:07:23 +08:00
feat: support rss datasource (#13721)
### What problem does this PR solve? Supporting public RSS/Atom feed URLs as data sources for RagFlow. link https://github.com/infiniflow/ragflow/issues/12313 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -1000,6 +1000,8 @@ Example: Virtual Hosted Style`,
|
||||
newDocs: 'New docs',
|
||||
timeStarted: 'Time started',
|
||||
log: 'Log',
|
||||
rssDescription:
|
||||
'Connect to a public RSS or Atom feed and sync feed entries into your knowledge base.',
|
||||
confluenceDescription:
|
||||
'Integrate your Confluence workspace to search documentation.',
|
||||
s3Description:
|
||||
|
||||
@@ -895,6 +895,8 @@ General:实体和关系提取提示来自 GitHub - microsoft/graphrag:基于
|
||||
newDocs: '新文档',
|
||||
timeStarted: '开始时间',
|
||||
log: '日志',
|
||||
rssDescription:
|
||||
'连接公开的 RSS 或 Atom feed,并将 feed 条目同步到知识库。',
|
||||
confluenceDescription: '连接你的 Confluence 工作区以搜索文档内容。',
|
||||
s3Description: ' 连接你的 AWS S3 存储桶以导入和同步文件。',
|
||||
google_cloud_storageDescription:
|
||||
|
||||
@@ -2,7 +2,7 @@ import { FormFieldType } from '@/components/dynamic-form';
|
||||
import { IconFontFill } from '@/components/icon-font';
|
||||
import SvgIcon from '@/components/svg-icon';
|
||||
import { t, TFunction } from 'i18next';
|
||||
import { Mail } from 'lucide-react';
|
||||
import { Mail, Rss } from 'lucide-react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import BoxTokenField from '../component/box-token-field';
|
||||
@@ -15,6 +15,7 @@ import { S3Constant } from './s3-constant';
|
||||
import { seafileConstant } from './seafile-constant';
|
||||
|
||||
export enum DataSourceKey {
|
||||
RSS = 'rss',
|
||||
CONFLUENCE = 'confluence',
|
||||
S3 = 's3',
|
||||
NOTION = 'notion',
|
||||
@@ -47,6 +48,11 @@ export enum DataSourceKey {
|
||||
|
||||
export const generateDataSourceInfo = (t: TFunction) => {
|
||||
return {
|
||||
[DataSourceKey.RSS]: {
|
||||
name: 'RSS',
|
||||
description: t(`setting.${DataSourceKey.RSS}Description`),
|
||||
icon: <Rss className="text-text-primary" size={22} />,
|
||||
},
|
||||
[DataSourceKey.GOOGLE_CLOUD_STORAGE]: {
|
||||
name: 'Google Cloud Storage',
|
||||
description: t(
|
||||
@@ -222,6 +228,25 @@ export const DataSourceFormBaseFields = [
|
||||
},
|
||||
];
|
||||
export const DataSourceFormFields = {
|
||||
[DataSourceKey.RSS]: [
|
||||
{
|
||||
label: 'Feed URL',
|
||||
name: 'config.feed_url',
|
||||
type: FormFieldType.Text,
|
||||
required: true,
|
||||
placeholder: 'https://example.com/feed.xml',
|
||||
},
|
||||
{
|
||||
label: 'Batch Size',
|
||||
name: 'config.batch_size',
|
||||
type: FormFieldType.Number,
|
||||
required: false,
|
||||
validation: {
|
||||
min: 1,
|
||||
message: 'Batch Size must be at least 1',
|
||||
},
|
||||
},
|
||||
],
|
||||
[DataSourceKey.GOOGLE_CLOUD_STORAGE]: [
|
||||
{
|
||||
label: 'GCS Access Key ID',
|
||||
@@ -965,6 +990,14 @@ export const DataSourceFormFields = {
|
||||
};
|
||||
|
||||
export const DataSourceFormDefaultValues = {
|
||||
[DataSourceKey.RSS]: {
|
||||
name: '',
|
||||
source: DataSourceKey.RSS,
|
||||
config: {
|
||||
feed_url: '',
|
||||
batch_size: 2,
|
||||
},
|
||||
},
|
||||
[DataSourceKey.S3]: {
|
||||
name: '',
|
||||
source: DataSourceKey.S3,
|
||||
|
||||
Reference in New Issue
Block a user