fix bug, add dependencies: strsimpy, markdownify

This commit is contained in:
liunux4odoo 2023-10-25 08:58:31 +08:00
parent 03e55e11c4
commit 27418ba9fa
4 changed files with 8 additions and 2 deletions

View File

@ -27,7 +27,11 @@ pathlib
pytest pytest
scikit-learn scikit-learn
numexpr numexpr
strsimpy
markdownify
vllm>=0.2.0; sys_platform == "linux" vllm>=0.2.0; sys_platform == "linux"
# online api libs # online api libs
# zhipuai # zhipuai
# dashscope>=1.10.0 # qwen # dashscope>=1.10.0 # qwen

View File

@ -26,6 +26,8 @@ pathlib
pytest pytest
scikit-learn scikit-learn
numexpr numexpr
strsimpy
markdownify
vllm>=0.2.0; sys_platform == "linux" vllm>=0.2.0; sys_platform == "linux"

View File

@ -93,8 +93,8 @@ def test_knowledge_chat(api="/chat/knowledge_base_chat"):
data = json.loads(line) data = json.loads(line)
if "answer" in data: if "answer" in data:
print(data["answer"], end="", flush=True) print(data["answer"], end="", flush=True)
pprint(data)
assert "docs" in data and len(data["docs"]) > 0 assert "docs" in data and len(data["docs"]) > 0
pprint(data["docs"])
assert response.status_code == 200 assert response.status_code == 200

View File

@ -50,7 +50,7 @@ def file_exists(kb: str, selected_rows: List) -> Tuple[str, str]:
return "", "" return "", ""
def knowledge_base_page(api: ApiRequest): def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
try: try:
kb_list = {x["kb_name"]: x for x in get_kb_details()} kb_list = {x["kb_name"]: x for x in get_kb_details()}
except Exception as e: except Exception as e: