fix: dataset desc npe (#246)

This commit is contained in:
John Wang 2023-05-29 19:56:36 +08:00 committed by GitHub
parent 7f48fadd41
commit bb7f454ecd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,9 @@ class MultiDatasetRouterChain(Chain):
callback_manager=llm_callback_manager
)
destinations = ["{}: {}".format(d.id, d.description.replace('\n', ' ')) for d in datasets]
destinations = ["{}: {}".format(d.id, d.description.replace('\n', ' ') if d.description
else ('useful for when you want to answer queries about the ' + d.name))
for d in datasets]
destinations_str = "\n".join(destinations)
router_template = MULTI_PROMPT_ROUTER_TEMPLATE.format(
destinations=destinations_str