Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat: support query date tool (#662)

Joeld44d4bd6fdc8
diff --git a/web/app/components/app/chat/thought/index.tsx b/web/app/components/app/chat/thought/index.tsx
index e8079f3d031..789c7bc2623 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<IThoughtProps> = ({
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 b098e9ed8a1..1d5828fdb87 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<ISummaryProps> = ({
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 85221b32289..9e044485858 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 6d8591e5873..45dc4443d90 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: '在对话中,无法更改上述设置',