mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-11 01:18:58 +08:00
fix: dataset retrieve npe when dataset desc is null (#669)
This commit is contained in:
parent
23e52f14e3
commit
aae2fb8a30
@ -32,10 +32,11 @@ class DatasetRetrieverTool(BaseTool):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dataset(cls, dataset: Dataset, **kwargs):
|
def from_dataset(cls, dataset: Dataset, **kwargs):
|
||||||
description = dataset.description.replace('\n', '').replace('\r', '')
|
description = dataset.description
|
||||||
if not description:
|
if not description:
|
||||||
description = 'useful for when you want to answer queries about the ' + dataset.name
|
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
|
description += '\nID of dataset MUST be ' + dataset.id
|
||||||
return cls(
|
return cls(
|
||||||
tenant_id=dataset.tenant_id,
|
tenant_id=dataset.tenant_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user