mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-10 02:28:59 +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
|
||||
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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user