Explorar el Código

fix: dataset desc npe (#246)

John Wang hace 1 año
padre
commit
bb7f454ecd
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      api/core/chain/multi_dataset_router_chain.py

+ 3 - 1
api/core/chain/multi_dataset_router_chain.py

@@ -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