RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Refa: create new name for duplicated dialog name (#9558)
Yongteng Lei33f3e05b7532
diff --git a/api/apps/dialog_app.py b/api/apps/dialog_app.pyindex ae8ac56f5a..1340f60d37 100644--- a/api/apps/dialog_app.py+++ b/api/apps/dialog_app.py@@ -16,6 +16,7 @@from flask import requestfrom flask_login import login_required, current_user+from api.db.services import duplicate_namefrom api.db.services.dialog_service import DialogServicefrom api.db import StatusEnumfrom api.db.services.tenant_llm_service import TenantLLMService@@ -42,8 +43,14 @@ def set_dialog():if len(name.encode("utf-8")) > 255:return get_data_error_result(message=f"Dialog name length is {len(name)} which is larger than 255")- if DialogService.get_or_none(tenant_id=current_user.id, name=name):- return get_data_error_result(message=f"Duplicated Dialog name {name}.")+ if is_create and DialogService.query(tenant_id=current_user.id, name=name.strip()):+ name = name.strip()+ name = duplicate_name(+ DialogService.query,+ name=name,+ tenant_id=current_user.id,+ status=StatusEnum.VALID.value)+description = req.get("description", "A helpful dialog")icon = req.get("icon", "")top_n = req.get("top_n", 6)