balibabu commited on
Commit
95ccaf9
·
1 Parent(s): 36d0b06

feat: Add bing and google operator #918 (#1745)

Browse files

### What problem does this PR solve?

feat: Add bing and google operator #918

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

web/src/assets/svg/bing.svg ADDED
web/src/assets/svg/google.svg ADDED
web/src/locales/en.ts CHANGED
@@ -639,6 +639,15 @@ The above is the content you need to summarize.`,
639
  submittedDate: 'Submitted date',
640
  lastUpdatedDate: 'Last updated date',
641
  relevance: 'Relevance',
 
 
 
 
 
 
 
 
 
642
  },
643
  footer: {
644
  profile: 'All rights reserved @ React',
 
639
  submittedDate: 'Submitted date',
640
  lastUpdatedDate: 'Last updated date',
641
  relevance: 'Relevance',
642
+ google: 'Google',
643
+ googleTip:
644
+ '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.',
645
+ bing: 'Bing',
646
+ bingTip:
647
+ '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.',
648
+ apiKey: 'Api Key',
649
+ country: 'Country',
650
+ language: 'Language',
651
  },
652
  footer: {
653
  profile: 'All rights reserved @ React',
web/src/locales/zh-traditional.ts CHANGED
@@ -599,6 +599,15 @@ export default {
599
  submittedDate: '提交日期',
600
  lastUpdatedDate: '最後更新日期',
601
  relevance: '關聯',
 
 
 
 
 
 
 
 
 
602
  },
603
  footer: {
604
  profile: '“保留所有權利 @ react”',
 
599
  submittedDate: '提交日期',
600
  lastUpdatedDate: '最後更新日期',
601
  relevance: '關聯',
602
+ google: 'Google',
603
+ googleTip:
604
+ '此元件用於從https://www.google.com/取得搜尋結果。通常,它作為知識庫的補充。 Top N 和 SerpApi API 金鑰指定您需要調整的搜尋結果數量。',
605
+ bing: 'Bing',
606
+ bingTip:
607
+ '此元件用於從 https://www.bing.com/ 取得搜尋結果。通常,它充當知識庫的補充。 Top N 和 Bing Subscription-Key 指定您需要適配的搜尋結果數量。',
608
+ apiKey: 'Api Key',
609
+ country: '國家',
610
+ language: '語言',
611
  },
612
  footer: {
613
  profile: '“保留所有權利 @ react”',
web/src/locales/zh.ts CHANGED
@@ -617,6 +617,15 @@ export default {
617
  submittedDate: '提交日期',
618
  lastUpdatedDate: '最后更新日期',
619
  relevance: '关联',
 
 
 
 
 
 
 
 
 
620
  },
621
  footer: {
622
  profile: 'All rights reserved @ React',
 
617
  submittedDate: '提交日期',
618
  lastUpdatedDate: '最后更新日期',
619
  relevance: '关联',
620
+ google: 'Google',
621
+ googleTip:
622
+ '此组件用于从https://www.google.com/获取搜索结果。通常,它作为知识库的补充。Top N 和 SerpApi API 密钥指定您需要调整的搜索结果数量。',
623
+ bing: 'Bing',
624
+ bingTip:
625
+ '此组件用于从 https://www.bing.com/ 获取搜索结果。通常,它作为知识库的补充。Top N 和 Bing Subscription-Key 指定您需要调整的搜索结果数量。',
626
+ apiKey: 'Api Key',
627
+ country: '国家',
628
+ language: '语言',
629
  },
630
  footer: {
631
  profile: 'All rights reserved @ React',
web/src/pages/flow/bing-form/index.tsx ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import TopNItem from '@/components/top-n-item';
2
+ import { useTranslate } from '@/hooks/common-hooks';
3
+ import { Form, Input, Select } from 'antd';
4
+ import { useMemo } from 'react';
5
+ import { BingCountryOptions, BingLanguageOptions } from '../constant';
6
+ import { IOperatorForm } from '../interface';
7
+
8
+ const BingForm = ({ onValuesChange, form }: IOperatorForm) => {
9
+ const { t } = useTranslate('flow');
10
+
11
+ const options = useMemo(() => {
12
+ return ['Webpages', 'News'].map((x) => ({ label: x, value: x }));
13
+ }, []);
14
+
15
+ return (
16
+ <Form
17
+ name="basic"
18
+ labelCol={{ span: 6 }}
19
+ wrapperCol={{ span: 18 }}
20
+ autoComplete="off"
21
+ form={form}
22
+ onValuesChange={onValuesChange}
23
+ >
24
+ <TopNItem initialValue={10}></TopNItem>
25
+ <Form.Item label={t('channel')} name={'channel'}>
26
+ <Select options={options}></Select>
27
+ </Form.Item>
28
+ <Form.Item label={t('apiKey')} name={'api_key'}>
29
+ <Input></Input>
30
+ </Form.Item>
31
+ <Form.Item label={t('country')} name={'country'}>
32
+ <Select options={BingCountryOptions}></Select>
33
+ </Form.Item>
34
+ <Form.Item label={t('language')} name={'language'}>
35
+ <Select options={BingLanguageOptions}></Select>
36
+ </Form.Item>
37
+ </Form>
38
+ );
39
+ };
40
+
41
+ export default BingForm;
web/src/pages/flow/canvas/index.tsx CHANGED
@@ -24,6 +24,7 @@ import ChatDrawer from '../chat/drawer';
24
  import styles from './index.less';
25
  import { BeginNode } from './node/begin-node';
26
  import { CategorizeNode } from './node/categorize-node';
 
27
  import { RelevantNode } from './node/relevant-node';
28
 
29
  const nodeTypes = {
@@ -31,6 +32,7 @@ const nodeTypes = {
31
  categorizeNode: CategorizeNode,
32
  beginNode: BeginNode,
33
  relevantNode: RelevantNode,
 
34
  };
35
 
36
  const edgeTypes = {
 
24
  import styles from './index.less';
25
  import { BeginNode } from './node/begin-node';
26
  import { CategorizeNode } from './node/categorize-node';
27
+ import { LogicNode } from './node/logic-node';
28
  import { RelevantNode } from './node/relevant-node';
29
 
30
  const nodeTypes = {
 
32
  categorizeNode: CategorizeNode,
33
  beginNode: BeginNode,
34
  relevantNode: RelevantNode,
35
+ logicNode: LogicNode,
36
  };
37
 
38
  const edgeTypes = {
web/src/pages/flow/canvas/node/categorize-node.tsx CHANGED
@@ -65,7 +65,7 @@ export function CategorizeNode({ id, data, selected }: NodeProps<NodeData>) {
65
  return (
66
  <NodePopover nodeId={id}>
67
  <section
68
- className={classNames(styles.ragNode, {
69
  [styles.selectedNode]: selected,
70
  })}
71
  style={{
 
65
  return (
66
  <NodePopover nodeId={id}>
67
  <section
68
+ className={classNames(styles.logicNode, {
69
  [styles.selectedNode]: selected,
70
  })}
71
  style={{
web/src/pages/flow/canvas/node/index.less CHANGED
@@ -8,8 +8,8 @@
8
  padding: 5px;
9
  border-radius: 5px;
10
  background: white;
11
- width: 100px;
12
- height: 100px;
13
  border-radius: 50%;
14
  display: flex;
15
  // align-items: center;
@@ -48,6 +48,7 @@
48
  white-space: nowrap;
49
  }
50
  }
 
51
  .selectedNode {
52
  border: 1px solid rgb(59, 118, 244);
53
  }
@@ -64,3 +65,54 @@
64
  max-width: 300px;
65
  max-height: 500px;
66
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  padding: 5px;
9
  border-radius: 5px;
10
  background: white;
11
+ width: 50px;
12
+ height: 50px;
13
  border-radius: 50%;
14
  display: flex;
15
  // align-items: center;
 
48
  white-space: nowrap;
49
  }
50
  }
51
+
52
  .selectedNode {
53
  border: 1px solid rgb(59, 118, 244);
54
  }
 
65
  max-width: 300px;
66
  max-height: 500px;
67
  }
68
+
69
+ .logicNode {
70
+ position: relative;
71
+ box-shadow:
72
+ -6px 0 12px 0 rgba(179, 177, 177, 0.08),
73
+ -3px 0 6px -4px rgba(0, 0, 0, 0.12),
74
+ -6px 0 16px 6px rgba(0, 0, 0, 0.05);
75
+
76
+ padding: 5px;
77
+ border-radius: 5px;
78
+ background: white;
79
+ width: 100px;
80
+ height: 100px;
81
+ border-radius: 50%;
82
+ display: flex;
83
+ // align-items: center;
84
+ // justify-self: center;
85
+ justify-content: center;
86
+ .nodeName {
87
+ font-size: 10px;
88
+ color: black;
89
+ }
90
+ label {
91
+ display: block;
92
+ color: #777;
93
+ font-size: 12px;
94
+ }
95
+ .type {
96
+ // font-size: 12px;
97
+ }
98
+ .description {
99
+ font-size: 10px;
100
+ }
101
+ .bottomBox {
102
+ position: absolute;
103
+ bottom: -34px;
104
+ background: white;
105
+ padding: 2px 5px;
106
+ border-radius: 5px;
107
+ box-shadow:
108
+ -6px 0 12px 0 rgba(179, 177, 177, 0.08),
109
+ -3px 0 6px -4px rgba(0, 0, 0, 0.12),
110
+ -6px 0 16px 6px rgba(0, 0, 0, 0.05);
111
+ }
112
+ .categorizeAnchorPointText {
113
+ position: absolute;
114
+ top: -4px;
115
+ left: 8px;
116
+ white-space: nowrap;
117
+ }
118
+ }
web/src/pages/flow/canvas/node/index.tsx CHANGED
@@ -1,7 +1,6 @@
1
  import { useTranslate } from '@/hooks/common-hooks';
2
  import { Flex } from 'antd';
3
  import classNames from 'classnames';
4
- import lowerFirst from 'lodash/lowerFirst';
5
  import pick from 'lodash/pick';
6
  import { Handle, NodeProps, Position } from 'reactflow';
7
  import { Operator, operatorMap } from '../../constant';
@@ -32,7 +31,9 @@ export function RagNode({
32
  className={classNames(styles.ragNode, {
33
  [styles.selectedNode]: selected,
34
  })}
35
- style={pick(style, ['backgroundColor', 'width', 'height', 'color'])}
 
 
36
  >
37
  <Handle
38
  id="c"
@@ -54,24 +55,19 @@ export function RagNode({
54
  vertical
55
  align="center"
56
  justify={'space-around'}
57
- gap={ZeroGapOperators.some((x) => x === data.label) ? 0 : 6}
58
  >
59
  <Flex flex={1} justify="center" align="center">
 
 
 
 
60
  <OperatorIcon
61
  name={data.label as Operator}
62
- fontSize={style?.iconFontSize ?? 24}
63
  width={style?.iconWidth}
64
  ></OperatorIcon>
65
  </Flex>
66
-
67
- <Flex flex={1}>
68
- <span
69
- className={styles.type}
70
- style={{ fontSize: style?.fontSize ?? 14 }}
71
- >
72
- {t(lowerFirst(data.label))}
73
- </span>
74
- </Flex>
75
  <Flex flex={1}>
76
  <NodeDropdown
77
  id={id}
 
1
  import { useTranslate } from '@/hooks/common-hooks';
2
  import { Flex } from 'antd';
3
  import classNames from 'classnames';
 
4
  import pick from 'lodash/pick';
5
  import { Handle, NodeProps, Position } from 'reactflow';
6
  import { Operator, operatorMap } from '../../constant';
 
31
  className={classNames(styles.ragNode, {
32
  [styles.selectedNode]: selected,
33
  })}
34
+ style={{
35
+ ...pick(style, ['backgroundColor', 'color']),
36
+ }}
37
  >
38
  <Handle
39
  id="c"
 
55
  vertical
56
  align="center"
57
  justify={'space-around'}
58
+ // gap={ZeroGapOperators.some((x) => x === data.label) ? 0 : 6}
59
  >
60
  <Flex flex={1} justify="center" align="center">
61
+ <label htmlFor=""> </label>
62
+ </Flex>
63
+
64
+ <Flex flex={1}>
65
  <OperatorIcon
66
  name={data.label as Operator}
67
+ fontSize={style?.iconFontSize ?? 16}
68
  width={style?.iconWidth}
69
  ></OperatorIcon>
70
  </Flex>
 
 
 
 
 
 
 
 
 
71
  <Flex flex={1}>
72
  <NodeDropdown
73
  id={id}
web/src/pages/flow/canvas/node/logic-node.tsx ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useTranslate } from '@/hooks/common-hooks';
2
+ import { Flex } from 'antd';
3
+ import classNames from 'classnames';
4
+ import lowerFirst from 'lodash/lowerFirst';
5
+ import pick from 'lodash/pick';
6
+ import { Handle, NodeProps, Position } from 'reactflow';
7
+ import { Operator, operatorMap } from '../../constant';
8
+ import { NodeData } from '../../interface';
9
+ import OperatorIcon from '../../operator-icon';
10
+ import NodeDropdown from './dropdown';
11
+ import styles from './index.less';
12
+ import NodePopover from './popover';
13
+
14
+ const ZeroGapOperators = [
15
+ Operator.RewriteQuestion,
16
+ Operator.KeywordExtract,
17
+ Operator.ArXiv,
18
+ ];
19
+
20
+ export function LogicNode({
21
+ id,
22
+ data,
23
+ isConnectable = true,
24
+ selected,
25
+ }: NodeProps<NodeData>) {
26
+ const style = operatorMap[data.label as Operator];
27
+ const { t } = useTranslate('flow');
28
+
29
+ return (
30
+ <NodePopover nodeId={id}>
31
+ <section
32
+ className={classNames(styles.logicNode, {
33
+ [styles.selectedNode]: selected,
34
+ })}
35
+ style={pick(style, ['backgroundColor', 'width', 'height', 'color'])}
36
+ >
37
+ <Handle
38
+ id="c"
39
+ type="source"
40
+ position={Position.Left}
41
+ isConnectable={isConnectable}
42
+ className={styles.handle}
43
+ ></Handle>
44
+ <Handle type="source" position={Position.Top} id="d" isConnectable />
45
+ <Handle
46
+ type="source"
47
+ position={Position.Right}
48
+ isConnectable={isConnectable}
49
+ className={styles.handle}
50
+ id="b"
51
+ ></Handle>
52
+ <Handle type="source" position={Position.Bottom} id="a" isConnectable />
53
+ <Flex
54
+ vertical
55
+ align="center"
56
+ justify={'space-around'}
57
+ gap={ZeroGapOperators.some((x) => x === data.label) ? 0 : 6}
58
+ >
59
+ <Flex flex={1} justify="center" align="center">
60
+ <OperatorIcon
61
+ name={data.label as Operator}
62
+ fontSize={style?.iconFontSize ?? 24}
63
+ width={style?.iconWidth}
64
+ ></OperatorIcon>
65
+ </Flex>
66
+
67
+ <Flex flex={1}>
68
+ <span
69
+ className={styles.type}
70
+ style={{ fontSize: style?.fontSize ?? 14 }}
71
+ >
72
+ {t(lowerFirst(data.label))}
73
+ </span>
74
+ </Flex>
75
+ <Flex flex={1}>
76
+ <NodeDropdown
77
+ id={id}
78
+ iconFontColor={style?.moreIconColor}
79
+ ></NodeDropdown>
80
+ </Flex>
81
+ </Flex>
82
+
83
+ <section className={styles.bottomBox}>
84
+ <div className={styles.nodeName}>{data.name}</div>
85
+ </section>
86
+ </section>
87
+ </NodePopover>
88
+ );
89
+ }
web/src/pages/flow/canvas/node/relevant-node.tsx CHANGED
@@ -19,7 +19,7 @@ export function RelevantNode({ id, data, selected }: NodeProps<NodeData>) {
19
  return (
20
  <NodePopover nodeId={id}>
21
  <section
22
- className={classNames(styles.ragNode, {
23
  [styles.selectedNode]: selected,
24
  })}
25
  style={pick(style, ['backgroundColor', 'width', 'height', 'color'])}
 
19
  return (
20
  <NodePopover nodeId={id}>
21
  <section
22
+ className={classNames(styles.logicNode, {
23
  [styles.selectedNode]: selected,
24
  })}
25
  style={pick(style, ['backgroundColor', 'width', 'height', 'color'])}
web/src/pages/flow/constant.tsx CHANGED
@@ -1,6 +1,8 @@
1
- import { ReactComponent as ArxivIcon } from '@/assets/svg/arxiv.svg';
2
  import { ReactComponent as BaiduIcon } from '@/assets/svg/baidu.svg';
 
3
  import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
 
4
  import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
5
  import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
6
  import { ReactComponent as WikipediaIcon } from '@/assets/svg/wikipedia.svg';
@@ -40,6 +42,8 @@ export enum Operator {
40
  Wikipedia = 'Wikipedia',
41
  PubMed = 'PubMed',
42
  ArXiv = 'ArXiv',
 
 
43
  }
44
 
45
  export const operatorIconMap = {
@@ -56,7 +60,9 @@ export const operatorIconMap = {
56
  [Operator.Baidu]: BaiduIcon,
57
  [Operator.Wikipedia]: WikipediaIcon,
58
  [Operator.PubMed]: PubMedIcon,
59
- [Operator.ArXiv]: ArxivIcon,
 
 
60
  };
61
 
62
  export const operatorMap = {
@@ -116,7 +122,9 @@ export const operatorMap = {
116
  backgroundColor: '#e7e389',
117
  color: '#aea00c',
118
  },
119
- [Operator.Baidu]: {},
 
 
120
  [Operator.Wikipedia]: {
121
  backgroundColor: '#dee0e2',
122
  },
@@ -133,6 +141,10 @@ export const operatorMap = {
133
  backgroundColor: '#b31b1b',
134
  color: 'white',
135
  },
 
 
 
 
136
  };
137
 
138
  export const componentMenuList = [
@@ -175,6 +187,12 @@ export const componentMenuList = [
175
  {
176
  name: Operator.ArXiv,
177
  },
 
 
 
 
 
 
178
  ];
179
 
180
  export const initialRetrievalValues = {
@@ -252,11 +270,27 @@ export const initialPubMedValues = {
252
  email: '',
253
  };
254
 
255
- export const initialArxivValues = {
256
  top_n: 10,
257
  sort_by: 'relevance',
258
  };
259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
260
  export const CategorizeAnchorPointPositions = [
261
  { top: 1, right: 34 },
262
  { top: 8, right: 18 },
@@ -318,23 +352,27 @@ export const RestrictedUpstreamMap = {
318
  [Operator.Wikipedia]: [Operator.Begin, Operator.Retrieval],
319
  [Operator.PubMed]: [Operator.Begin, Operator.Retrieval],
320
  [Operator.ArXiv]: [Operator.Begin, Operator.Retrieval],
 
 
321
  };
322
 
323
  export const NodeMap = {
324
  [Operator.Begin]: 'beginNode',
325
  [Operator.Categorize]: 'categorizeNode',
326
- [Operator.Retrieval]: 'ragNode',
327
- [Operator.Generate]: 'ragNode',
328
- [Operator.Answer]: 'ragNode',
329
- [Operator.Message]: 'ragNode',
330
  [Operator.Relevant]: 'relevantNode',
331
- [Operator.RewriteQuestion]: 'ragNode',
332
- [Operator.KeywordExtract]: 'ragNode',
333
  [Operator.DuckDuckGo]: 'ragNode',
334
  [Operator.Baidu]: 'ragNode',
335
  [Operator.Wikipedia]: 'ragNode',
336
  [Operator.PubMed]: 'ragNode',
337
  [Operator.ArXiv]: 'ragNode',
 
 
338
  };
339
 
340
  export const LanguageOptions = [
@@ -619,3 +657,1684 @@ export const LanguageOptions = [
619
  label: '粵語',
620
  },
621
  ];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { ReactComponent as ArXivIcon } from '@/assets/svg/arxiv.svg';
2
  import { ReactComponent as BaiduIcon } from '@/assets/svg/baidu.svg';
3
+ import { ReactComponent as BingIcon } from '@/assets/svg/bing.svg';
4
  import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
5
+ import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
6
  import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
7
  import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
8
  import { ReactComponent as WikipediaIcon } from '@/assets/svg/wikipedia.svg';
 
42
  Wikipedia = 'Wikipedia',
43
  PubMed = 'PubMed',
44
  ArXiv = 'ArXiv',
45
+ Google = 'Google',
46
+ Bing = 'Bing',
47
  }
48
 
49
  export const operatorIconMap = {
 
60
  [Operator.Baidu]: BaiduIcon,
61
  [Operator.Wikipedia]: WikipediaIcon,
62
  [Operator.PubMed]: PubMedIcon,
63
+ [Operator.ArXiv]: ArXivIcon,
64
+ [Operator.Google]: GoogleIcon,
65
+ [Operator.Bing]: BingIcon,
66
  };
67
 
68
  export const operatorMap = {
 
122
  backgroundColor: '#e7e389',
123
  color: '#aea00c',
124
  },
125
+ [Operator.Baidu]: {
126
+ backgroundColor: '#d9e0f8',
127
+ },
128
  [Operator.Wikipedia]: {
129
  backgroundColor: '#dee0e2',
130
  },
 
141
  backgroundColor: '#b31b1b',
142
  color: 'white',
143
  },
144
+ [Operator.Google]: {
145
+ backgroundColor: 'pink',
146
+ },
147
+ [Operator.Bing]: {},
148
  };
149
 
150
  export const componentMenuList = [
 
187
  {
188
  name: Operator.ArXiv,
189
  },
190
+ {
191
+ name: Operator.Google,
192
+ },
193
+ {
194
+ name: Operator.Bing,
195
+ },
196
  ];
197
 
198
  export const initialRetrievalValues = {
 
270
  email: '',
271
  };
272
 
273
+ export const initialArXivValues = {
274
  top_n: 10,
275
  sort_by: 'relevance',
276
  };
277
 
278
+ export const initialGoogleValues = {
279
+ top_n: 10,
280
+ api_key: 'Xxx(get from https://serpapi.com/manage-api-key)',
281
+ country: 'cn',
282
+ language: 'en',
283
+ };
284
+
285
+ export const initialBingValues = {
286
+ top_n: 10,
287
+ channel: 'Webpages',
288
+ api_key:
289
+ '"YOUR_ACCESS_KEY"(get from https://www.microsoft.com/en-us/bing/apis/bing-web-search-api)',
290
+ country: 'CH',
291
+ language: 'en',
292
+ };
293
+
294
  export const CategorizeAnchorPointPositions = [
295
  { top: 1, right: 34 },
296
  { top: 8, right: 18 },
 
352
  [Operator.Wikipedia]: [Operator.Begin, Operator.Retrieval],
353
  [Operator.PubMed]: [Operator.Begin, Operator.Retrieval],
354
  [Operator.ArXiv]: [Operator.Begin, Operator.Retrieval],
355
+ [Operator.Google]: [Operator.Begin, Operator.Retrieval],
356
+ [Operator.Bing]: [Operator.Begin, Operator.Retrieval],
357
  };
358
 
359
  export const NodeMap = {
360
  [Operator.Begin]: 'beginNode',
361
  [Operator.Categorize]: 'categorizeNode',
362
+ [Operator.Retrieval]: 'logicNode',
363
+ [Operator.Generate]: 'logicNode',
364
+ [Operator.Answer]: 'logicNode',
365
+ [Operator.Message]: 'logicNode',
366
  [Operator.Relevant]: 'relevantNode',
367
+ [Operator.RewriteQuestion]: 'logicNode',
368
+ [Operator.KeywordExtract]: 'logicNode',
369
  [Operator.DuckDuckGo]: 'ragNode',
370
  [Operator.Baidu]: 'ragNode',
371
  [Operator.Wikipedia]: 'ragNode',
372
  [Operator.PubMed]: 'ragNode',
373
  [Operator.ArXiv]: 'ragNode',
374
+ [Operator.Google]: 'ragNode',
375
+ [Operator.Bing]: 'ragNode',
376
  };
377
 
378
  export const LanguageOptions = [
 
657
  label: '粵語',
658
  },
659
  ];
660
+
661
+ export const GoogleLanguageOptions = [
662
+ {
663
+ language_code: 'af',
664
+ language_name: 'Afrikaans',
665
+ },
666
+ {
667
+ language_code: 'ak',
668
+ language_name: 'Akan',
669
+ },
670
+ {
671
+ language_code: 'sq',
672
+ language_name: 'Albanian',
673
+ },
674
+ {
675
+ language_code: 'ws',
676
+ language_name: 'Samoa',
677
+ },
678
+ {
679
+ language_code: 'am',
680
+ language_name: 'Amharic',
681
+ },
682
+ {
683
+ language_code: 'ar',
684
+ language_name: 'Arabic',
685
+ },
686
+ {
687
+ language_code: 'hy',
688
+ language_name: 'Armenian',
689
+ },
690
+ {
691
+ language_code: 'az',
692
+ language_name: 'Azerbaijani',
693
+ },
694
+ {
695
+ language_code: 'eu',
696
+ language_name: 'Basque',
697
+ },
698
+ {
699
+ language_code: 'be',
700
+ language_name: 'Belarusian',
701
+ },
702
+ {
703
+ language_code: 'bem',
704
+ language_name: 'Bemba',
705
+ },
706
+ {
707
+ language_code: 'bn',
708
+ language_name: 'Bengali',
709
+ },
710
+ {
711
+ language_code: 'bh',
712
+ language_name: 'Bihari',
713
+ },
714
+ {
715
+ language_code: 'xx-bork',
716
+ language_name: 'Bork, bork, bork!',
717
+ },
718
+ {
719
+ language_code: 'bs',
720
+ language_name: 'Bosnian',
721
+ },
722
+ {
723
+ language_code: 'br',
724
+ language_name: 'Breton',
725
+ },
726
+ {
727
+ language_code: 'bg',
728
+ language_name: 'Bulgarian',
729
+ },
730
+ {
731
+ language_code: 'bt',
732
+ language_name: 'Bhutanese',
733
+ },
734
+ {
735
+ language_code: 'km',
736
+ language_name: 'Cambodian',
737
+ },
738
+ {
739
+ language_code: 'ca',
740
+ language_name: 'Catalan',
741
+ },
742
+ {
743
+ language_code: 'chr',
744
+ language_name: 'Cherokee',
745
+ },
746
+ {
747
+ language_code: 'ny',
748
+ language_name: 'Chichewa',
749
+ },
750
+ {
751
+ language_code: 'zh-cn',
752
+ language_name: 'Chinese (Simplified)',
753
+ },
754
+ {
755
+ language_code: 'zh-tw',
756
+ language_name: 'Chinese (Traditional)',
757
+ },
758
+ {
759
+ language_code: 'co',
760
+ language_name: 'Corsican',
761
+ },
762
+ {
763
+ language_code: 'hr',
764
+ language_name: 'Croatian',
765
+ },
766
+ {
767
+ language_code: 'cs',
768
+ language_name: 'Czech',
769
+ },
770
+ {
771
+ language_code: 'da',
772
+ language_name: 'Danish',
773
+ },
774
+ {
775
+ language_code: 'nl',
776
+ language_name: 'Dutch',
777
+ },
778
+ {
779
+ language_code: 'xx-elmer',
780
+ language_name: 'Elmer Fudd',
781
+ },
782
+ {
783
+ language_code: 'en',
784
+ language_name: 'English',
785
+ },
786
+ {
787
+ language_code: 'eo',
788
+ language_name: 'Esperanto',
789
+ },
790
+ {
791
+ language_code: 'et',
792
+ language_name: 'Estonian',
793
+ },
794
+ {
795
+ language_code: 'ee',
796
+ language_name: 'Ewe',
797
+ },
798
+ {
799
+ language_code: 'fo',
800
+ language_name: 'Faroese',
801
+ },
802
+ {
803
+ language_code: 'tl',
804
+ language_name: 'Filipino',
805
+ },
806
+ {
807
+ language_code: 'fi',
808
+ language_name: 'Finnish',
809
+ },
810
+ {
811
+ language_code: 'fr',
812
+ language_name: 'French',
813
+ },
814
+ {
815
+ language_code: 'fy',
816
+ language_name: 'Frisian',
817
+ },
818
+ {
819
+ language_code: 'gaa',
820
+ language_name: 'Ga',
821
+ },
822
+ {
823
+ language_code: 'gl',
824
+ language_name: 'Galician',
825
+ },
826
+ {
827
+ language_code: 'ka',
828
+ language_name: 'Georgian',
829
+ },
830
+ {
831
+ language_code: 'de',
832
+ language_name: 'German',
833
+ },
834
+ {
835
+ language_code: 'el',
836
+ language_name: 'Greek',
837
+ },
838
+ {
839
+ language_code: 'kl',
840
+ language_name: 'Greenlandic',
841
+ },
842
+ {
843
+ language_code: 'gn',
844
+ language_name: 'Guarani',
845
+ },
846
+ {
847
+ language_code: 'gu',
848
+ language_name: 'Gujarati',
849
+ },
850
+ {
851
+ language_code: 'xx-hacker',
852
+ language_name: 'Hacker',
853
+ },
854
+ {
855
+ language_code: 'ht',
856
+ language_name: 'Haitian Creole',
857
+ },
858
+ {
859
+ language_code: 'ha',
860
+ language_name: 'Hausa',
861
+ },
862
+ {
863
+ language_code: 'haw',
864
+ language_name: 'Hawaiian',
865
+ },
866
+ {
867
+ language_code: 'iw',
868
+ language_name: 'Hebrew',
869
+ },
870
+ {
871
+ language_code: 'hi',
872
+ language_name: 'Hindi',
873
+ },
874
+ {
875
+ language_code: 'hu',
876
+ language_name: 'Hungarian',
877
+ },
878
+ {
879
+ language_code: 'is',
880
+ language_name: 'Icelandic',
881
+ },
882
+ {
883
+ language_code: 'ig',
884
+ language_name: 'Igbo',
885
+ },
886
+ {
887
+ language_code: 'id',
888
+ language_name: 'Indonesian',
889
+ },
890
+ {
891
+ language_code: 'ia',
892
+ language_name: 'Interlingua',
893
+ },
894
+ {
895
+ language_code: 'ga',
896
+ language_name: 'Irish',
897
+ },
898
+ {
899
+ language_code: 'it',
900
+ language_name: 'Italian',
901
+ },
902
+ {
903
+ language_code: 'ja',
904
+ language_name: 'Japanese',
905
+ },
906
+ {
907
+ language_code: 'jw',
908
+ language_name: 'Javanese',
909
+ },
910
+ {
911
+ language_code: 'kn',
912
+ language_name: 'Kannada',
913
+ },
914
+ {
915
+ language_code: 'kk',
916
+ language_name: 'Kazakh',
917
+ },
918
+ {
919
+ language_code: 'rw',
920
+ language_name: 'Kinyarwanda',
921
+ },
922
+ {
923
+ language_code: 'rn',
924
+ language_name: 'Kirundi',
925
+ },
926
+ {
927
+ language_code: 'xx-klingon',
928
+ language_name: 'Klingon',
929
+ },
930
+ {
931
+ language_code: 'kg',
932
+ language_name: 'Kongo',
933
+ },
934
+ {
935
+ language_code: 'ko',
936
+ language_name: 'Korean',
937
+ },
938
+ {
939
+ language_code: 'kri',
940
+ language_name: 'Krio (Sierra Leone)',
941
+ },
942
+ {
943
+ language_code: 'ku',
944
+ language_name: 'Kurdish',
945
+ },
946
+ {
947
+ language_code: 'ckb',
948
+ language_name: 'Kurdish (Soranî)',
949
+ },
950
+ {
951
+ language_code: 'ky',
952
+ language_name: 'Kyrgyz',
953
+ },
954
+ {
955
+ language_code: 'lo',
956
+ language_name: 'Laothian',
957
+ },
958
+ {
959
+ language_code: 'la',
960
+ language_name: 'Latin',
961
+ },
962
+ {
963
+ language_code: 'lv',
964
+ language_name: 'Latvian',
965
+ },
966
+ {
967
+ language_code: 'ln',
968
+ language_name: 'Lingala',
969
+ },
970
+ {
971
+ language_code: 'lt',
972
+ language_name: 'Lithuanian',
973
+ },
974
+ {
975
+ language_code: 'loz',
976
+ language_name: 'Lozi',
977
+ },
978
+ {
979
+ language_code: 'lg',
980
+ language_name: 'Luganda',
981
+ },
982
+ {
983
+ language_code: 'ach',
984
+ language_name: 'Luo',
985
+ },
986
+ {
987
+ language_code: 'mk',
988
+ language_name: 'Macedonian',
989
+ },
990
+ {
991
+ language_code: 'mg',
992
+ language_name: 'Malagasy',
993
+ },
994
+ {
995
+ language_code: 'ms',
996
+ language_name: 'Malay',
997
+ },
998
+ {
999
+ language_code: 'ml',
1000
+ language_name: 'Malayalam',
1001
+ },
1002
+ {
1003
+ language_code: 'mt',
1004
+ language_name: 'Maltese',
1005
+ },
1006
+ {
1007
+ language_code: 'mv',
1008
+ language_name: 'Maldives',
1009
+ },
1010
+ {
1011
+ language_code: 'mi',
1012
+ language_name: 'Maori',
1013
+ },
1014
+ {
1015
+ language_code: 'mr',
1016
+ language_name: 'Marathi',
1017
+ },
1018
+ {
1019
+ language_code: 'mfe',
1020
+ language_name: 'Mauritian Creole',
1021
+ },
1022
+ {
1023
+ language_code: 'mo',
1024
+ language_name: 'Moldavian',
1025
+ },
1026
+ {
1027
+ language_code: 'mn',
1028
+ language_name: 'Mongolian',
1029
+ },
1030
+ {
1031
+ language_code: 'sr-me',
1032
+ language_name: 'Montenegrin',
1033
+ },
1034
+ {
1035
+ language_code: 'my',
1036
+ language_name: 'Myanmar',
1037
+ },
1038
+ {
1039
+ language_code: 'ne',
1040
+ language_name: 'Nepali',
1041
+ },
1042
+ {
1043
+ language_code: 'pcm',
1044
+ language_name: 'Nigerian Pidgin',
1045
+ },
1046
+ {
1047
+ language_code: 'nso',
1048
+ language_name: 'Northern Sotho',
1049
+ },
1050
+ {
1051
+ language_code: 'no',
1052
+ language_name: 'Norwegian',
1053
+ },
1054
+ {
1055
+ language_code: 'nn',
1056
+ language_name: 'Norwegian (Nynorsk)',
1057
+ },
1058
+ {
1059
+ language_code: 'oc',
1060
+ language_name: 'Occitan',
1061
+ },
1062
+ {
1063
+ language_code: 'or',
1064
+ language_name: 'Oriya',
1065
+ },
1066
+ {
1067
+ language_code: 'om',
1068
+ language_name: 'Oromo',
1069
+ },
1070
+ {
1071
+ language_code: 'ps',
1072
+ language_name: 'Pashto',
1073
+ },
1074
+ {
1075
+ language_code: 'fa',
1076
+ language_name: 'Persian',
1077
+ },
1078
+ {
1079
+ language_code: 'xx-pirate',
1080
+ language_name: 'Pirate',
1081
+ },
1082
+ {
1083
+ language_code: 'pl',
1084
+ language_name: 'Polish',
1085
+ },
1086
+ {
1087
+ language_code: 'pt',
1088
+ language_name: 'Portuguese',
1089
+ },
1090
+ {
1091
+ language_code: 'pt-br',
1092
+ language_name: 'Portuguese (Brazil)',
1093
+ },
1094
+ {
1095
+ language_code: 'pt-pt',
1096
+ language_name: 'Portuguese (Portugal)',
1097
+ },
1098
+ {
1099
+ language_code: 'pa',
1100
+ language_name: 'Punjabi',
1101
+ },
1102
+ {
1103
+ language_code: 'qu',
1104
+ language_name: 'Quechua',
1105
+ },
1106
+ {
1107
+ language_code: 'ro',
1108
+ language_name: 'Romanian',
1109
+ },
1110
+ {
1111
+ language_code: 'rm',
1112
+ language_name: 'Romansh',
1113
+ },
1114
+ {
1115
+ language_code: 'nyn',
1116
+ language_name: 'Runyakitara',
1117
+ },
1118
+ {
1119
+ language_code: 'ru',
1120
+ language_name: 'Russian',
1121
+ },
1122
+ {
1123
+ language_code: 'gd',
1124
+ language_name: 'Scots Gaelic',
1125
+ },
1126
+ {
1127
+ language_code: 'sr',
1128
+ language_name: 'Serbian',
1129
+ },
1130
+ {
1131
+ language_code: 'sh',
1132
+ language_name: 'Serbo-Croatian',
1133
+ },
1134
+ {
1135
+ language_code: 'st',
1136
+ language_name: 'Sesotho',
1137
+ },
1138
+ {
1139
+ language_code: 'tn',
1140
+ language_name: 'Setswana',
1141
+ },
1142
+ {
1143
+ language_code: 'crs',
1144
+ language_name: 'Seychellois Creole',
1145
+ },
1146
+ {
1147
+ language_code: 'sn',
1148
+ language_name: 'Shona',
1149
+ },
1150
+ {
1151
+ language_code: 'sd',
1152
+ language_name: 'Sindhi',
1153
+ },
1154
+ {
1155
+ language_code: 'si',
1156
+ language_name: 'Sinhalese',
1157
+ },
1158
+ {
1159
+ language_code: 'sk',
1160
+ language_name: 'Slovak',
1161
+ },
1162
+ {
1163
+ language_code: 'sl',
1164
+ language_name: 'Slovenian',
1165
+ },
1166
+ {
1167
+ language_code: 'so',
1168
+ language_name: 'Somali',
1169
+ },
1170
+ {
1171
+ language_code: 'es',
1172
+ language_name: 'Spanish',
1173
+ },
1174
+ {
1175
+ language_code: 'es-419',
1176
+ language_name: 'Spanish (Latin American)',
1177
+ },
1178
+ {
1179
+ language_code: 'su',
1180
+ language_name: 'Sundanese',
1181
+ },
1182
+ {
1183
+ language_code: 'sw',
1184
+ language_name: 'Swahili',
1185
+ },
1186
+ {
1187
+ language_code: 'sv',
1188
+ language_name: 'Swedish',
1189
+ },
1190
+ {
1191
+ language_code: 'tg',
1192
+ language_name: 'Tajik',
1193
+ },
1194
+ {
1195
+ language_code: 'ta',
1196
+ language_name: 'Tamil',
1197
+ },
1198
+ {
1199
+ language_code: 'tt',
1200
+ language_name: 'Tatar',
1201
+ },
1202
+ {
1203
+ language_code: 'te',
1204
+ language_name: 'Telugu',
1205
+ },
1206
+ {
1207
+ language_code: 'th',
1208
+ language_name: 'Thai',
1209
+ },
1210
+ {
1211
+ language_code: 'ti',
1212
+ language_name: 'Tigrinya',
1213
+ },
1214
+ {
1215
+ language_code: 'to',
1216
+ language_name: 'Tonga',
1217
+ },
1218
+ {
1219
+ language_code: 'lua',
1220
+ language_name: 'Tshiluba',
1221
+ },
1222
+ {
1223
+ language_code: 'tum',
1224
+ language_name: 'Tumbuka',
1225
+ },
1226
+ {
1227
+ language_code: 'tr',
1228
+ language_name: 'Turkish',
1229
+ },
1230
+ {
1231
+ language_code: 'tk',
1232
+ language_name: 'Turkmen',
1233
+ },
1234
+ {
1235
+ language_code: 'tw',
1236
+ language_name: 'Twi',
1237
+ },
1238
+ {
1239
+ language_code: 'ug',
1240
+ language_name: 'Uighur',
1241
+ },
1242
+ {
1243
+ language_code: 'uk',
1244
+ language_name: 'Ukrainian',
1245
+ },
1246
+ {
1247
+ language_code: 'ur',
1248
+ language_name: 'Urdu',
1249
+ },
1250
+ {
1251
+ language_code: 'uz',
1252
+ language_name: 'Uzbek',
1253
+ },
1254
+ {
1255
+ language_code: 'vu',
1256
+ language_name: 'Vanuatu',
1257
+ },
1258
+ {
1259
+ language_code: 'vi',
1260
+ language_name: 'Vietnamese',
1261
+ },
1262
+ {
1263
+ language_code: 'cy',
1264
+ language_name: 'Welsh',
1265
+ },
1266
+ {
1267
+ language_code: 'wo',
1268
+ language_name: 'Wolof',
1269
+ },
1270
+ {
1271
+ language_code: 'xh',
1272
+ language_name: 'Xhosa',
1273
+ },
1274
+ {
1275
+ language_code: 'yi',
1276
+ language_name: 'Yiddish',
1277
+ },
1278
+ {
1279
+ language_code: 'yo',
1280
+ language_name: 'Yoruba',
1281
+ },
1282
+ {
1283
+ language_code: 'zu',
1284
+ language_name: 'Zulu',
1285
+ },
1286
+ ].map((x) => ({ label: x.language_name, value: x.language_code }));
1287
+ export const GoogleCountryOptions = [
1288
+ {
1289
+ country_code: 'af',
1290
+ country_name: 'Afghanistan',
1291
+ },
1292
+ {
1293
+ country_code: 'al',
1294
+ country_name: 'Albania',
1295
+ },
1296
+ {
1297
+ country_code: 'dz',
1298
+ country_name: 'Algeria',
1299
+ },
1300
+ {
1301
+ country_code: 'as',
1302
+ country_name: 'American Samoa',
1303
+ },
1304
+ {
1305
+ country_code: 'ad',
1306
+ country_name: 'Andorra',
1307
+ },
1308
+ {
1309
+ country_code: 'ao',
1310
+ country_name: 'Angola',
1311
+ },
1312
+ {
1313
+ country_code: 'ai',
1314
+ country_name: 'Anguilla',
1315
+ },
1316
+ {
1317
+ country_code: 'aq',
1318
+ country_name: 'Antarctica',
1319
+ },
1320
+ {
1321
+ country_code: 'ag',
1322
+ country_name: 'Antigua and Barbuda',
1323
+ },
1324
+ {
1325
+ country_code: 'ar',
1326
+ country_name: 'Argentina',
1327
+ },
1328
+ {
1329
+ country_code: 'am',
1330
+ country_name: 'Armenia',
1331
+ },
1332
+ {
1333
+ country_code: 'aw',
1334
+ country_name: 'Aruba',
1335
+ },
1336
+ {
1337
+ country_code: 'au',
1338
+ country_name: 'Australia',
1339
+ },
1340
+ {
1341
+ country_code: 'at',
1342
+ country_name: 'Austria',
1343
+ },
1344
+ {
1345
+ country_code: 'az',
1346
+ country_name: 'Azerbaijan',
1347
+ },
1348
+ {
1349
+ country_code: 'bs',
1350
+ country_name: 'Bahamas',
1351
+ },
1352
+ {
1353
+ country_code: 'bh',
1354
+ country_name: 'Bahrain',
1355
+ },
1356
+ {
1357
+ country_code: 'bd',
1358
+ country_name: 'Bangladesh',
1359
+ },
1360
+ {
1361
+ country_code: 'bb',
1362
+ country_name: 'Barbados',
1363
+ },
1364
+ {
1365
+ country_code: 'by',
1366
+ country_name: 'Belarus',
1367
+ },
1368
+ {
1369
+ country_code: 'be',
1370
+ country_name: 'Belgium',
1371
+ },
1372
+ {
1373
+ country_code: 'bz',
1374
+ country_name: 'Belize',
1375
+ },
1376
+ {
1377
+ country_code: 'bj',
1378
+ country_name: 'Benin',
1379
+ },
1380
+ {
1381
+ country_code: 'bm',
1382
+ country_name: 'Bermuda',
1383
+ },
1384
+ {
1385
+ country_code: 'bt',
1386
+ country_name: 'Bhutan',
1387
+ },
1388
+ {
1389
+ country_code: 'bo',
1390
+ country_name: 'Bolivia',
1391
+ },
1392
+ {
1393
+ country_code: 'ba',
1394
+ country_name: 'Bosnia and Herzegovina',
1395
+ },
1396
+ {
1397
+ country_code: 'bw',
1398
+ country_name: 'Botswana',
1399
+ },
1400
+ {
1401
+ country_code: 'bv',
1402
+ country_name: 'Bouvet Island',
1403
+ },
1404
+ {
1405
+ country_code: 'br',
1406
+ country_name: 'Brazil',
1407
+ },
1408
+ {
1409
+ country_code: 'io',
1410
+ country_name: 'British Indian Ocean Territory',
1411
+ },
1412
+ {
1413
+ country_code: 'bn',
1414
+ country_name: 'Brunei Darussalam',
1415
+ },
1416
+ {
1417
+ country_code: 'bg',
1418
+ country_name: 'Bulgaria',
1419
+ },
1420
+ {
1421
+ country_code: 'bf',
1422
+ country_name: 'Burkina Faso',
1423
+ },
1424
+ {
1425
+ country_code: 'bi',
1426
+ country_name: 'Burundi',
1427
+ },
1428
+ {
1429
+ country_code: 'kh',
1430
+ country_name: 'Cambodia',
1431
+ },
1432
+ {
1433
+ country_code: 'cm',
1434
+ country_name: 'Cameroon',
1435
+ },
1436
+ {
1437
+ country_code: 'ca',
1438
+ country_name: 'Canada',
1439
+ },
1440
+ {
1441
+ country_code: 'cv',
1442
+ country_name: 'Cape Verde',
1443
+ },
1444
+ {
1445
+ country_code: 'ky',
1446
+ country_name: 'Cayman Islands',
1447
+ },
1448
+ {
1449
+ country_code: 'cf',
1450
+ country_name: 'Central African Republic',
1451
+ },
1452
+ {
1453
+ country_code: 'td',
1454
+ country_name: 'Chad',
1455
+ },
1456
+ {
1457
+ country_code: 'cl',
1458
+ country_name: 'Chile',
1459
+ },
1460
+ {
1461
+ country_code: 'cn',
1462
+ country_name: 'China',
1463
+ },
1464
+ {
1465
+ country_code: 'cx',
1466
+ country_name: 'Christmas Island',
1467
+ },
1468
+ {
1469
+ country_code: 'cc',
1470
+ country_name: 'Cocos (Keeling) Islands',
1471
+ },
1472
+ {
1473
+ country_code: 'co',
1474
+ country_name: 'Colombia',
1475
+ },
1476
+ {
1477
+ country_code: 'km',
1478
+ country_name: 'Comoros',
1479
+ },
1480
+ {
1481
+ country_code: 'cg',
1482
+ country_name: 'Congo',
1483
+ },
1484
+ {
1485
+ country_code: 'cd',
1486
+ country_name: 'Congo, the Democratic Republic of the',
1487
+ },
1488
+ {
1489
+ country_code: 'ck',
1490
+ country_name: 'Cook Islands',
1491
+ },
1492
+ {
1493
+ country_code: 'cr',
1494
+ country_name: 'Costa Rica',
1495
+ },
1496
+ {
1497
+ country_code: 'ci',
1498
+ country_name: "Cote D'ivoire",
1499
+ },
1500
+ {
1501
+ country_code: 'hr',
1502
+ country_name: 'Croatia',
1503
+ },
1504
+ {
1505
+ country_code: 'cu',
1506
+ country_name: 'Cuba',
1507
+ },
1508
+ {
1509
+ country_code: 'cy',
1510
+ country_name: 'Cyprus',
1511
+ },
1512
+ {
1513
+ country_code: 'cz',
1514
+ country_name: 'Czech Republic',
1515
+ },
1516
+ {
1517
+ country_code: 'dk',
1518
+ country_name: 'Denmark',
1519
+ },
1520
+ {
1521
+ country_code: 'dj',
1522
+ country_name: 'Djibouti',
1523
+ },
1524
+ {
1525
+ country_code: 'dm',
1526
+ country_name: 'Dominica',
1527
+ },
1528
+ {
1529
+ country_code: 'do',
1530
+ country_name: 'Dominican Republic',
1531
+ },
1532
+ {
1533
+ country_code: 'ec',
1534
+ country_name: 'Ecuador',
1535
+ },
1536
+ {
1537
+ country_code: 'eg',
1538
+ country_name: 'Egypt',
1539
+ },
1540
+ {
1541
+ country_code: 'sv',
1542
+ country_name: 'El Salvador',
1543
+ },
1544
+ {
1545
+ country_code: 'gq',
1546
+ country_name: 'Equatorial Guinea',
1547
+ },
1548
+ {
1549
+ country_code: 'er',
1550
+ country_name: 'Eritrea',
1551
+ },
1552
+ {
1553
+ country_code: 'ee',
1554
+ country_name: 'Estonia',
1555
+ },
1556
+ {
1557
+ country_code: 'et',
1558
+ country_name: 'Ethiopia',
1559
+ },
1560
+ {
1561
+ country_code: 'fk',
1562
+ country_name: 'Falkland Islands (Malvinas)',
1563
+ },
1564
+ {
1565
+ country_code: 'fo',
1566
+ country_name: 'Faroe Islands',
1567
+ },
1568
+ {
1569
+ country_code: 'fj',
1570
+ country_name: 'Fiji',
1571
+ },
1572
+ {
1573
+ country_code: 'fi',
1574
+ country_name: 'Finland',
1575
+ },
1576
+ {
1577
+ country_code: 'fr',
1578
+ country_name: 'France',
1579
+ },
1580
+ {
1581
+ country_code: 'gf',
1582
+ country_name: 'French Guiana',
1583
+ },
1584
+ {
1585
+ country_code: 'pf',
1586
+ country_name: 'French Polynesia',
1587
+ },
1588
+ {
1589
+ country_code: 'tf',
1590
+ country_name: 'French Southern Territories',
1591
+ },
1592
+ {
1593
+ country_code: 'ga',
1594
+ country_name: 'Gabon',
1595
+ },
1596
+ {
1597
+ country_code: 'gm',
1598
+ country_name: 'Gambia',
1599
+ },
1600
+ {
1601
+ country_code: 'ge',
1602
+ country_name: 'Georgia',
1603
+ },
1604
+ {
1605
+ country_code: 'de',
1606
+ country_name: 'Germany',
1607
+ },
1608
+ {
1609
+ country_code: 'gh',
1610
+ country_name: 'Ghana',
1611
+ },
1612
+ {
1613
+ country_code: 'gi',
1614
+ country_name: 'Gibraltar',
1615
+ },
1616
+ {
1617
+ country_code: 'gr',
1618
+ country_name: 'Greece',
1619
+ },
1620
+ {
1621
+ country_code: 'gl',
1622
+ country_name: 'Greenland',
1623
+ },
1624
+ {
1625
+ country_code: 'gd',
1626
+ country_name: 'Grenada',
1627
+ },
1628
+ {
1629
+ country_code: 'gp',
1630
+ country_name: 'Guadeloupe',
1631
+ },
1632
+ {
1633
+ country_code: 'gu',
1634
+ country_name: 'Guam',
1635
+ },
1636
+ {
1637
+ country_code: 'gt',
1638
+ country_name: 'Guatemala',
1639
+ },
1640
+ {
1641
+ country_code: 'gn',
1642
+ country_name: 'Guinea',
1643
+ },
1644
+ {
1645
+ country_code: 'gw',
1646
+ country_name: 'Guinea-Bissau',
1647
+ },
1648
+ {
1649
+ country_code: 'gy',
1650
+ country_name: 'Guyana',
1651
+ },
1652
+ {
1653
+ country_code: 'ht',
1654
+ country_name: 'Haiti',
1655
+ },
1656
+ {
1657
+ country_code: 'hm',
1658
+ country_name: 'Heard Island and Mcdonald Islands',
1659
+ },
1660
+ {
1661
+ country_code: 'va',
1662
+ country_name: 'Holy See (Vatican City State)',
1663
+ },
1664
+ {
1665
+ country_code: 'hn',
1666
+ country_name: 'Honduras',
1667
+ },
1668
+ {
1669
+ country_code: 'hk',
1670
+ country_name: 'Hong Kong',
1671
+ },
1672
+ {
1673
+ country_code: 'hu',
1674
+ country_name: 'Hungary',
1675
+ },
1676
+ {
1677
+ country_code: 'is',
1678
+ country_name: 'Iceland',
1679
+ },
1680
+ {
1681
+ country_code: 'in',
1682
+ country_name: 'India',
1683
+ },
1684
+ {
1685
+ country_code: 'id',
1686
+ country_name: 'Indonesia',
1687
+ },
1688
+ {
1689
+ country_code: 'ir',
1690
+ country_name: 'Iran, Islamic Republic of',
1691
+ },
1692
+ {
1693
+ country_code: 'iq',
1694
+ country_name: 'Iraq',
1695
+ },
1696
+ {
1697
+ country_code: 'ie',
1698
+ country_name: 'Ireland',
1699
+ },
1700
+ {
1701
+ country_code: 'il',
1702
+ country_name: 'Israel',
1703
+ },
1704
+ {
1705
+ country_code: 'it',
1706
+ country_name: 'Italy',
1707
+ },
1708
+ {
1709
+ country_code: 'jm',
1710
+ country_name: 'Jamaica',
1711
+ },
1712
+ {
1713
+ country_code: 'jp',
1714
+ country_name: 'Japan',
1715
+ },
1716
+ {
1717
+ country_code: 'jo',
1718
+ country_name: 'Jordan',
1719
+ },
1720
+ {
1721
+ country_code: 'kz',
1722
+ country_name: 'Kazakhstan',
1723
+ },
1724
+ {
1725
+ country_code: 'ke',
1726
+ country_name: 'Kenya',
1727
+ },
1728
+ {
1729
+ country_code: 'ki',
1730
+ country_name: 'Kiribati',
1731
+ },
1732
+ {
1733
+ country_code: 'kp',
1734
+ country_name: "Korea, Democratic People's Republic of",
1735
+ },
1736
+ {
1737
+ country_code: 'kr',
1738
+ country_name: 'Korea, Republic of',
1739
+ },
1740
+ {
1741
+ country_code: 'kw',
1742
+ country_name: 'Kuwait',
1743
+ },
1744
+ {
1745
+ country_code: 'kg',
1746
+ country_name: 'Kyrgyzstan',
1747
+ },
1748
+ {
1749
+ country_code: 'la',
1750
+ country_name: "Lao People's Democratic Republic",
1751
+ },
1752
+ {
1753
+ country_code: 'lv',
1754
+ country_name: 'Latvia',
1755
+ },
1756
+ {
1757
+ country_code: 'lb',
1758
+ country_name: 'Lebanon',
1759
+ },
1760
+ {
1761
+ country_code: 'ls',
1762
+ country_name: 'Lesotho',
1763
+ },
1764
+ {
1765
+ country_code: 'lr',
1766
+ country_name: 'Liberia',
1767
+ },
1768
+ {
1769
+ country_code: 'ly',
1770
+ country_name: 'Libyan Arab Jamahiriya',
1771
+ },
1772
+ {
1773
+ country_code: 'li',
1774
+ country_name: 'Liechtenstein',
1775
+ },
1776
+ {
1777
+ country_code: 'lt',
1778
+ country_name: 'Lithuania',
1779
+ },
1780
+ {
1781
+ country_code: 'lu',
1782
+ country_name: 'Luxembourg',
1783
+ },
1784
+ {
1785
+ country_code: 'mo',
1786
+ country_name: 'Macao',
1787
+ },
1788
+ {
1789
+ country_code: 'mk',
1790
+ country_name: 'Macedonia, the Former Yugosalv Republic of',
1791
+ },
1792
+ {
1793
+ country_code: 'mg',
1794
+ country_name: 'Madagascar',
1795
+ },
1796
+ {
1797
+ country_code: 'mw',
1798
+ country_name: 'Malawi',
1799
+ },
1800
+ {
1801
+ country_code: 'my',
1802
+ country_name: 'Malaysia',
1803
+ },
1804
+ {
1805
+ country_code: 'mv',
1806
+ country_name: 'Maldives',
1807
+ },
1808
+ {
1809
+ country_code: 'ml',
1810
+ country_name: 'Mali',
1811
+ },
1812
+ {
1813
+ country_code: 'mt',
1814
+ country_name: 'Malta',
1815
+ },
1816
+ {
1817
+ country_code: 'mh',
1818
+ country_name: 'Marshall Islands',
1819
+ },
1820
+ {
1821
+ country_code: 'mq',
1822
+ country_name: 'Martinique',
1823
+ },
1824
+ {
1825
+ country_code: 'mr',
1826
+ country_name: 'Mauritania',
1827
+ },
1828
+ {
1829
+ country_code: 'mu',
1830
+ country_name: 'Mauritius',
1831
+ },
1832
+ {
1833
+ country_code: 'yt',
1834
+ country_name: 'Mayotte',
1835
+ },
1836
+ {
1837
+ country_code: 'mx',
1838
+ country_name: 'Mexico',
1839
+ },
1840
+ {
1841
+ country_code: 'fm',
1842
+ country_name: 'Micronesia, Federated States of',
1843
+ },
1844
+ {
1845
+ country_code: 'md',
1846
+ country_name: 'Moldova, Republic of',
1847
+ },
1848
+ {
1849
+ country_code: 'mc',
1850
+ country_name: 'Monaco',
1851
+ },
1852
+ {
1853
+ country_code: 'mn',
1854
+ country_name: 'Mongolia',
1855
+ },
1856
+ {
1857
+ country_code: 'ms',
1858
+ country_name: 'Montserrat',
1859
+ },
1860
+ {
1861
+ country_code: 'ma',
1862
+ country_name: 'Morocco',
1863
+ },
1864
+ {
1865
+ country_code: 'mz',
1866
+ country_name: 'Mozambique',
1867
+ },
1868
+ {
1869
+ country_code: 'mm',
1870
+ country_name: 'Myanmar',
1871
+ },
1872
+ {
1873
+ country_code: 'na',
1874
+ country_name: 'Namibia',
1875
+ },
1876
+ {
1877
+ country_code: 'nr',
1878
+ country_name: 'Nauru',
1879
+ },
1880
+ {
1881
+ country_code: 'np',
1882
+ country_name: 'Nepal',
1883
+ },
1884
+ {
1885
+ country_code: 'nl',
1886
+ country_name: 'Netherlands',
1887
+ },
1888
+ {
1889
+ country_code: 'an',
1890
+ country_name: 'Netherlands Antilles',
1891
+ },
1892
+ {
1893
+ country_code: 'nc',
1894
+ country_name: 'New Caledonia',
1895
+ },
1896
+ {
1897
+ country_code: 'nz',
1898
+ country_name: 'New Zealand',
1899
+ },
1900
+ {
1901
+ country_code: 'ni',
1902
+ country_name: 'Nicaragua',
1903
+ },
1904
+ {
1905
+ country_code: 'ne',
1906
+ country_name: 'Niger',
1907
+ },
1908
+ {
1909
+ country_code: 'ng',
1910
+ country_name: 'Nigeria',
1911
+ },
1912
+ {
1913
+ country_code: 'nu',
1914
+ country_name: 'Niue',
1915
+ },
1916
+ {
1917
+ country_code: 'nf',
1918
+ country_name: 'Norfolk Island',
1919
+ },
1920
+ {
1921
+ country_code: 'mp',
1922
+ country_name: 'Northern Mariana Islands',
1923
+ },
1924
+ {
1925
+ country_code: 'no',
1926
+ country_name: 'Norway',
1927
+ },
1928
+ {
1929
+ country_code: 'om',
1930
+ country_name: 'Oman',
1931
+ },
1932
+ {
1933
+ country_code: 'pk',
1934
+ country_name: 'Pakistan',
1935
+ },
1936
+ {
1937
+ country_code: 'pw',
1938
+ country_name: 'Palau',
1939
+ },
1940
+ {
1941
+ country_code: 'ps',
1942
+ country_name: 'Palestinian Territory, Occupied',
1943
+ },
1944
+ {
1945
+ country_code: 'pa',
1946
+ country_name: 'Panama',
1947
+ },
1948
+ {
1949
+ country_code: 'pg',
1950
+ country_name: 'Papua New Guinea',
1951
+ },
1952
+ {
1953
+ country_code: 'py',
1954
+ country_name: 'Paraguay',
1955
+ },
1956
+ {
1957
+ country_code: 'pe',
1958
+ country_name: 'Peru',
1959
+ },
1960
+ {
1961
+ country_code: 'ph',
1962
+ country_name: 'Philippines',
1963
+ },
1964
+ {
1965
+ country_code: 'pn',
1966
+ country_name: 'Pitcairn',
1967
+ },
1968
+ {
1969
+ country_code: 'pl',
1970
+ country_name: 'Poland',
1971
+ },
1972
+ {
1973
+ country_code: 'pt',
1974
+ country_name: 'Portugal',
1975
+ },
1976
+ {
1977
+ country_code: 'pr',
1978
+ country_name: 'Puerto Rico',
1979
+ },
1980
+ {
1981
+ country_code: 'qa',
1982
+ country_name: 'Qatar',
1983
+ },
1984
+ {
1985
+ country_code: 're',
1986
+ country_name: 'Reunion',
1987
+ },
1988
+ {
1989
+ country_code: 'ro',
1990
+ country_name: 'Romania',
1991
+ },
1992
+ {
1993
+ country_code: 'ru',
1994
+ country_name: 'Russian Federation',
1995
+ },
1996
+ {
1997
+ country_code: 'rw',
1998
+ country_name: 'Rwanda',
1999
+ },
2000
+ {
2001
+ country_code: 'sh',
2002
+ country_name: 'Saint Helena',
2003
+ },
2004
+ {
2005
+ country_code: 'kn',
2006
+ country_name: 'Saint Kitts and Nevis',
2007
+ },
2008
+ {
2009
+ country_code: 'lc',
2010
+ country_name: 'Saint Lucia',
2011
+ },
2012
+ {
2013
+ country_code: 'pm',
2014
+ country_name: 'Saint Pierre and Miquelon',
2015
+ },
2016
+ {
2017
+ country_code: 'vc',
2018
+ country_name: 'Saint Vincent and the Grenadines',
2019
+ },
2020
+ {
2021
+ country_code: 'ws',
2022
+ country_name: 'Samoa',
2023
+ },
2024
+ {
2025
+ country_code: 'sm',
2026
+ country_name: 'San Marino',
2027
+ },
2028
+ {
2029
+ country_code: 'st',
2030
+ country_name: 'Sao Tome and Principe',
2031
+ },
2032
+ {
2033
+ country_code: 'sa',
2034
+ country_name: 'Saudi Arabia',
2035
+ },
2036
+ {
2037
+ country_code: 'sn',
2038
+ country_name: 'Senegal',
2039
+ },
2040
+ {
2041
+ country_code: 'rs',
2042
+ country_name: 'Serbia and Montenegro',
2043
+ },
2044
+ {
2045
+ country_code: 'sc',
2046
+ country_name: 'Seychelles',
2047
+ },
2048
+ {
2049
+ country_code: 'sl',
2050
+ country_name: 'Sierra Leone',
2051
+ },
2052
+ {
2053
+ country_code: 'sg',
2054
+ country_name: 'Singapore',
2055
+ },
2056
+ {
2057
+ country_code: 'sk',
2058
+ country_name: 'Slovakia',
2059
+ },
2060
+ {
2061
+ country_code: 'si',
2062
+ country_name: 'Slovenia',
2063
+ },
2064
+ {
2065
+ country_code: 'sb',
2066
+ country_name: 'Solomon Islands',
2067
+ },
2068
+ {
2069
+ country_code: 'so',
2070
+ country_name: 'Somalia',
2071
+ },
2072
+ {
2073
+ country_code: 'za',
2074
+ country_name: 'South Africa',
2075
+ },
2076
+ {
2077
+ country_code: 'gs',
2078
+ country_name: 'South Georgia and the South Sandwich Islands',
2079
+ },
2080
+ {
2081
+ country_code: 'es',
2082
+ country_name: 'Spain',
2083
+ },
2084
+ {
2085
+ country_code: 'lk',
2086
+ country_name: 'Sri Lanka',
2087
+ },
2088
+ {
2089
+ country_code: 'sd',
2090
+ country_name: 'Sudan',
2091
+ },
2092
+ {
2093
+ country_code: 'sr',
2094
+ country_name: 'Suriname',
2095
+ },
2096
+ {
2097
+ country_code: 'sj',
2098
+ country_name: 'Svalbard and Jan Mayen',
2099
+ },
2100
+ {
2101
+ country_code: 'sz',
2102
+ country_name: 'Swaziland',
2103
+ },
2104
+ {
2105
+ country_code: 'se',
2106
+ country_name: 'Sweden',
2107
+ },
2108
+ {
2109
+ country_code: 'ch',
2110
+ country_name: 'Switzerland',
2111
+ },
2112
+ {
2113
+ country_code: 'sy',
2114
+ country_name: 'Syrian Arab Republic',
2115
+ },
2116
+ {
2117
+ country_code: 'tw',
2118
+ country_name: 'Taiwan, Province of China',
2119
+ },
2120
+ {
2121
+ country_code: 'tj',
2122
+ country_name: 'Tajikistan',
2123
+ },
2124
+ {
2125
+ country_code: 'tz',
2126
+ country_name: 'Tanzania, United Republic of',
2127
+ },
2128
+ {
2129
+ country_code: 'th',
2130
+ country_name: 'Thailand',
2131
+ },
2132
+ {
2133
+ country_code: 'tl',
2134
+ country_name: 'Timor-Leste',
2135
+ },
2136
+ {
2137
+ country_code: 'tg',
2138
+ country_name: 'Togo',
2139
+ },
2140
+ {
2141
+ country_code: 'tk',
2142
+ country_name: 'Tokelau',
2143
+ },
2144
+ {
2145
+ country_code: 'to',
2146
+ country_name: 'Tonga',
2147
+ },
2148
+ {
2149
+ country_code: 'tt',
2150
+ country_name: 'Trinidad and Tobago',
2151
+ },
2152
+ {
2153
+ country_code: 'tn',
2154
+ country_name: 'Tunisia',
2155
+ },
2156
+ {
2157
+ country_code: 'tr',
2158
+ country_name: 'Turkiye',
2159
+ },
2160
+ {
2161
+ country_code: 'tm',
2162
+ country_name: 'Turkmenistan',
2163
+ },
2164
+ {
2165
+ country_code: 'tc',
2166
+ country_name: 'Turks and Caicos Islands',
2167
+ },
2168
+ {
2169
+ country_code: 'tv',
2170
+ country_name: 'Tuvalu',
2171
+ },
2172
+ {
2173
+ country_code: 'ug',
2174
+ country_name: 'Uganda',
2175
+ },
2176
+ {
2177
+ country_code: 'ua',
2178
+ country_name: 'Ukraine',
2179
+ },
2180
+ {
2181
+ country_code: 'ae',
2182
+ country_name: 'United Arab Emirates',
2183
+ },
2184
+ {
2185
+ country_code: 'uk',
2186
+ country_name: 'United Kingdom',
2187
+ },
2188
+ {
2189
+ country_code: 'gb',
2190
+ country_name: 'United Kingdom',
2191
+ },
2192
+ {
2193
+ country_code: 'us',
2194
+ country_name: 'United States',
2195
+ },
2196
+ {
2197
+ country_code: 'um',
2198
+ country_name: 'United States Minor Outlying Islands',
2199
+ },
2200
+ {
2201
+ country_code: 'uy',
2202
+ country_name: 'Uruguay',
2203
+ },
2204
+ {
2205
+ country_code: 'uz',
2206
+ country_name: 'Uzbekistan',
2207
+ },
2208
+ {
2209
+ country_code: 'vu',
2210
+ country_name: 'Vanuatu',
2211
+ },
2212
+ {
2213
+ country_code: 've',
2214
+ country_name: 'Venezuela',
2215
+ },
2216
+ {
2217
+ country_code: 'vn',
2218
+ country_name: 'Viet Nam',
2219
+ },
2220
+ {
2221
+ country_code: 'vg',
2222
+ country_name: 'Virgin Islands, British',
2223
+ },
2224
+ {
2225
+ country_code: 'vi',
2226
+ country_name: 'Virgin Islands, U.S.',
2227
+ },
2228
+ {
2229
+ country_code: 'wf',
2230
+ country_name: 'Wallis and Futuna',
2231
+ },
2232
+ {
2233
+ country_code: 'eh',
2234
+ country_name: 'Western Sahara',
2235
+ },
2236
+ {
2237
+ country_code: 'ye',
2238
+ country_name: 'Yemen',
2239
+ },
2240
+ {
2241
+ country_code: 'zm',
2242
+ country_name: 'Zambia',
2243
+ },
2244
+ {
2245
+ country_code: 'zw',
2246
+ country_name: 'Zimbabwe',
2247
+ },
2248
+ ].map((x) => ({ label: x.country_name, value: x.country_code }));
2249
+
2250
+ export const BingCountryOptions = [
2251
+ { label: 'Argentina AR', value: 'AR' },
2252
+ { label: 'Australia AU', value: 'AU' },
2253
+ { label: 'Austria AT', value: 'AT' },
2254
+ { label: 'Belgium BE', value: 'BE' },
2255
+ { label: 'Brazil BR', value: 'BR' },
2256
+ { label: 'Canada CA', value: 'CA' },
2257
+ { label: 'Chile CL', value: 'CL' },
2258
+ { label: 'Denmark DK', value: 'DK' },
2259
+ { label: 'Finland FI', value: 'FI' },
2260
+ { label: 'France FR', value: 'FR' },
2261
+ { label: 'Germany DE', value: 'DE' },
2262
+ { label: 'Hong Kong SAR HK', value: 'HK' },
2263
+ { label: 'India IN', value: 'IN' },
2264
+ { label: 'Indonesia ID', value: 'ID' },
2265
+ { label: 'Italy IT', value: 'IT' },
2266
+ { label: 'Japan JP', value: 'JP' },
2267
+ { label: 'Korea KR', value: 'KR' },
2268
+ { label: 'Malaysia MY', value: 'MY' },
2269
+ { label: 'Mexico MX', value: 'MX' },
2270
+ { label: 'Netherlands NL', value: 'NL' },
2271
+ { label: 'New Zealand NZ', value: 'NZ' },
2272
+ { label: 'Norway NO', value: 'NO' },
2273
+ { label: "People's Republic of China CN", value: 'CN' },
2274
+ { label: 'Poland PL', value: 'PL' },
2275
+ { label: 'Portugal PT', value: 'PT' },
2276
+ { label: 'Republic of the Philippines PH', value: 'PH' },
2277
+ { label: 'Russia RU', value: 'RU' },
2278
+ { label: 'Saudi Arabia SA', value: 'SA' },
2279
+ { label: 'South Africa ZA', value: 'ZA' },
2280
+ { label: 'Spain ES', value: 'ES' },
2281
+ { label: 'Sweden SE', value: 'SE' },
2282
+ { label: 'Switzerland CH', value: 'CH' },
2283
+ { label: 'Taiwan TW', value: 'TW' },
2284
+ { label: 'Türkiye TR', value: 'TR' },
2285
+ { label: 'United Kingdom GB', value: 'GB' },
2286
+ { label: 'United States US', value: 'US' },
2287
+ ];
2288
+
2289
+ export const BingLanguageOptions = [
2290
+ { label: 'Arabic ar', value: 'ar' },
2291
+ { label: 'Basque eu', value: 'eu' },
2292
+ { label: 'Bengali bn', value: 'bn' },
2293
+ { label: 'Bulgarian bg', value: 'bg' },
2294
+ { label: 'Catalan ca', value: 'ca' },
2295
+ { label: 'Chinese (Simplified) zh-hans', value: 'ns' },
2296
+ { label: 'Chinese (Traditional) zh-hant', value: 'nt' },
2297
+ { label: 'Croatian hr', value: 'hr' },
2298
+ { label: 'Czech cs', value: 'cs' },
2299
+ { label: 'Danish da', value: 'da' },
2300
+ { label: 'Dutch nl', value: 'nl' },
2301
+ { label: 'English en', value: 'en' },
2302
+ { label: 'English-United Kingdom en-gb', value: 'gb' },
2303
+ { label: 'Estonian et', value: 'et' },
2304
+ { label: 'Finnish fi', value: 'fi' },
2305
+ { label: 'French fr', value: 'fr' },
2306
+ { label: 'Galician gl', value: 'gl' },
2307
+ { label: 'German de', value: 'de' },
2308
+ { label: 'Gujarati gu', value: 'gu' },
2309
+ { label: 'Hebrew he', value: 'he' },
2310
+ { label: 'Hindi hi', value: 'hi' },
2311
+ { label: 'Hungarian hu', value: 'hu' },
2312
+ { label: 'Icelandic is', value: 'is' },
2313
+ { label: 'Italian it', value: 'it' },
2314
+ { label: 'Japanese jp', value: 'jp' },
2315
+ { label: 'Kannada kn', value: 'kn' },
2316
+ { label: 'Korean ko', value: 'ko' },
2317
+ { label: 'Latvian lv', value: 'lv' },
2318
+ { label: 'Lithuanian lt', value: 'lt' },
2319
+ { label: 'Malay ms', value: 'ms' },
2320
+ { label: 'Malayalam ml', value: 'ml' },
2321
+ { label: 'Marathi mr', value: 'mr' },
2322
+ { label: 'Norwegian (Bokmål) nb', value: 'nb' },
2323
+ { label: 'Polish pl', value: 'pl' },
2324
+ { label: 'Portuguese (Brazil) pt-br', value: 'br' },
2325
+ { label: 'Portuguese (Portugal) pt-pt', value: 'pt' },
2326
+ { label: 'Punjabi pa', value: 'pa' },
2327
+ { label: 'Romanian ro', value: 'ro' },
2328
+ { label: 'Russian ru', value: 'ru' },
2329
+ { label: 'Serbian (Cyrylic) sr', value: 'sr' },
2330
+ { label: 'Slovak sk', value: 'sk' },
2331
+ { label: 'Slovenian sl', value: 'sl' },
2332
+ { label: 'Spanish es', value: 'es' },
2333
+ { label: 'Swedish sv', value: 'sv' },
2334
+ { label: 'Tamil ta', value: 'ta' },
2335
+ { label: 'Telugu te', value: 'te' },
2336
+ { label: 'Thai th', value: 'th' },
2337
+ { label: 'Turkish tr', value: 'tr' },
2338
+ { label: 'Ukrainian uk', value: 'uk' },
2339
+ { label: 'Vietnamese vi', value: 'vi' },
2340
+ ];
web/src/pages/flow/flow-drawer/index.tsx CHANGED
@@ -7,10 +7,12 @@ import AnswerForm from '../answer-form';
7
  import ArXivForm from '../arxiv-form';
8
  import BaiduForm from '../baidu-form';
9
  import BeginForm from '../begin-form';
 
10
  import CategorizeForm from '../categorize-form';
11
  import { Operator } from '../constant';
12
  import DuckDuckGoForm from '../duckduckgo-form';
13
  import GenerateForm from '../generate-form';
 
14
  import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks';
15
  import KeywordExtractForm from '../keyword-extract-form';
16
  import MessageForm from '../message-form';
@@ -42,6 +44,8 @@ const FormMap = {
42
  [Operator.Wikipedia]: WikipediaForm,
43
  [Operator.PubMed]: PubMedForm,
44
  [Operator.ArXiv]: ArXivForm,
 
 
45
  };
46
 
47
  const EmptyContent = () => <div>empty</div>;
 
7
  import ArXivForm from '../arxiv-form';
8
  import BaiduForm from '../baidu-form';
9
  import BeginForm from '../begin-form';
10
+ import BingForm from '../bing-form';
11
  import CategorizeForm from '../categorize-form';
12
  import { Operator } from '../constant';
13
  import DuckDuckGoForm from '../duckduckgo-form';
14
  import GenerateForm from '../generate-form';
15
+ import GoogleForm from '../google-form';
16
  import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks';
17
  import KeywordExtractForm from '../keyword-extract-form';
18
  import MessageForm from '../message-form';
 
44
  [Operator.Wikipedia]: WikipediaForm,
45
  [Operator.PubMed]: PubMedForm,
46
  [Operator.ArXiv]: ArXivForm,
47
+ [Operator.Google]: GoogleForm,
48
+ [Operator.Bing]: BingForm,
49
  };
50
 
51
  const EmptyContent = () => <div>empty</div>;
web/src/pages/flow/google-form/index.tsx ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import TopNItem from '@/components/top-n-item';
2
+ import { useTranslate } from '@/hooks/common-hooks';
3
+ import { Form, Input, Select } from 'antd';
4
+ import { GoogleCountryOptions, GoogleLanguageOptions } from '../constant';
5
+ import { IOperatorForm } from '../interface';
6
+
7
+ const GoogleForm = ({ onValuesChange, form }: IOperatorForm) => {
8
+ const { t } = useTranslate('flow');
9
+
10
+ return (
11
+ <Form
12
+ name="basic"
13
+ labelCol={{ span: 6 }}
14
+ wrapperCol={{ span: 18 }}
15
+ autoComplete="off"
16
+ form={form}
17
+ onValuesChange={onValuesChange}
18
+ >
19
+ <TopNItem initialValue={10}></TopNItem>
20
+ <Form.Item label={t('apiKey')} name={'api_key'}>
21
+ <Input></Input>
22
+ </Form.Item>
23
+ <Form.Item label={t('country')} name={'country'}>
24
+ <Select options={GoogleCountryOptions}></Select>
25
+ </Form.Item>
26
+ <Form.Item label={t('language')} name={'language'}>
27
+ <Select options={GoogleLanguageOptions}></Select>
28
+ </Form.Item>
29
+ </Form>
30
+ );
31
+ };
32
+
33
+ export default GoogleForm;
web/src/pages/flow/hooks.ts CHANGED
@@ -30,12 +30,14 @@ import {
30
  NodeMap,
31
  Operator,
32
  RestrictedUpstreamMap,
33
- initialArxivValues,
34
  initialBaiduValues,
35
  initialBeginValues,
 
36
  initialCategorizeValues,
37
  initialDuckValues,
38
  initialGenerateValues,
 
39
  initialKeywordExtractValues,
40
  initialMessageValues,
41
  initialPubMedValues,
@@ -92,7 +94,9 @@ export const useInitializeOperatorParams = () => {
92
  [Operator.Baidu]: initialBaiduValues,
93
  [Operator.Wikipedia]: initialWikipediaValues,
94
  [Operator.PubMed]: initialPubMedValues,
95
- [Operator.ArXiv]: initialArxivValues,
 
 
96
  };
97
  }, [llmId]);
98
 
 
30
  NodeMap,
31
  Operator,
32
  RestrictedUpstreamMap,
33
+ initialArXivValues,
34
  initialBaiduValues,
35
  initialBeginValues,
36
+ initialBingValues,
37
  initialCategorizeValues,
38
  initialDuckValues,
39
  initialGenerateValues,
40
+ initialGoogleValues,
41
  initialKeywordExtractValues,
42
  initialMessageValues,
43
  initialPubMedValues,
 
94
  [Operator.Baidu]: initialBaiduValues,
95
  [Operator.Wikipedia]: initialWikipediaValues,
96
  [Operator.PubMed]: initialPubMedValues,
97
+ [Operator.ArXiv]: initialArXivValues,
98
+ [Operator.Google]: initialGoogleValues,
99
+ [Operator.Bing]: initialBingValues,
100
  };
101
  }, [llmId]);
102