From 719caccb72c103daaea2e9a45ff922d57aa53320 Mon Sep 17 00:00:00 2001 From: hwzhuhao <923196325@qq.com> Date: Wed, 30 Oct 2024 09:58:47 +0800 Subject: [PATCH] feat: use throwing exceptions instead of program exit and update the default the topk value. --- api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py b/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py index 8dd26a073b..b58da3d949 100644 --- a/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py +++ b/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py @@ -104,8 +104,8 @@ class OceanBaseVector(BaseVector): val = int(row[6]) vals.append(val) if len(vals) == 0: - print("ob_vector_memory_limit_percentage not found in parameters.") - exit(1) + logger.exception("ob_vector_memory_limit_percentage not found in parameters.") + raise Exception("ob_vector_memory_limit_percentage not found in parameters.") if any(val == 0 for val in vals): try: self._client.perform_raw_text_sql("ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30") @@ -157,7 +157,7 @@ class OceanBaseVector(BaseVector): if ef_search != self._hnsw_ef_search: self._client.set_ob_hnsw_ef_search(ef_search) self._hnsw_ef_search = ef_search - topk = kwargs.get("top_k", 10) + topk = kwargs.get("top_k", 4) cur = self._client.ann_search( table_name=self._collection_name, vec_column_name="vector",