diff --git a/web/src/assets/svg/bing.svg b/web/src/assets/svg/bing.svg new file mode 100644 index 000000000..df74cd60c --- /dev/null +++ b/web/src/assets/svg/bing.svg @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/web/src/assets/svg/google.svg b/web/src/assets/svg/google.svg new file mode 100644 index 000000000..117a38864 --- /dev/null +++ b/web/src/assets/svg/google.svg @@ -0,0 +1,15 @@ + + + + + + \ No newline at end of file diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index d59794500..ac12ce2c3 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -639,6 +639,15 @@ The above is the content you need to summarize.`, submittedDate: 'Submitted date', lastUpdatedDate: 'Last updated date', relevance: 'Relevance', + google: 'Google', + googleTip: + 'This component is used to get search result fromhttps://www.google.com/ . Typically, it performs as a supplement to knowledgebases. Top N and SerpApi API key specifies the number of search results you need to adapt.', + bing: 'Bing', + bingTip: + 'This component is used to get search result from https://www.bing.com/. Typically, it performs as a supplement to knowledgebases. Top N and Bing Subscription-Key specifies the number of search results you need to adapt.', + apiKey: 'Api Key', + country: 'Country', + language: 'Language', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts index 263f8d3fe..7cd0c13ae 100644 --- a/web/src/locales/zh-traditional.ts +++ b/web/src/locales/zh-traditional.ts @@ -599,6 +599,15 @@ export default { submittedDate: '提交日期', lastUpdatedDate: '最後更新日期', relevance: '關聯', + google: 'Google', + googleTip: + '此元件用於從https://www.google.com/取得搜尋結果。通常,它作為知識庫的補充。 Top N 和 SerpApi API 金鑰指定您需要調整的搜尋結果數量。', + bing: 'Bing', + bingTip: + '此元件用於從 https://www.bing.com/ 取得搜尋結果。通常,它充當知識庫的補充。 Top N 和 Bing Subscription-Key 指定您需要適配的搜尋結果數量。', + apiKey: 'Api Key', + country: '國家', + language: '語言', }, footer: { profile: '“保留所有權利 @ react”', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index fec343513..c784680dd 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -617,6 +617,15 @@ export default { submittedDate: '提交日期', lastUpdatedDate: '最后更新日期', relevance: '关联', + google: 'Google', + googleTip: + '此组件用于从https://www.google.com/获取搜索结果。通常,它作为知识库的补充。Top N 和 SerpApi API 密钥指定您需要调整的搜索结果数量。', + bing: 'Bing', + bingTip: + '此组件用于从 https://www.bing.com/ 获取搜索结果。通常,它作为知识库的补充。Top N 和 Bing Subscription-Key 指定您需要调整的搜索结果数量。', + apiKey: 'Api Key', + country: '国家', + language: '语言', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/pages/flow/bing-form/index.tsx b/web/src/pages/flow/bing-form/index.tsx new file mode 100644 index 000000000..f18f8b0b1 --- /dev/null +++ b/web/src/pages/flow/bing-form/index.tsx @@ -0,0 +1,41 @@ +import TopNItem from '@/components/top-n-item'; +import { useTranslate } from '@/hooks/common-hooks'; +import { Form, Input, Select } from 'antd'; +import { useMemo } from 'react'; +import { BingCountryOptions, BingLanguageOptions } from '../constant'; +import { IOperatorForm } from '../interface'; + +const BingForm = ({ onValuesChange, form }: IOperatorForm) => { + const { t } = useTranslate('flow'); + + const options = useMemo(() => { + return ['Webpages', 'News'].map((x) => ({ label: x, value: x })); + }, []); + + return ( +
+ + + + + + + + + + + + + +
+ ); +}; + +export default BingForm; diff --git a/web/src/pages/flow/canvas/index.tsx b/web/src/pages/flow/canvas/index.tsx index fde7eb8e1..0129e1faa 100644 --- a/web/src/pages/flow/canvas/index.tsx +++ b/web/src/pages/flow/canvas/index.tsx @@ -24,6 +24,7 @@ import ChatDrawer from '../chat/drawer'; import styles from './index.less'; import { BeginNode } from './node/begin-node'; import { CategorizeNode } from './node/categorize-node'; +import { LogicNode } from './node/logic-node'; import { RelevantNode } from './node/relevant-node'; const nodeTypes = { @@ -31,6 +32,7 @@ const nodeTypes = { categorizeNode: CategorizeNode, beginNode: BeginNode, relevantNode: RelevantNode, + logicNode: LogicNode, }; const edgeTypes = { diff --git a/web/src/pages/flow/canvas/node/categorize-node.tsx b/web/src/pages/flow/canvas/node/categorize-node.tsx index c90f8c68b..1d5ecdd70 100644 --- a/web/src/pages/flow/canvas/node/categorize-node.tsx +++ b/web/src/pages/flow/canvas/node/categorize-node.tsx @@ -65,7 +65,7 @@ export function CategorizeNode({ id, data, selected }: NodeProps) { return (
x === data.label) ? 0 : 6} + // gap={ZeroGapOperators.some((x) => x === data.label) ? 0 : 6} > - + - - {t(lowerFirst(data.label))} - + ) { + const style = operatorMap[data.label as Operator]; + const { t } = useTranslate('flow'); + + return ( + +
+ + + + + x === data.label) ? 0 : 6} + > + + + + + + + {t(lowerFirst(data.label))} + + + + + + + +
+
{data.name}
+
+
+
+ ); +} diff --git a/web/src/pages/flow/canvas/node/relevant-node.tsx b/web/src/pages/flow/canvas/node/relevant-node.tsx index d15f69955..b08260c05 100644 --- a/web/src/pages/flow/canvas/node/relevant-node.tsx +++ b/web/src/pages/flow/canvas/node/relevant-node.tsx @@ -19,7 +19,7 @@ export function RelevantNode({ id, data, selected }: NodeProps) { return (
({ label: x.language_name, value: x.language_code })); +export const GoogleCountryOptions = [ + { + country_code: 'af', + country_name: 'Afghanistan', + }, + { + country_code: 'al', + country_name: 'Albania', + }, + { + country_code: 'dz', + country_name: 'Algeria', + }, + { + country_code: 'as', + country_name: 'American Samoa', + }, + { + country_code: 'ad', + country_name: 'Andorra', + }, + { + country_code: 'ao', + country_name: 'Angola', + }, + { + country_code: 'ai', + country_name: 'Anguilla', + }, + { + country_code: 'aq', + country_name: 'Antarctica', + }, + { + country_code: 'ag', + country_name: 'Antigua and Barbuda', + }, + { + country_code: 'ar', + country_name: 'Argentina', + }, + { + country_code: 'am', + country_name: 'Armenia', + }, + { + country_code: 'aw', + country_name: 'Aruba', + }, + { + country_code: 'au', + country_name: 'Australia', + }, + { + country_code: 'at', + country_name: 'Austria', + }, + { + country_code: 'az', + country_name: 'Azerbaijan', + }, + { + country_code: 'bs', + country_name: 'Bahamas', + }, + { + country_code: 'bh', + country_name: 'Bahrain', + }, + { + country_code: 'bd', + country_name: 'Bangladesh', + }, + { + country_code: 'bb', + country_name: 'Barbados', + }, + { + country_code: 'by', + country_name: 'Belarus', + }, + { + country_code: 'be', + country_name: 'Belgium', + }, + { + country_code: 'bz', + country_name: 'Belize', + }, + { + country_code: 'bj', + country_name: 'Benin', + }, + { + country_code: 'bm', + country_name: 'Bermuda', + }, + { + country_code: 'bt', + country_name: 'Bhutan', + }, + { + country_code: 'bo', + country_name: 'Bolivia', + }, + { + country_code: 'ba', + country_name: 'Bosnia and Herzegovina', + }, + { + country_code: 'bw', + country_name: 'Botswana', + }, + { + country_code: 'bv', + country_name: 'Bouvet Island', + }, + { + country_code: 'br', + country_name: 'Brazil', + }, + { + country_code: 'io', + country_name: 'British Indian Ocean Territory', + }, + { + country_code: 'bn', + country_name: 'Brunei Darussalam', + }, + { + country_code: 'bg', + country_name: 'Bulgaria', + }, + { + country_code: 'bf', + country_name: 'Burkina Faso', + }, + { + country_code: 'bi', + country_name: 'Burundi', + }, + { + country_code: 'kh', + country_name: 'Cambodia', + }, + { + country_code: 'cm', + country_name: 'Cameroon', + }, + { + country_code: 'ca', + country_name: 'Canada', + }, + { + country_code: 'cv', + country_name: 'Cape Verde', + }, + { + country_code: 'ky', + country_name: 'Cayman Islands', + }, + { + country_code: 'cf', + country_name: 'Central African Republic', + }, + { + country_code: 'td', + country_name: 'Chad', + }, + { + country_code: 'cl', + country_name: 'Chile', + }, + { + country_code: 'cn', + country_name: 'China', + }, + { + country_code: 'cx', + country_name: 'Christmas Island', + }, + { + country_code: 'cc', + country_name: 'Cocos (Keeling) Islands', + }, + { + country_code: 'co', + country_name: 'Colombia', + }, + { + country_code: 'km', + country_name: 'Comoros', + }, + { + country_code: 'cg', + country_name: 'Congo', + }, + { + country_code: 'cd', + country_name: 'Congo, the Democratic Republic of the', + }, + { + country_code: 'ck', + country_name: 'Cook Islands', + }, + { + country_code: 'cr', + country_name: 'Costa Rica', + }, + { + country_code: 'ci', + country_name: "Cote D'ivoire", + }, + { + country_code: 'hr', + country_name: 'Croatia', + }, + { + country_code: 'cu', + country_name: 'Cuba', + }, + { + country_code: 'cy', + country_name: 'Cyprus', + }, + { + country_code: 'cz', + country_name: 'Czech Republic', + }, + { + country_code: 'dk', + country_name: 'Denmark', + }, + { + country_code: 'dj', + country_name: 'Djibouti', + }, + { + country_code: 'dm', + country_name: 'Dominica', + }, + { + country_code: 'do', + country_name: 'Dominican Republic', + }, + { + country_code: 'ec', + country_name: 'Ecuador', + }, + { + country_code: 'eg', + country_name: 'Egypt', + }, + { + country_code: 'sv', + country_name: 'El Salvador', + }, + { + country_code: 'gq', + country_name: 'Equatorial Guinea', + }, + { + country_code: 'er', + country_name: 'Eritrea', + }, + { + country_code: 'ee', + country_name: 'Estonia', + }, + { + country_code: 'et', + country_name: 'Ethiopia', + }, + { + country_code: 'fk', + country_name: 'Falkland Islands (Malvinas)', + }, + { + country_code: 'fo', + country_name: 'Faroe Islands', + }, + { + country_code: 'fj', + country_name: 'Fiji', + }, + { + country_code: 'fi', + country_name: 'Finland', + }, + { + country_code: 'fr', + country_name: 'France', + }, + { + country_code: 'gf', + country_name: 'French Guiana', + }, + { + country_code: 'pf', + country_name: 'French Polynesia', + }, + { + country_code: 'tf', + country_name: 'French Southern Territories', + }, + { + country_code: 'ga', + country_name: 'Gabon', + }, + { + country_code: 'gm', + country_name: 'Gambia', + }, + { + country_code: 'ge', + country_name: 'Georgia', + }, + { + country_code: 'de', + country_name: 'Germany', + }, + { + country_code: 'gh', + country_name: 'Ghana', + }, + { + country_code: 'gi', + country_name: 'Gibraltar', + }, + { + country_code: 'gr', + country_name: 'Greece', + }, + { + country_code: 'gl', + country_name: 'Greenland', + }, + { + country_code: 'gd', + country_name: 'Grenada', + }, + { + country_code: 'gp', + country_name: 'Guadeloupe', + }, + { + country_code: 'gu', + country_name: 'Guam', + }, + { + country_code: 'gt', + country_name: 'Guatemala', + }, + { + country_code: 'gn', + country_name: 'Guinea', + }, + { + country_code: 'gw', + country_name: 'Guinea-Bissau', + }, + { + country_code: 'gy', + country_name: 'Guyana', + }, + { + country_code: 'ht', + country_name: 'Haiti', + }, + { + country_code: 'hm', + country_name: 'Heard Island and Mcdonald Islands', + }, + { + country_code: 'va', + country_name: 'Holy See (Vatican City State)', + }, + { + country_code: 'hn', + country_name: 'Honduras', + }, + { + country_code: 'hk', + country_name: 'Hong Kong', + }, + { + country_code: 'hu', + country_name: 'Hungary', + }, + { + country_code: 'is', + country_name: 'Iceland', + }, + { + country_code: 'in', + country_name: 'India', + }, + { + country_code: 'id', + country_name: 'Indonesia', + }, + { + country_code: 'ir', + country_name: 'Iran, Islamic Republic of', + }, + { + country_code: 'iq', + country_name: 'Iraq', + }, + { + country_code: 'ie', + country_name: 'Ireland', + }, + { + country_code: 'il', + country_name: 'Israel', + }, + { + country_code: 'it', + country_name: 'Italy', + }, + { + country_code: 'jm', + country_name: 'Jamaica', + }, + { + country_code: 'jp', + country_name: 'Japan', + }, + { + country_code: 'jo', + country_name: 'Jordan', + }, + { + country_code: 'kz', + country_name: 'Kazakhstan', + }, + { + country_code: 'ke', + country_name: 'Kenya', + }, + { + country_code: 'ki', + country_name: 'Kiribati', + }, + { + country_code: 'kp', + country_name: "Korea, Democratic People's Republic of", + }, + { + country_code: 'kr', + country_name: 'Korea, Republic of', + }, + { + country_code: 'kw', + country_name: 'Kuwait', + }, + { + country_code: 'kg', + country_name: 'Kyrgyzstan', + }, + { + country_code: 'la', + country_name: "Lao People's Democratic Republic", + }, + { + country_code: 'lv', + country_name: 'Latvia', + }, + { + country_code: 'lb', + country_name: 'Lebanon', + }, + { + country_code: 'ls', + country_name: 'Lesotho', + }, + { + country_code: 'lr', + country_name: 'Liberia', + }, + { + country_code: 'ly', + country_name: 'Libyan Arab Jamahiriya', + }, + { + country_code: 'li', + country_name: 'Liechtenstein', + }, + { + country_code: 'lt', + country_name: 'Lithuania', + }, + { + country_code: 'lu', + country_name: 'Luxembourg', + }, + { + country_code: 'mo', + country_name: 'Macao', + }, + { + country_code: 'mk', + country_name: 'Macedonia, the Former Yugosalv Republic of', + }, + { + country_code: 'mg', + country_name: 'Madagascar', + }, + { + country_code: 'mw', + country_name: 'Malawi', + }, + { + country_code: 'my', + country_name: 'Malaysia', + }, + { + country_code: 'mv', + country_name: 'Maldives', + }, + { + country_code: 'ml', + country_name: 'Mali', + }, + { + country_code: 'mt', + country_name: 'Malta', + }, + { + country_code: 'mh', + country_name: 'Marshall Islands', + }, + { + country_code: 'mq', + country_name: 'Martinique', + }, + { + country_code: 'mr', + country_name: 'Mauritania', + }, + { + country_code: 'mu', + country_name: 'Mauritius', + }, + { + country_code: 'yt', + country_name: 'Mayotte', + }, + { + country_code: 'mx', + country_name: 'Mexico', + }, + { + country_code: 'fm', + country_name: 'Micronesia, Federated States of', + }, + { + country_code: 'md', + country_name: 'Moldova, Republic of', + }, + { + country_code: 'mc', + country_name: 'Monaco', + }, + { + country_code: 'mn', + country_name: 'Mongolia', + }, + { + country_code: 'ms', + country_name: 'Montserrat', + }, + { + country_code: 'ma', + country_name: 'Morocco', + }, + { + country_code: 'mz', + country_name: 'Mozambique', + }, + { + country_code: 'mm', + country_name: 'Myanmar', + }, + { + country_code: 'na', + country_name: 'Namibia', + }, + { + country_code: 'nr', + country_name: 'Nauru', + }, + { + country_code: 'np', + country_name: 'Nepal', + }, + { + country_code: 'nl', + country_name: 'Netherlands', + }, + { + country_code: 'an', + country_name: 'Netherlands Antilles', + }, + { + country_code: 'nc', + country_name: 'New Caledonia', + }, + { + country_code: 'nz', + country_name: 'New Zealand', + }, + { + country_code: 'ni', + country_name: 'Nicaragua', + }, + { + country_code: 'ne', + country_name: 'Niger', + }, + { + country_code: 'ng', + country_name: 'Nigeria', + }, + { + country_code: 'nu', + country_name: 'Niue', + }, + { + country_code: 'nf', + country_name: 'Norfolk Island', + }, + { + country_code: 'mp', + country_name: 'Northern Mariana Islands', + }, + { + country_code: 'no', + country_name: 'Norway', + }, + { + country_code: 'om', + country_name: 'Oman', + }, + { + country_code: 'pk', + country_name: 'Pakistan', + }, + { + country_code: 'pw', + country_name: 'Palau', + }, + { + country_code: 'ps', + country_name: 'Palestinian Territory, Occupied', + }, + { + country_code: 'pa', + country_name: 'Panama', + }, + { + country_code: 'pg', + country_name: 'Papua New Guinea', + }, + { + country_code: 'py', + country_name: 'Paraguay', + }, + { + country_code: 'pe', + country_name: 'Peru', + }, + { + country_code: 'ph', + country_name: 'Philippines', + }, + { + country_code: 'pn', + country_name: 'Pitcairn', + }, + { + country_code: 'pl', + country_name: 'Poland', + }, + { + country_code: 'pt', + country_name: 'Portugal', + }, + { + country_code: 'pr', + country_name: 'Puerto Rico', + }, + { + country_code: 'qa', + country_name: 'Qatar', + }, + { + country_code: 're', + country_name: 'Reunion', + }, + { + country_code: 'ro', + country_name: 'Romania', + }, + { + country_code: 'ru', + country_name: 'Russian Federation', + }, + { + country_code: 'rw', + country_name: 'Rwanda', + }, + { + country_code: 'sh', + country_name: 'Saint Helena', + }, + { + country_code: 'kn', + country_name: 'Saint Kitts and Nevis', + }, + { + country_code: 'lc', + country_name: 'Saint Lucia', + }, + { + country_code: 'pm', + country_name: 'Saint Pierre and Miquelon', + }, + { + country_code: 'vc', + country_name: 'Saint Vincent and the Grenadines', + }, + { + country_code: 'ws', + country_name: 'Samoa', + }, + { + country_code: 'sm', + country_name: 'San Marino', + }, + { + country_code: 'st', + country_name: 'Sao Tome and Principe', + }, + { + country_code: 'sa', + country_name: 'Saudi Arabia', + }, + { + country_code: 'sn', + country_name: 'Senegal', + }, + { + country_code: 'rs', + country_name: 'Serbia and Montenegro', + }, + { + country_code: 'sc', + country_name: 'Seychelles', + }, + { + country_code: 'sl', + country_name: 'Sierra Leone', + }, + { + country_code: 'sg', + country_name: 'Singapore', + }, + { + country_code: 'sk', + country_name: 'Slovakia', + }, + { + country_code: 'si', + country_name: 'Slovenia', + }, + { + country_code: 'sb', + country_name: 'Solomon Islands', + }, + { + country_code: 'so', + country_name: 'Somalia', + }, + { + country_code: 'za', + country_name: 'South Africa', + }, + { + country_code: 'gs', + country_name: 'South Georgia and the South Sandwich Islands', + }, + { + country_code: 'es', + country_name: 'Spain', + }, + { + country_code: 'lk', + country_name: 'Sri Lanka', + }, + { + country_code: 'sd', + country_name: 'Sudan', + }, + { + country_code: 'sr', + country_name: 'Suriname', + }, + { + country_code: 'sj', + country_name: 'Svalbard and Jan Mayen', + }, + { + country_code: 'sz', + country_name: 'Swaziland', + }, + { + country_code: 'se', + country_name: 'Sweden', + }, + { + country_code: 'ch', + country_name: 'Switzerland', + }, + { + country_code: 'sy', + country_name: 'Syrian Arab Republic', + }, + { + country_code: 'tw', + country_name: 'Taiwan, Province of China', + }, + { + country_code: 'tj', + country_name: 'Tajikistan', + }, + { + country_code: 'tz', + country_name: 'Tanzania, United Republic of', + }, + { + country_code: 'th', + country_name: 'Thailand', + }, + { + country_code: 'tl', + country_name: 'Timor-Leste', + }, + { + country_code: 'tg', + country_name: 'Togo', + }, + { + country_code: 'tk', + country_name: 'Tokelau', + }, + { + country_code: 'to', + country_name: 'Tonga', + }, + { + country_code: 'tt', + country_name: 'Trinidad and Tobago', + }, + { + country_code: 'tn', + country_name: 'Tunisia', + }, + { + country_code: 'tr', + country_name: 'Turkiye', + }, + { + country_code: 'tm', + country_name: 'Turkmenistan', + }, + { + country_code: 'tc', + country_name: 'Turks and Caicos Islands', + }, + { + country_code: 'tv', + country_name: 'Tuvalu', + }, + { + country_code: 'ug', + country_name: 'Uganda', + }, + { + country_code: 'ua', + country_name: 'Ukraine', + }, + { + country_code: 'ae', + country_name: 'United Arab Emirates', + }, + { + country_code: 'uk', + country_name: 'United Kingdom', + }, + { + country_code: 'gb', + country_name: 'United Kingdom', + }, + { + country_code: 'us', + country_name: 'United States', + }, + { + country_code: 'um', + country_name: 'United States Minor Outlying Islands', + }, + { + country_code: 'uy', + country_name: 'Uruguay', + }, + { + country_code: 'uz', + country_name: 'Uzbekistan', + }, + { + country_code: 'vu', + country_name: 'Vanuatu', + }, + { + country_code: 've', + country_name: 'Venezuela', + }, + { + country_code: 'vn', + country_name: 'Viet Nam', + }, + { + country_code: 'vg', + country_name: 'Virgin Islands, British', + }, + { + country_code: 'vi', + country_name: 'Virgin Islands, U.S.', + }, + { + country_code: 'wf', + country_name: 'Wallis and Futuna', + }, + { + country_code: 'eh', + country_name: 'Western Sahara', + }, + { + country_code: 'ye', + country_name: 'Yemen', + }, + { + country_code: 'zm', + country_name: 'Zambia', + }, + { + country_code: 'zw', + country_name: 'Zimbabwe', + }, +].map((x) => ({ label: x.country_name, value: x.country_code })); + +export const BingCountryOptions = [ + { label: 'Argentina AR', value: 'AR' }, + { label: 'Australia AU', value: 'AU' }, + { label: 'Austria AT', value: 'AT' }, + { label: 'Belgium BE', value: 'BE' }, + { label: 'Brazil BR', value: 'BR' }, + { label: 'Canada CA', value: 'CA' }, + { label: 'Chile CL', value: 'CL' }, + { label: 'Denmark DK', value: 'DK' }, + { label: 'Finland FI', value: 'FI' }, + { label: 'France FR', value: 'FR' }, + { label: 'Germany DE', value: 'DE' }, + { label: 'Hong Kong SAR HK', value: 'HK' }, + { label: 'India IN', value: 'IN' }, + { label: 'Indonesia ID', value: 'ID' }, + { label: 'Italy IT', value: 'IT' }, + { label: 'Japan JP', value: 'JP' }, + { label: 'Korea KR', value: 'KR' }, + { label: 'Malaysia MY', value: 'MY' }, + { label: 'Mexico MX', value: 'MX' }, + { label: 'Netherlands NL', value: 'NL' }, + { label: 'New Zealand NZ', value: 'NZ' }, + { label: 'Norway NO', value: 'NO' }, + { label: "People's Republic of China CN", value: 'CN' }, + { label: 'Poland PL', value: 'PL' }, + { label: 'Portugal PT', value: 'PT' }, + { label: 'Republic of the Philippines PH', value: 'PH' }, + { label: 'Russia RU', value: 'RU' }, + { label: 'Saudi Arabia SA', value: 'SA' }, + { label: 'South Africa ZA', value: 'ZA' }, + { label: 'Spain ES', value: 'ES' }, + { label: 'Sweden SE', value: 'SE' }, + { label: 'Switzerland CH', value: 'CH' }, + { label: 'Taiwan TW', value: 'TW' }, + { label: 'Türkiye TR', value: 'TR' }, + { label: 'United Kingdom GB', value: 'GB' }, + { label: 'United States US', value: 'US' }, +]; + +export const BingLanguageOptions = [ + { label: 'Arabic ar', value: 'ar' }, + { label: 'Basque eu', value: 'eu' }, + { label: 'Bengali bn', value: 'bn' }, + { label: 'Bulgarian bg', value: 'bg' }, + { label: 'Catalan ca', value: 'ca' }, + { label: 'Chinese (Simplified) zh-hans', value: 'ns' }, + { label: 'Chinese (Traditional) zh-hant', value: 'nt' }, + { label: 'Croatian hr', value: 'hr' }, + { label: 'Czech cs', value: 'cs' }, + { label: 'Danish da', value: 'da' }, + { label: 'Dutch nl', value: 'nl' }, + { label: 'English en', value: 'en' }, + { label: 'English-United Kingdom en-gb', value: 'gb' }, + { label: 'Estonian et', value: 'et' }, + { label: 'Finnish fi', value: 'fi' }, + { label: 'French fr', value: 'fr' }, + { label: 'Galician gl', value: 'gl' }, + { label: 'German de', value: 'de' }, + { label: 'Gujarati gu', value: 'gu' }, + { label: 'Hebrew he', value: 'he' }, + { label: 'Hindi hi', value: 'hi' }, + { label: 'Hungarian hu', value: 'hu' }, + { label: 'Icelandic is', value: 'is' }, + { label: 'Italian it', value: 'it' }, + { label: 'Japanese jp', value: 'jp' }, + { label: 'Kannada kn', value: 'kn' }, + { label: 'Korean ko', value: 'ko' }, + { label: 'Latvian lv', value: 'lv' }, + { label: 'Lithuanian lt', value: 'lt' }, + { label: 'Malay ms', value: 'ms' }, + { label: 'Malayalam ml', value: 'ml' }, + { label: 'Marathi mr', value: 'mr' }, + { label: 'Norwegian (Bokmål) nb', value: 'nb' }, + { label: 'Polish pl', value: 'pl' }, + { label: 'Portuguese (Brazil) pt-br', value: 'br' }, + { label: 'Portuguese (Portugal) pt-pt', value: 'pt' }, + { label: 'Punjabi pa', value: 'pa' }, + { label: 'Romanian ro', value: 'ro' }, + { label: 'Russian ru', value: 'ru' }, + { label: 'Serbian (Cyrylic) sr', value: 'sr' }, + { label: 'Slovak sk', value: 'sk' }, + { label: 'Slovenian sl', value: 'sl' }, + { label: 'Spanish es', value: 'es' }, + { label: 'Swedish sv', value: 'sv' }, + { label: 'Tamil ta', value: 'ta' }, + { label: 'Telugu te', value: 'te' }, + { label: 'Thai th', value: 'th' }, + { label: 'Turkish tr', value: 'tr' }, + { label: 'Ukrainian uk', value: 'uk' }, + { label: 'Vietnamese vi', value: 'vi' }, +]; diff --git a/web/src/pages/flow/flow-drawer/index.tsx b/web/src/pages/flow/flow-drawer/index.tsx index 1b7ce9f72..c6c7e7984 100644 --- a/web/src/pages/flow/flow-drawer/index.tsx +++ b/web/src/pages/flow/flow-drawer/index.tsx @@ -7,10 +7,12 @@ import AnswerForm from '../answer-form'; import ArXivForm from '../arxiv-form'; import BaiduForm from '../baidu-form'; import BeginForm from '../begin-form'; +import BingForm from '../bing-form'; import CategorizeForm from '../categorize-form'; import { Operator } from '../constant'; import DuckDuckGoForm from '../duckduckgo-form'; import GenerateForm from '../generate-form'; +import GoogleForm from '../google-form'; import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks'; import KeywordExtractForm from '../keyword-extract-form'; import MessageForm from '../message-form'; @@ -42,6 +44,8 @@ const FormMap = { [Operator.Wikipedia]: WikipediaForm, [Operator.PubMed]: PubMedForm, [Operator.ArXiv]: ArXivForm, + [Operator.Google]: GoogleForm, + [Operator.Bing]: BingForm, }; const EmptyContent = () =>
empty
; diff --git a/web/src/pages/flow/google-form/index.tsx b/web/src/pages/flow/google-form/index.tsx new file mode 100644 index 000000000..807b690c7 --- /dev/null +++ b/web/src/pages/flow/google-form/index.tsx @@ -0,0 +1,33 @@ +import TopNItem from '@/components/top-n-item'; +import { useTranslate } from '@/hooks/common-hooks'; +import { Form, Input, Select } from 'antd'; +import { GoogleCountryOptions, GoogleLanguageOptions } from '../constant'; +import { IOperatorForm } from '../interface'; + +const GoogleForm = ({ onValuesChange, form }: IOperatorForm) => { + const { t } = useTranslate('flow'); + + return ( +
+ + + + + + + + + + +
+ ); +}; + +export default GoogleForm; diff --git a/web/src/pages/flow/hooks.ts b/web/src/pages/flow/hooks.ts index 971f9a980..1c4bc3b41 100644 --- a/web/src/pages/flow/hooks.ts +++ b/web/src/pages/flow/hooks.ts @@ -30,12 +30,14 @@ import { NodeMap, Operator, RestrictedUpstreamMap, - initialArxivValues, + initialArXivValues, initialBaiduValues, initialBeginValues, + initialBingValues, initialCategorizeValues, initialDuckValues, initialGenerateValues, + initialGoogleValues, initialKeywordExtractValues, initialMessageValues, initialPubMedValues, @@ -92,7 +94,9 @@ export const useInitializeOperatorParams = () => { [Operator.Baidu]: initialBaiduValues, [Operator.Wikipedia]: initialWikipediaValues, [Operator.PubMed]: initialPubMedValues, - [Operator.ArXiv]: initialArxivValues, + [Operator.ArXiv]: initialArXivValues, + [Operator.Google]: initialGoogleValues, + [Operator.Bing]: initialBingValues, }; }, [llmId]);