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.

fix: dataset retrieve npe when dataset desc is null (#669)

John Wangaae2fb8a3093
diff --git a/api/core/tool/dataset_retriever_tool.py b/api/core/tool/dataset_retriever_tool.py
index bf881159fae..d728528267e 100644
--- a/api/core/tool/dataset_retriever_tool.py
+++ b/api/core/tool/dataset_retriever_tool.py
@@ -32,10 +32,11 @@ class DatasetRetrieverTool(BaseTool):
@classmethod
def from_dataset(cls, dataset: Dataset, **kwargs):
- description = dataset.description.replace('\n', '').replace('\r', '')
+ description = dataset.description
if not description:
description = 'useful for when you want to answer queries about the ' + dataset.name
+ description = description.replace('\n', '').replace('\r', '')
description += '\nID of dataset MUST be ' + dataset.id
return cls(
tenant_id=dataset.tenant_id,