balibabu commited on
Commit
f2de30c
·
1 Parent(s): c54177d

feat: Add component Jin10 #1739 (#2563)

Browse files

### What problem does this PR solve?

feat: Add component Jin10 #1739

### Type of change

- [ ] Bug Fix (non-breaking change which fixes an issue)
- [x] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

web/src/assets/svg/jin10.svg ADDED
web/src/locales/en.ts CHANGED
@@ -910,11 +910,57 @@ The above is the content you need to summarize.`,
910
  akShareDescription:
911
  'This component can be used to obtain news information for the corresponding stock from the Eastmoney website.',
912
  yahooFinance: 'YahooFinance',
 
 
913
  info: 'Info',
914
  history: 'History',
915
  financials: 'Financials',
916
  balanceSheet: 'Balance sheet',
917
  cashFlowStatement: 'Cash flow statement',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
918
  },
919
  footer: {
920
  profile: 'All rights reserved @ React',
 
910
  akShareDescription:
911
  'This component can be used to obtain news information for the corresponding stock from the Eastmoney website.',
912
  yahooFinance: 'YahooFinance',
913
+ yahooFinanceDescription:
914
+ 'The component queries information about the company based on the provided ticker symbol.',
915
  info: 'Info',
916
  history: 'History',
917
  financials: 'Financials',
918
  balanceSheet: 'Balance sheet',
919
  cashFlowStatement: 'Cash flow statement',
920
+ jin10: 'Jin10',
921
+ jin10Description:
922
+ 'This component can be used to access information in the financial sector from the Jin10 Open Platform, including quick news, calendar, quotes, reference.',
923
+ flashType: 'Flash type',
924
+ filter: 'Filter',
925
+ contain: 'Contain',
926
+ calendarType: 'Calendar type',
927
+ calendarDatashape: 'Calendar datashape',
928
+ symbolsDatatype: 'Symbols datatype',
929
+ symbolsType: 'Symbols type',
930
+ jin10TypeOptions: {
931
+ flash: 'Quick News',
932
+ calendar: 'Calendar',
933
+ symbols: 'quotes',
934
+ news: 'reference',
935
+ },
936
+ jin10FlashTypeOptions: {
937
+ '1': 'Market News',
938
+ '2': ' Futures News',
939
+ '3': 'US-Hong Kong News',
940
+ '4': 'A-Share News',
941
+ '5': 'Commodities & Forex News',
942
+ },
943
+ jin10CalendarTypeOptions: {
944
+ cj: 'Macroeconomic Data Calendar',
945
+ qh: ' Futures Calendar',
946
+ hk: 'Hong Kong Stock Market Calendar',
947
+ us: 'US Stock Market Calendar',
948
+ },
949
+ jin10CalendarDatashapeOptions: {
950
+ data: 'Data',
951
+ event: ' Event',
952
+ holiday: 'Holiday',
953
+ },
954
+ jin10SymbolsTypeOptions: {
955
+ GOODS: 'Commodity Quotes',
956
+ FOREX: ' Forex Quotes',
957
+ FUTURE: 'International Market Quotes',
958
+ CRYPTO: 'Cryptocurrency Quotes',
959
+ },
960
+ jin10SymbolsDatatypeOptions: {
961
+ symbols: 'Commodity List',
962
+ quotes: ' Latest Market Quotes',
963
+ },
964
  },
965
  footer: {
966
  profile: 'All rights reserved @ React',
web/src/locales/zh-traditional.ts CHANGED
@@ -863,11 +863,56 @@ export default {
863
  akShare: 'AkShare',
864
  akShareDescription: '此組件可用於從東方財富網取得對應股票的新聞資訊。',
865
  yahooFinance: '雅虎財經',
 
866
  info: '訊息',
867
  history: '歷史',
868
  financials: '財務',
869
  balanceSheet: '資產負債表',
870
  cashFlowStatement: '現金流量表',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
871
  },
872
  footer: {
873
  profile: '“保留所有權利 @ react”',
 
863
  akShare: 'AkShare',
864
  akShareDescription: '此組件可用於從東方財富網取得對應股票的新聞資訊。',
865
  yahooFinance: '雅虎財經',
866
+ yahooFinanceDescription: '該組件根據提供的股票代碼查詢有關公司的資訊。',
867
  info: '訊息',
868
  history: '歷史',
869
  financials: '財務',
870
  balanceSheet: '資產負債表',
871
  cashFlowStatement: '現金流量表',
872
+ jin10: '金十',
873
+ jin10Description:
874
+ '此組件可用於從金十開放平台獲取金融領域的信息,包括快訊、日曆、行情、參考。 ',
875
+ flashType: '閃光類型',
876
+ filter: '篩選',
877
+ contain: '包含',
878
+ calendarType: '日曆類型',
879
+ calendarDatashape: '日曆資料形狀',
880
+ symbolsDatatype: '符號資料型別',
881
+ symbolsType: '符號類型',
882
+ jin10TypeOptions: {
883
+ flash: '快訊',
884
+ calendar: '日曆',
885
+ symbols: '行情',
886
+ news: '參考',
887
+ },
888
+ jin10FlashTypeOptions: {
889
+ '1': '市場快訊',
890
+ '2': '期貨快訊',
891
+ '3': '美港快訊',
892
+ '4': 'A股快訊',
893
+ '5': '商品外匯快訊',
894
+ },
895
+ jin10CalendarTypeOptions: {
896
+ cj: '宏觀資料日曆',
897
+ qh: '期貨日曆',
898
+ hk: '港股日曆',
899
+ us: '美股日曆',
900
+ },
901
+ jin10CalendarDatashapeOptions: {
902
+ data: '資料',
903
+ event: ' 事件',
904
+ holiday: '假期',
905
+ },
906
+ jin10SymbolsTypeOptions: {
907
+ GOODS: '商品行情',
908
+ FOREX: '外匯行情',
909
+ FUTURE: '國際行情',
910
+ CRYPTO: '加密貨幣行情',
911
+ },
912
+ jin10SymbolsDatatypeOptions: {
913
+ symbols: '品種列表',
914
+ quotes: '最新行情',
915
+ },
916
  },
917
  footer: {
918
  profile: '“保留所有權利 @ react”',
web/src/locales/zh.ts CHANGED
@@ -881,11 +881,56 @@ export default {
881
  akShare: 'AkShare',
882
  akShareDescription: '该组件可用于从东方财富网站获取相应股票的新闻信息。',
883
  yahooFinance: '雅虎财经',
 
884
  info: '信息',
885
  history: '历史',
886
  financials: '财务',
887
  balanceSheet: '资产负债表',
888
  cashFlowStatement: '现金流量表',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
  },
890
  footer: {
891
  profile: 'All rights reserved @ React',
 
881
  akShare: 'AkShare',
882
  akShareDescription: '该组件可用于从东方财富网站获取相应股票的新闻信息。',
883
  yahooFinance: '雅虎财经',
884
+ yahooFinanceDescription: '该组件根据提供的股票代码查询有关公司的信息。',
885
  info: '信息',
886
  history: '历史',
887
  financials: '财务',
888
  balanceSheet: '资产负债表',
889
  cashFlowStatement: '现金流量表',
890
+ jin10: '金十',
891
+ jin10Description:
892
+ '该组件可用于从金十开放平台获取金融领域的信息,包括快讯、日历、行情、参考。',
893
+ flashType: '闪光类型',
894
+ filter: '筛选',
895
+ contain: '包含',
896
+ calendarType: '日历类型',
897
+ calendarDatashape: '日历数据形状',
898
+ symbolsDatatype: '符号数据类型',
899
+ symbolsType: '符号类型',
900
+ jin10TypeOptions: {
901
+ flash: '快讯',
902
+ calendar: '日历',
903
+ symbols: '行情',
904
+ news: '参考',
905
+ },
906
+ jin10FlashTypeOptions: {
907
+ '1': '市场快讯',
908
+ '2': '期货快讯',
909
+ '3': '美港快讯',
910
+ '4': 'A股快讯',
911
+ '5': '商品外汇快讯',
912
+ },
913
+ jin10CalendarTypeOptions: {
914
+ cj: '宏观数据日历',
915
+ qh: '期货日历',
916
+ hk: '港股日历',
917
+ us: '美股日历',
918
+ },
919
+ jin10CalendarDatashapeOptions: {
920
+ data: '数据',
921
+ event: ' 事件',
922
+ holiday: '假期',
923
+ },
924
+ jin10SymbolsTypeOptions: {
925
+ GOODS: '商品行情',
926
+ FOREX: '外汇行情',
927
+ FUTURE: '国际行情',
928
+ CRYPTO: '加密货币行情',
929
+ },
930
+ jin10SymbolsDatatypeOptions: {
931
+ symbols: '品种列表',
932
+ quotes: '最新行情',
933
+ },
934
  },
935
  footer: {
936
  profile: 'All rights reserved @ React',
web/src/pages/flow/constant.tsx CHANGED
@@ -9,6 +9,7 @@ import { ReactComponent as ExeSqlIcon } from '@/assets/svg/exesql.svg';
9
  import { ReactComponent as GithubIcon } from '@/assets/svg/github.svg';
10
  import { ReactComponent as GoogleScholarIcon } from '@/assets/svg/google-scholar.svg';
11
  import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
 
12
  import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
13
  import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
14
  import { ReactComponent as QWeatherIcon } from '@/assets/svg/qweather.svg';
@@ -65,6 +66,7 @@ export enum Operator {
65
  WenCai = 'WenCai',
66
  AkShare = 'AkShare',
67
  YahooFinance = 'YahooFinance',
 
68
  }
69
 
70
  export const operatorIconMap = {
@@ -94,6 +96,7 @@ export const operatorIconMap = {
94
  [Operator.WenCai]: WenCaiIcon,
95
  [Operator.AkShare]: AkShareIcon,
96
  [Operator.YahooFinance]: YahooFinanceIcon,
 
97
  };
98
 
99
  export const operatorMap: Record<
@@ -206,6 +209,7 @@ export const operatorMap: Record<
206
  [Operator.WenCai]: { backgroundColor: '#faac5b' },
207
  [Operator.AkShare]: { backgroundColor: '#8085f5' },
208
  [Operator.YahooFinance]: { backgroundColor: '#b474ff' },
 
209
  };
210
 
211
  export const componentMenuList = [
@@ -284,6 +288,9 @@ export const componentMenuList = [
284
  {
285
  name: Operator.YahooFinance,
286
  },
 
 
 
287
  ];
288
 
289
  export const initialRetrievalValues = {
@@ -436,6 +443,14 @@ export const initialYahooFinanceValues = {
436
  news: true,
437
  };
438
 
 
 
 
 
 
 
 
 
439
  export const CategorizeAnchorPointPositions = [
440
  { top: 1, right: 34 },
441
  { top: 8, right: 18 },
@@ -509,6 +524,7 @@ export const RestrictedUpstreamMap = {
509
  [Operator.WenCai]: [Operator.Begin],
510
  [Operator.AkShare]: [Operator.Begin],
511
  [Operator.YahooFinance]: [Operator.Begin],
 
512
  };
513
 
514
  export const NodeMap = {
@@ -538,6 +554,7 @@ export const NodeMap = {
538
  [Operator.WenCai]: 'ragNode',
539
  [Operator.AkShare]: 'ragNode',
540
  [Operator.YahooFinance]: 'ragNode',
 
541
  };
542
 
543
  export const LanguageOptions = [
@@ -2706,3 +2723,12 @@ export const WenCaiQueryTypeOptions = [
2706
  'lccp',
2707
  'foreign_exchange',
2708
  ];
 
 
 
 
 
 
 
 
 
 
9
  import { ReactComponent as GithubIcon } from '@/assets/svg/github.svg';
10
  import { ReactComponent as GoogleScholarIcon } from '@/assets/svg/google-scholar.svg';
11
  import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
12
+ import { ReactComponent as Jin10Icon } from '@/assets/svg/jin10.svg';
13
  import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
14
  import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
15
  import { ReactComponent as QWeatherIcon } from '@/assets/svg/qweather.svg';
 
66
  WenCai = 'WenCai',
67
  AkShare = 'AkShare',
68
  YahooFinance = 'YahooFinance',
69
+ Jin10 = 'Jin10',
70
  }
71
 
72
  export const operatorIconMap = {
 
96
  [Operator.WenCai]: WenCaiIcon,
97
  [Operator.AkShare]: AkShareIcon,
98
  [Operator.YahooFinance]: YahooFinanceIcon,
99
+ [Operator.Jin10]: Jin10Icon,
100
  };
101
 
102
  export const operatorMap: Record<
 
209
  [Operator.WenCai]: { backgroundColor: '#faac5b' },
210
  [Operator.AkShare]: { backgroundColor: '#8085f5' },
211
  [Operator.YahooFinance]: { backgroundColor: '#b474ff' },
212
+ [Operator.Jin10]: { backgroundColor: '#a0b9f8' },
213
  };
214
 
215
  export const componentMenuList = [
 
288
  {
289
  name: Operator.YahooFinance,
290
  },
291
+ {
292
+ name: Operator.Jin10,
293
+ },
294
  ];
295
 
296
  export const initialRetrievalValues = {
 
443
  news: true,
444
  };
445
 
446
+ export const initialJin10Values = {
447
+ type: 'flash',
448
+ secret_key: 'xxx',
449
+ flash_type: '1',
450
+ contain: '',
451
+ filter: '',
452
+ };
453
+
454
  export const CategorizeAnchorPointPositions = [
455
  { top: 1, right: 34 },
456
  { top: 8, right: 18 },
 
524
  [Operator.WenCai]: [Operator.Begin],
525
  [Operator.AkShare]: [Operator.Begin],
526
  [Operator.YahooFinance]: [Operator.Begin],
527
+ [Operator.Jin10]: [Operator.Begin],
528
  };
529
 
530
  export const NodeMap = {
 
554
  [Operator.WenCai]: 'ragNode',
555
  [Operator.AkShare]: 'ragNode',
556
  [Operator.YahooFinance]: 'ragNode',
557
+ [Operator.Jin10]: 'ragNode',
558
  };
559
 
560
  export const LanguageOptions = [
 
2723
  'lccp',
2724
  'foreign_exchange',
2725
  ];
2726
+
2727
+ export const Jin10TypeOptions = ['flash', 'calendar', 'symbols', 'news'];
2728
+ export const Jin10FlashTypeOptions = new Array(5)
2729
+ .fill(1)
2730
+ .map((x, idx) => (idx + 1).toString());
2731
+ export const Jin10CalendarTypeOptions = ['cj', 'qh', 'hk', 'us'];
2732
+ export const Jin10CalendarDatashapeOptions = ['data', 'event', 'holiday'];
2733
+ export const Jin10SymbolsTypeOptions = ['GOODS', 'FOREX', 'FUTURE', 'CRYPTO'];
2734
+ export const Jin10SymbolsDatatypeOptions = ['symbols', 'quotes'];
web/src/pages/flow/flow-drawer/index.tsx CHANGED
@@ -32,6 +32,7 @@ import SwitchForm from '../switch-form';
32
  import WenCaiForm from '../wencai-form';
33
  import WikipediaForm from '../wikipedia-form';
34
 
 
35
  import YahooFinanceForm from '../yahoo-finance-form';
36
  import styles from './index.less';
37
 
@@ -66,6 +67,7 @@ const FormMap = {
66
  [Operator.WenCai]: WenCaiForm,
67
  [Operator.AkShare]: AkShareForm,
68
  [Operator.YahooFinance]: YahooFinanceForm,
 
69
  };
70
 
71
  const EmptyContent = () => <div>empty</div>;
 
32
  import WenCaiForm from '../wencai-form';
33
  import WikipediaForm from '../wikipedia-form';
34
 
35
+ import Jin10Form from '../jin10-form';
36
  import YahooFinanceForm from '../yahoo-finance-form';
37
  import styles from './index.less';
38
 
 
67
  [Operator.WenCai]: WenCaiForm,
68
  [Operator.AkShare]: AkShareForm,
69
  [Operator.YahooFinance]: YahooFinanceForm,
70
+ [Operator.Jin10]: Jin10Form,
71
  };
72
 
73
  const EmptyContent = () => <div>empty</div>;
web/src/pages/flow/hooks.ts CHANGED
@@ -45,6 +45,7 @@ import {
45
  initialGithubValues,
46
  initialGoogleScholarValues,
47
  initialGoogleValues,
 
48
  initialKeywordExtractValues,
49
  initialMessageValues,
50
  initialPubMedValues,
@@ -119,6 +120,7 @@ export const useInitializeOperatorParams = () => {
119
  [Operator.WenCai]: initialWenCaiValues,
120
  [Operator.AkShare]: initialAkShareValues,
121
  [Operator.YahooFinance]: initialYahooFinanceValues,
 
122
  };
123
  }, [llmId]);
124
 
 
45
  initialGithubValues,
46
  initialGoogleScholarValues,
47
  initialGoogleValues,
48
+ initialJin10Values,
49
  initialKeywordExtractValues,
50
  initialMessageValues,
51
  initialPubMedValues,
 
120
  [Operator.WenCai]: initialWenCaiValues,
121
  [Operator.AkShare]: initialAkShareValues,
122
  [Operator.YahooFinance]: initialYahooFinanceValues,
123
+ [Operator.Jin10]: initialJin10Values,
124
  };
125
  }, [llmId]);
126
 
web/src/pages/flow/jin10-form/index.tsx ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useTranslate } from '@/hooks/common-hooks';
2
+ import { Form, Input, Select } from 'antd';
3
+ import { useMemo } from 'react';
4
+ import {
5
+ Jin10CalendarDatashapeOptions,
6
+ Jin10CalendarTypeOptions,
7
+ Jin10FlashTypeOptions,
8
+ Jin10SymbolsDatatypeOptions,
9
+ Jin10SymbolsTypeOptions,
10
+ Jin10TypeOptions,
11
+ } from '../constant';
12
+ import { IOperatorForm } from '../interface';
13
+
14
+ const Jin10Form = ({ onValuesChange, form }: IOperatorForm) => {
15
+ const { t } = useTranslate('flow');
16
+
17
+ const jin10TypeOptions = useMemo(() => {
18
+ return Jin10TypeOptions.map((x) => ({
19
+ value: x,
20
+ label: t(`jin10TypeOptions.${x}`),
21
+ }));
22
+ }, [t]);
23
+
24
+ const jin10FlashTypeOptions = useMemo(() => {
25
+ return Jin10FlashTypeOptions.map((x) => ({
26
+ value: x,
27
+ label: t(`jin10FlashTypeOptions.${x}`),
28
+ }));
29
+ }, [t]);
30
+
31
+ const jin10CalendarTypeOptions = useMemo(() => {
32
+ return Jin10CalendarTypeOptions.map((x) => ({
33
+ value: x,
34
+ label: t(`jin10CalendarTypeOptions.${x}`),
35
+ }));
36
+ }, [t]);
37
+
38
+ const jin10CalendarDatashapeOptions = useMemo(() => {
39
+ return Jin10CalendarDatashapeOptions.map((x) => ({
40
+ value: x,
41
+ label: t(`jin10CalendarDatashapeOptions.${x}`),
42
+ }));
43
+ }, [t]);
44
+
45
+ const jin10SymbolsTypeOptions = useMemo(() => {
46
+ return Jin10SymbolsTypeOptions.map((x) => ({
47
+ value: x,
48
+ label: t(`jin10SymbolsTypeOptions.${x}`),
49
+ }));
50
+ }, [t]);
51
+
52
+ const jin10SymbolsDatatypeOptions = useMemo(() => {
53
+ return Jin10SymbolsDatatypeOptions.map((x) => ({
54
+ value: x,
55
+ label: t(`jin10SymbolsDatatypeOptions.${x}`),
56
+ }));
57
+ }, [t]);
58
+
59
+ return (
60
+ <Form
61
+ name="basic"
62
+ labelCol={{ span: 9 }}
63
+ wrapperCol={{ span: 15 }}
64
+ autoComplete="off"
65
+ form={form}
66
+ onValuesChange={onValuesChange}
67
+ >
68
+ <Form.Item label={t('type')} name={'type'} initialValue={'flash'}>
69
+ <Select options={jin10TypeOptions}></Select>
70
+ </Form.Item>
71
+ <Form.Item label={t('secretKey')} name={'secret_key'}>
72
+ <Input></Input>
73
+ </Form.Item>
74
+ <Form.Item noStyle dependencies={['type']}>
75
+ {({ getFieldValue }) => {
76
+ const type = getFieldValue('type');
77
+ switch (type) {
78
+ case 'flash':
79
+ return (
80
+ <>
81
+ <Form.Item label={t('flashType')} name={'flash_type'}>
82
+ <Select options={jin10FlashTypeOptions}></Select>
83
+ </Form.Item>
84
+ <Form.Item label={t('contain')} name={'contain'}>
85
+ <Input></Input>
86
+ </Form.Item>
87
+ <Form.Item label={t('filter')} name={'filter'}>
88
+ <Input></Input>
89
+ </Form.Item>
90
+ </>
91
+ );
92
+
93
+ case 'calendar':
94
+ return (
95
+ <>
96
+ <Form.Item label={t('calendarType')} name={'calendar_type'}>
97
+ <Select options={jin10CalendarTypeOptions}></Select>
98
+ </Form.Item>
99
+ <Form.Item
100
+ label={t('calendarDatashape')}
101
+ name={'calendar_datashape'}
102
+ >
103
+ <Select options={jin10CalendarDatashapeOptions}></Select>
104
+ </Form.Item>
105
+ </>
106
+ );
107
+
108
+ case 'symbols':
109
+ return (
110
+ <>
111
+ <Form.Item label={t('symbolsType')} name={'symbols_type'}>
112
+ <Select options={jin10SymbolsTypeOptions}></Select>
113
+ </Form.Item>
114
+ <Form.Item
115
+ label={t('symbolsDatatype')}
116
+ name={'symbols_datatype'}
117
+ >
118
+ <Select options={jin10SymbolsDatatypeOptions}></Select>
119
+ </Form.Item>
120
+ </>
121
+ );
122
+
123
+ case 'news':
124
+ return (
125
+ <>
126
+ <Form.Item label={t('contain')} name={'contain'}>
127
+ <Input></Input>
128
+ </Form.Item>
129
+ <Form.Item label={t('filter')} name={'filter'}>
130
+ <Input></Input>
131
+ </Form.Item>
132
+ </>
133
+ );
134
+
135
+ default:
136
+ return <></>;
137
+ }
138
+ }}
139
+ </Form.Item>
140
+ </Form>
141
+ );
142
+ };
143
+
144
+ export default Jin10Form;