Continue,,,
This commit is contained in:
parent
420dfa671a
commit
4572c09eea
2 changed files with 3 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ from rag.utils.redis_conn import REDIS_CONN
|
||||||
from rag.utils.doc_store_conn import OrderByExpr
|
from rag.utils.doc_store_conn import OrderByExpr
|
||||||
from common import settings
|
from common import settings
|
||||||
|
|
||||||
|
|
||||||
class DocumentService(CommonService):
|
class DocumentService(CommonService):
|
||||||
model = Document
|
model = Document
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ from common.constants import StatusEnum
|
||||||
from api.constants import DATASET_NAME_LIMIT
|
from api.constants import DATASET_NAME_LIMIT
|
||||||
from api.utils.api_utils import get_parser_config, get_data_error_result
|
from api.utils.api_utils import get_parser_config, get_data_error_result
|
||||||
|
|
||||||
|
|
||||||
class KnowledgebaseService(CommonService):
|
class KnowledgebaseService(CommonService):
|
||||||
"""Service class for managing knowledge base operations.
|
"""Service class for managing knowledge base operations.
|
||||||
|
|
||||||
|
|
@ -396,7 +397,7 @@ class KnowledgebaseService(CommonService):
|
||||||
if dataset_name == "":
|
if dataset_name == "":
|
||||||
return False, get_data_error_result(message="Dataset name can't be empty.")
|
return False, get_data_error_result(message="Dataset name can't be empty.")
|
||||||
if len(dataset_name.encode("utf-8")) > DATASET_NAME_LIMIT:
|
if len(dataset_name.encode("utf-8")) > DATASET_NAME_LIMIT:
|
||||||
return get_data_error_result(message=f"Dataset name length is {len(dataset_name)} which is larger than {DATASET_NAME_LIMIT}")
|
return False, get_data_error_result(message=f"Dataset name length is {len(dataset_name)} which is larger than {DATASET_NAME_LIMIT}")
|
||||||
|
|
||||||
# Deduplicate name within tenant
|
# Deduplicate name within tenant
|
||||||
dataset_name = duplicate_name(
|
dataset_name = duplicate_name(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue