diff --git a/Makefile b/Makefile index 7c529bf..cd90bbf 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ DEBUG:=True BACKEND_SERVER_HOST:=127.0.0.1 BACKEND_SERVER_PORT:=8000 BACKEND_SERVER_WORKERS:=4 -BACKEND_SERVER_VERSION:=v0.1.17 +BACKEND_SERVER_VERSION:=v0.1.18 TIMEZONE:="UTC" # Database - Postgres diff --git a/backend/src/repository/rag/chat.py b/backend/src/repository/rag/chat.py index 470aca9..7b8f319 100644 --- a/backend/src/repository/rag/chat.py +++ b/backend/src/repository/rag/chat.py @@ -142,7 +142,7 @@ async def get_context_by_question(input_msg: str): context = vector_db.search( list(embedd_input), 1, collection_name=DatasetFormatter.format_dataset_by_name(collection_name) ) - if len(context) > 0: + if context and (len(context) > 0): context = f"Please answer the question based on answer {context[0]}" else: context = InferenceHelper.instruction diff --git a/backend/tests/unit_tests/test_api_version.py b/backend/tests/unit_tests/test_api_version.py index 5d27047..9969243 100644 --- a/backend/tests/unit_tests/test_api_version.py +++ b/backend/tests/unit_tests/test_api_version.py @@ -43,5 +43,5 @@ def test_api_version(self): assert response.json() == { "inferenceEngine": "server--b1-2321a5e", "milvus": "v2.3.12", - "kirin": "v0.1.17", + "kirin": "v0.1.18", }