Skip to content

Commit

Permalink
feat: Add component Jin10 #1739 (#2563)
Browse files Browse the repository at this point in the history
### 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):
  • Loading branch information
cike8899 authored Sep 24, 2024
1 parent 949a999 commit 91dbce3
Show file tree
Hide file tree
Showing 8 changed files with 332 additions and 0 deletions.
22 changes: 22 additions & 0 deletions web/src/assets/svg/jin10.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 46 additions & 0 deletions web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,11 +910,57 @@ The above is the content you need to summarize.`,
akShareDescription:
'This component can be used to obtain news information for the corresponding stock from the Eastmoney website.',
yahooFinance: 'YahooFinance',
yahooFinanceDescription:
'The component queries information about the company based on the provided ticker symbol.',
info: 'Info',
history: 'History',
financials: 'Financials',
balanceSheet: 'Balance sheet',
cashFlowStatement: 'Cash flow statement',
jin10: 'Jin10',
jin10Description:
'This component can be used to access information in the financial sector from the Jin10 Open Platform, including quick news, calendar, quotes, reference.',
flashType: 'Flash type',
filter: 'Filter',
contain: 'Contain',
calendarType: 'Calendar type',
calendarDatashape: 'Calendar datashape',
symbolsDatatype: 'Symbols datatype',
symbolsType: 'Symbols type',
jin10TypeOptions: {
flash: 'Quick News',
calendar: 'Calendar',
symbols: 'quotes',
news: 'reference',
},
jin10FlashTypeOptions: {
'1': 'Market News',
'2': ' Futures News',
'3': 'US-Hong Kong News',
'4': 'A-Share News',
'5': 'Commodities & Forex News',
},
jin10CalendarTypeOptions: {
cj: 'Macroeconomic Data Calendar',
qh: ' Futures Calendar',
hk: 'Hong Kong Stock Market Calendar',
us: 'US Stock Market Calendar',
},
jin10CalendarDatashapeOptions: {
data: 'Data',
event: ' Event',
holiday: 'Holiday',
},
jin10SymbolsTypeOptions: {
GOODS: 'Commodity Quotes',
FOREX: ' Forex Quotes',
FUTURE: 'International Market Quotes',
CRYPTO: 'Cryptocurrency Quotes',
},
jin10SymbolsDatatypeOptions: {
symbols: 'Commodity List',
quotes: ' Latest Market Quotes',
},
},
footer: {
profile: 'All rights reserved @ React',
Expand Down
45 changes: 45 additions & 0 deletions web/src/locales/zh-traditional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -863,11 +863,56 @@ export default {
akShare: 'AkShare',
akShareDescription: '此組件可用於從東方財富網取得對應股票的新聞資訊。',
yahooFinance: '雅虎財經',
yahooFinanceDescription: '該組件根據提供的股票代碼查詢有關公司的資訊。',
info: '訊息',
history: '歷史',
financials: '財務',
balanceSheet: '資產負債表',
cashFlowStatement: '現金流量表',
jin10: '金十',
jin10Description:
'此組件可用於從金十開放平台獲取金融領域的信息,包括快訊、日曆、行情、參考。 ',
flashType: '閃光類型',
filter: '篩選',
contain: '包含',
calendarType: '日曆類型',
calendarDatashape: '日曆資料形狀',
symbolsDatatype: '符號資料型別',
symbolsType: '符號類型',
jin10TypeOptions: {
flash: '快訊',
calendar: '日曆',
symbols: '行情',
news: '參考',
},
jin10FlashTypeOptions: {
'1': '市場快訊',
'2': '期貨快訊',
'3': '美港快訊',
'4': 'A股快訊',
'5': '商品外匯快訊',
},
jin10CalendarTypeOptions: {
cj: '宏觀資料日曆',
qh: '期貨日曆',
hk: '港股日曆',
us: '美股日曆',
},
jin10CalendarDatashapeOptions: {
data: '資料',
event: ' 事件',
holiday: '假期',
},
jin10SymbolsTypeOptions: {
GOODS: '商品行情',
FOREX: '外匯行情',
FUTURE: '國際行情',
CRYPTO: '加密貨幣行情',
},
jin10SymbolsDatatypeOptions: {
symbols: '品種列表',
quotes: '最新行情',
},
},
footer: {
profile: '“保留所有權利 @ react”',
Expand Down
45 changes: 45 additions & 0 deletions web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,11 +881,56 @@ export default {
akShare: 'AkShare',
akShareDescription: '该组件可用于从东方财富网站获取相应股票的新闻信息。',
yahooFinance: '雅虎财经',
yahooFinanceDescription: '该组件根据提供的股票代码查询有关公司的信息。',
info: '信息',
history: '历史',
financials: '财务',
balanceSheet: '资产负债表',
cashFlowStatement: '现金流量表',
jin10: '金十',
jin10Description:
'该组件可用于从金十开放平台获取金融领域的信息,包括快讯、日历、行情、参考。',
flashType: '闪光类型',
filter: '筛选',
contain: '包含',
calendarType: '日历类型',
calendarDatashape: '日历数据形状',
symbolsDatatype: '符号数据类型',
symbolsType: '符号类型',
jin10TypeOptions: {
flash: '快讯',
calendar: '日历',
symbols: '行情',
news: '参考',
},
jin10FlashTypeOptions: {
'1': '市场快讯',
'2': '期货快讯',
'3': '美港快讯',
'4': 'A股快讯',
'5': '商品外汇快讯',
},
jin10CalendarTypeOptions: {
cj: '宏观数据日历',
qh: '期货日历',
hk: '港股日历',
us: '美股日历',
},
jin10CalendarDatashapeOptions: {
data: '数据',
event: ' 事件',
holiday: '假期',
},
jin10SymbolsTypeOptions: {
GOODS: '商品行情',
FOREX: '外汇行情',
FUTURE: '国际行情',
CRYPTO: '加密货币行情',
},
jin10SymbolsDatatypeOptions: {
symbols: '品种列表',
quotes: '最新行情',
},
},
footer: {
profile: 'All rights reserved @ React',
Expand Down
26 changes: 26 additions & 0 deletions web/src/pages/flow/constant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ReactComponent as ExeSqlIcon } from '@/assets/svg/exesql.svg';
import { ReactComponent as GithubIcon } from '@/assets/svg/github.svg';
import { ReactComponent as GoogleScholarIcon } from '@/assets/svg/google-scholar.svg';
import { ReactComponent as GoogleIcon } from '@/assets/svg/google.svg';
import { ReactComponent as Jin10Icon } from '@/assets/svg/jin10.svg';
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
import { ReactComponent as PubMedIcon } from '@/assets/svg/pubmed.svg';
import { ReactComponent as QWeatherIcon } from '@/assets/svg/qweather.svg';
Expand Down Expand Up @@ -65,6 +66,7 @@ export enum Operator {
WenCai = 'WenCai',
AkShare = 'AkShare',
YahooFinance = 'YahooFinance',
Jin10 = 'Jin10',
}

export const operatorIconMap = {
Expand Down Expand Up @@ -94,6 +96,7 @@ export const operatorIconMap = {
[Operator.WenCai]: WenCaiIcon,
[Operator.AkShare]: AkShareIcon,
[Operator.YahooFinance]: YahooFinanceIcon,
[Operator.Jin10]: Jin10Icon,
};

export const operatorMap: Record<
Expand Down Expand Up @@ -206,6 +209,7 @@ export const operatorMap: Record<
[Operator.WenCai]: { backgroundColor: '#faac5b' },
[Operator.AkShare]: { backgroundColor: '#8085f5' },
[Operator.YahooFinance]: { backgroundColor: '#b474ff' },
[Operator.Jin10]: { backgroundColor: '#a0b9f8' },
};

export const componentMenuList = [
Expand Down Expand Up @@ -284,6 +288,9 @@ export const componentMenuList = [
{
name: Operator.YahooFinance,
},
{
name: Operator.Jin10,
},
];

export const initialRetrievalValues = {
Expand Down Expand Up @@ -436,6 +443,14 @@ export const initialYahooFinanceValues = {
news: true,
};

export const initialJin10Values = {
type: 'flash',
secret_key: 'xxx',
flash_type: '1',
contain: '',
filter: '',
};

export const CategorizeAnchorPointPositions = [
{ top: 1, right: 34 },
{ top: 8, right: 18 },
Expand Down Expand Up @@ -509,6 +524,7 @@ export const RestrictedUpstreamMap = {
[Operator.WenCai]: [Operator.Begin],
[Operator.AkShare]: [Operator.Begin],
[Operator.YahooFinance]: [Operator.Begin],
[Operator.Jin10]: [Operator.Begin],
};

export const NodeMap = {
Expand Down Expand Up @@ -538,6 +554,7 @@ export const NodeMap = {
[Operator.WenCai]: 'ragNode',
[Operator.AkShare]: 'ragNode',
[Operator.YahooFinance]: 'ragNode',
[Operator.Jin10]: 'ragNode',
};

export const LanguageOptions = [
Expand Down Expand Up @@ -2706,3 +2723,12 @@ export const WenCaiQueryTypeOptions = [
'lccp',
'foreign_exchange',
];

export const Jin10TypeOptions = ['flash', 'calendar', 'symbols', 'news'];
export const Jin10FlashTypeOptions = new Array(5)
.fill(1)
.map((x, idx) => (idx + 1).toString());
export const Jin10CalendarTypeOptions = ['cj', 'qh', 'hk', 'us'];
export const Jin10CalendarDatashapeOptions = ['data', 'event', 'holiday'];
export const Jin10SymbolsTypeOptions = ['GOODS', 'FOREX', 'FUTURE', 'CRYPTO'];
export const Jin10SymbolsDatatypeOptions = ['symbols', 'quotes'];
2 changes: 2 additions & 0 deletions web/src/pages/flow/flow-drawer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import SwitchForm from '../switch-form';
import WenCaiForm from '../wencai-form';
import WikipediaForm from '../wikipedia-form';

import Jin10Form from '../jin10-form';
import YahooFinanceForm from '../yahoo-finance-form';
import styles from './index.less';

Expand Down Expand Up @@ -66,6 +67,7 @@ const FormMap = {
[Operator.WenCai]: WenCaiForm,
[Operator.AkShare]: AkShareForm,
[Operator.YahooFinance]: YahooFinanceForm,
[Operator.Jin10]: Jin10Form,
};

const EmptyContent = () => <div>empty</div>;
Expand Down
2 changes: 2 additions & 0 deletions web/src/pages/flow/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
initialGithubValues,
initialGoogleScholarValues,
initialGoogleValues,
initialJin10Values,
initialKeywordExtractValues,
initialMessageValues,
initialPubMedValues,
Expand Down Expand Up @@ -119,6 +120,7 @@ export const useInitializeOperatorParams = () => {
[Operator.WenCai]: initialWenCaiValues,
[Operator.AkShare]: initialAkShareValues,
[Operator.YahooFinance]: initialYahooFinanceValues,
[Operator.Jin10]: initialJin10Values,
};
}, [llmId]);

Expand Down
Loading

0 comments on commit 91dbce3

Please sign in to comment.