Unverified Commit aae2fb8a authored by John Wang's avatar John Wang Committed by GitHub

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

parent 23e52f14
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment