diff --git a/web/src/assets/svg/yahoo-finance.svg b/web/src/assets/svg/yahoo-finance.svg new file mode 100644 index 000000000..9bf55ce2f --- /dev/null +++ b/web/src/assets/svg/yahoo-finance.svg @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/web/src/locales/en.ts b/web/src/locales/en.ts index 3ca925a47..4f83ac78c 100644 --- a/web/src/locales/en.ts +++ b/web/src/locales/en.ts @@ -909,6 +909,12 @@ The above is the content you need to summarize.`, akShare: 'AkShare', akShareDescription: 'This component can be used to obtain news information for the corresponding stock from the Eastmoney website.', + yahooFinance: 'YahooFinance', + info: 'Info', + history: 'History', + financials: 'Financials', + balanceSheet: 'Balance sheet', + cashFlowStatement: 'Cash flow statement', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/locales/zh-traditional.ts b/web/src/locales/zh-traditional.ts index d7241fe48..258bcf8fa 100644 --- a/web/src/locales/zh-traditional.ts +++ b/web/src/locales/zh-traditional.ts @@ -862,6 +862,12 @@ export default { }, akShare: 'AkShare', akShareDescription: '此組件可用於從東方財富網取得對應股票的新聞資訊。', + yahooFinance: '雅虎財經', + info: '訊息', + history: '歷史', + financials: '財務', + balanceSheet: '資產負債表', + cashFlowStatement: '現金流量表', }, footer: { profile: '“保留所有權利 @ react”', diff --git a/web/src/locales/zh.ts b/web/src/locales/zh.ts index 88b0ff705..6d6c09741 100644 --- a/web/src/locales/zh.ts +++ b/web/src/locales/zh.ts @@ -880,6 +880,12 @@ export default { }, akShare: 'AkShare', akShareDescription: '该组件可用于从东方财富网站获取相应股票的新闻信息。', + yahooFinance: '雅虎财经', + info: '信息', + history: '历史', + financials: '财务', + balanceSheet: '资产负债表', + cashFlowStatement: '现金流量表', }, footer: { profile: 'All rights reserved @ React', diff --git a/web/src/pages/flow/constant.tsx b/web/src/pages/flow/constant.tsx index 7f45bf734..4765c27b5 100644 --- a/web/src/pages/flow/constant.tsx +++ b/web/src/pages/flow/constant.tsx @@ -15,6 +15,7 @@ import { ReactComponent as QWeatherIcon } from '@/assets/svg/qweather.svg'; import { ReactComponent as SwitchIcon } from '@/assets/svg/switch.svg'; import { ReactComponent as WenCaiIcon } from '@/assets/svg/wencai.svg'; import { ReactComponent as WikipediaIcon } from '@/assets/svg/wikipedia.svg'; +import { ReactComponent as YahooFinanceIcon } from '@/assets/svg/yahoo-finance.svg'; import { variableEnabledFieldMap } from '@/constants/chat'; import i18n from '@/locales/config'; @@ -63,6 +64,7 @@ export enum Operator { Switch = 'Switch', WenCai = 'WenCai', AkShare = 'AkShare', + YahooFinance = 'YahooFinance', } export const operatorIconMap = { @@ -91,6 +93,7 @@ export const operatorIconMap = { [Operator.Switch]: SwitchIcon, [Operator.WenCai]: WenCaiIcon, [Operator.AkShare]: AkShareIcon, + [Operator.YahooFinance]: YahooFinanceIcon, }; export const operatorMap: Record< @@ -202,6 +205,7 @@ export const operatorMap: Record< [Operator.Switch]: { backgroundColor: '#dbaff6' }, [Operator.WenCai]: { backgroundColor: '#faac5b' }, [Operator.AkShare]: { backgroundColor: '#8085f5' }, + [Operator.YahooFinance]: { backgroundColor: '#b474ff' }, }; export const componentMenuList = [ @@ -277,6 +281,9 @@ export const componentMenuList = [ { name: Operator.AkShare, }, + { + name: Operator.YahooFinance, + }, ]; export const initialRetrievalValues = { @@ -420,6 +427,15 @@ export const initialWenCaiValues = { top_n: 20, query_type: 'stock' }; export const initialAkShareValues = { top_n: 10 }; +export const initialYahooFinanceValues = { + info: true, + history: false, + financials: false, + balance_sheet: false, + cash_flow_statement: false, + news: true, +}; + export const CategorizeAnchorPointPositions = [ { top: 1, right: 34 }, { top: 8, right: 18 }, @@ -492,6 +508,7 @@ export const RestrictedUpstreamMap = { [Operator.Switch]: [Operator.Begin], [Operator.WenCai]: [Operator.Begin], [Operator.AkShare]: [Operator.Begin], + [Operator.YahooFinance]: [Operator.Begin], }; export const NodeMap = { @@ -520,6 +537,7 @@ export const NodeMap = { [Operator.Switch]: 'categorizeNode', [Operator.WenCai]: 'ragNode', [Operator.AkShare]: 'ragNode', + [Operator.YahooFinance]: 'ragNode', }; export const LanguageOptions = [ diff --git a/web/src/pages/flow/flow-drawer/index.tsx b/web/src/pages/flow/flow-drawer/index.tsx index f76374904..66fff21a7 100644 --- a/web/src/pages/flow/flow-drawer/index.tsx +++ b/web/src/pages/flow/flow-drawer/index.tsx @@ -32,6 +32,7 @@ import SwitchForm from '../switch-form'; import WenCaiForm from '../wencai-form'; import WikipediaForm from '../wikipedia-form'; +import YahooFinanceForm from '../yahoo-finance-form'; import styles from './index.less'; interface IProps { @@ -64,6 +65,7 @@ const FormMap = { [Operator.Switch]: SwitchForm, [Operator.WenCai]: WenCaiForm, [Operator.AkShare]: AkShareForm, + [Operator.YahooFinance]: YahooFinanceForm, }; const EmptyContent = () =>