feat: translate text from DuckDuckGo #918 (#1486)

### What problem does this PR solve?

feat: translate text from DuckDuckGo #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu 2024-07-12 15:22:36 +08:00 committed by GitHub
parent 013db9410f
commit 740714b79d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 33 additions and 3 deletions

View File

@ -606,7 +606,9 @@ The above is the content you need to summarize.`,
duckDuckGoDescription:
'This component is used to get search result from www.duckduckgo.com. Typically, it performs as a supplement to knowledgebases. Top N specifies the number of search results you need to adopt.',
channel: 'Channel',
channelTip: 'channelTip',
channelTip: `Perform text search or news search on the component's input`,
text: 'Text',
news: 'News',
},
footer: {
profile: 'All rights reserved @ React',

View File

@ -559,6 +559,17 @@ export default {
addItem: '新增',
nameRequiredMsg: '名稱不能為空',
nameRepeatedMsg: '名稱不能重複',
keywordExtract: '關鍵字',
keywordExtractDescription: `該組件用於從用戶的問題中提取關鍵字。 Top N指定需要提取的關鍵字數量。`,
baidu: '百度',
baiduDescription: `此組件用於取得www.baidu.com的搜尋結果一般作為知識庫的補充Top N指定需要採納的搜尋結果數。`,
duckDuckGo: 'DuckDuckGo',
duckDuckGoDescription:
'此元件用於從 www.duckduckgo.com 取得搜尋結果。通常,它作為知識庫的補充。 Top N 指定您需要採用的搜尋結果數。',
channel: '頻道',
channelTip: '針對該組件的輸入進行文字搜尋或新聞搜索',
text: '文字',
news: '新聞',
},
footer: {
profile: '“保留所有權利 @ react”',

View File

@ -577,6 +577,17 @@ export default {
addItem: '新增',
nameRequiredMsg: '名称不能为空',
nameRepeatedMsg: '名称不能重复',
keywordExtract: '关键词',
keywordExtractDescription: `该组件用于从用户的问题中提取关键词。Top N指定需要提取的关键词数量。`,
baidu: '百度',
baiduDescription: `该组件用于获取www.baidu.com的搜索结果一般作为知识库的补充Top N指定需要采纳的搜索结果数量。`,
duckDuckGo: 'DuckDuckGo',
duckDuckGoDescription:
'此组件用于从 www.duckduckgo.com 获取搜索结果。通常它作为知识库的补充。Top N 指定您需要采用的搜索结果数量。',
channel: '频道',
channelTip: '针对该组件的输入进行文本搜索或新闻搜索',
text: '文本',
news: '新闻',
},
footer: {
profile: 'All rights reserved @ React',

View File

@ -1,6 +1,6 @@
import TopNItem from '@/components/top-n-item';
import { useTranslate } from '@/hooks/commonHooks';
import { Form, Input } from 'antd';
import { Form, Select } from 'antd';
import { IOperatorForm } from '../interface';
const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
@ -20,8 +20,14 @@ const DuckDuckGoForm = ({ onValuesChange, form }: IOperatorForm) => {
label={t('channel')}
name={'channel'}
tooltip={t('channelTip')}
initialValue={'text'}
>
<Input.TextArea rows={5} />
<Select
options={[
{ value: 'text', label: t('text') },
{ value: 'news', label: t('news') },
]}
></Select>
</Form.Item>
</Form>
);