瀏覽代碼

fix: dataset desc npe (#246)

tags/0.3.1
John Wang 2 年之前
父節點
當前提交
bb7f454ecd
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增1 行删除
  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

Loading…
取消
儲存