From d44d4bd6fdc82418a6676c5daad7046c66cdd4c8 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 27 Jul 2023 22:27:05 +0800 Subject: [PATCH] feat: support query date tool (#662) --- web/app/components/app/chat/thought/index.tsx | 2 ++ .../explore/universal-chat/config-view/summary/index.tsx | 3 ++- web/i18n/lang/explore.en.ts | 1 + web/i18n/lang/explore.zh.ts | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app/components/app/chat/thought/index.tsx b/web/app/components/app/chat/thought/index.tsx index e8079f3d03..789c7bc262 100644 --- a/web/app/components/app/chat/thought/index.tsx +++ b/web/app/components/app/chat/thought/index.tsx @@ -49,6 +49,8 @@ const Thought: FC = ({ return t('explore.universalChat.thought.res.google', { query: input.query }) case 'wikipedia': return t('explore.universalChat.thought.res.wikipedia', { query: input.query }) + case 'current_datetime': + return t('explore.universalChat.thought.res.date') default: return `Unknown tool: ${item.tool}` } diff --git a/web/app/components/explore/universal-chat/config-view/summary/index.tsx b/web/app/components/explore/universal-chat/config-view/summary/index.tsx index b098e9ed8a..1d5828fdb8 100644 --- a/web/app/components/explore/universal-chat/config-view/summary/index.tsx +++ b/web/app/components/explore/universal-chat/config-view/summary/index.tsx @@ -43,7 +43,8 @@ const Summary: FC = ({ plugins, dataSets, }) => { - const pluginIds = Object.keys(plugins).filter(key => plugins[key]) + // current_datetime is not configable and do not have icon + const pluginIds = Object.keys(plugins).filter(key => plugins[key] && key !== 'current_datetime') const [isShowConfig, { setFalse: hideConfig, toggle: toggleShowConfig }] = useBoolean(false) const configContentRef = React.useRef(null) diff --git a/web/i18n/lang/explore.en.ts b/web/i18n/lang/explore.en.ts index 85221b3228..9e04448585 100644 --- a/web/i18n/lang/explore.en.ts +++ b/web/i18n/lang/explore.en.ts @@ -69,6 +69,7 @@ const translation = { google: 'Searching Google {{query}}', wikipedia: 'Searching Wikipedia {{query}}', dataset: 'Retrieving dataset {datasetName}', + date: 'Searching date', }, }, viewConfigDetailTip: 'In conversation, cannot change above settings', diff --git a/web/i18n/lang/explore.zh.ts b/web/i18n/lang/explore.zh.ts index 6d8591e587..45dc4443d9 100644 --- a/web/i18n/lang/explore.zh.ts +++ b/web/i18n/lang/explore.zh.ts @@ -69,6 +69,7 @@ const translation = { google: '搜索谷歌 {{query}}', wikipedia: '搜索维基百科 {{query}}', dataset: '检索数据集 {datasetName}', + date: '查询日期', }, }, viewConfigDetailTip: '在对话中,无法更改上述设置',