Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: ruff check for True if ... else (#12576)
yihong4e101604c350
diff --git a/api/.ruff.toml b/api/.ruff.tomlindex 89a2da35d6c..e319ed4d541 100644--- a/api/.ruff.toml+++ b/api/.ruff.toml@@ -69,7 +69,6 @@ ignore = ["SIM108", # if-else-block-instead-of-if-exp"SIM113", # enumerate-for-loop"SIM117", # multiple-with-statements- "SIM210", # if-expr-with-true-false][lint.per-file-ignores]diff --git a/api/controllers/console/explore/conversation.py b/api/controllers/console/explore/conversation.pyindex 91916cbc1ed..600e78e09e3 100644--- a/api/controllers/console/explore/conversation.py+++ b/api/controllers/console/explore/conversation.py@@ -32,7 +32,7 @@ class ConversationListApi(InstalledAppResource):pinned = Noneif "pinned" in args and args["pinned"] is not None:- pinned = True if args["pinned"] == "true" else False+ pinned = args["pinned"] == "true"try:with Session(db.engine) as session:diff --git a/api/controllers/service_api/wraps.py b/api/controllers/service_api/wraps.pyindex 8314a8240c3..43f718306bf 100644--- a/api/controllers/service_api/wraps.py+++ b/api/controllers/service_api/wraps.py@@ -267,7 +267,7 @@ def create_or_update_end_user_for_user_id(app_model: App, user_id: Optional[str]tenant_id=app_model.tenant_id,app_id=app_model.id,type="service_api",- is_anonymous=True if user_id == "DEFAULT-USER" else False,+ is_anonymous=user_id == "DEFAULT-USER",session_id=user_id,)db.session.add(end_user)diff --git a/api/controllers/web/conversation.py b/api/controllers/web/conversation.pyindex 28feb1ca47e..419247ea14e 100644--- a/api/controllers/web/conversation.py+++ b/api/controllers/web/conversation.py@@ -39,7 +39,7 @@ class ConversationListApi(WebApiResource):pinned = Noneif "pinned" in args and args["pinned"] is not None:- pinned = True if args["pinned"] == "true" else False+ pinned = args["pinned"] == "true"try:with Session(db.engine) as session:diff --git a/api/core/model_runtime/schema_validators/common_validator.py b/api/core/model_runtime/schema_validators/common_validator.pyindex 8cc8adfc365..810a7c4c44a 100644--- a/api/core/model_runtime/schema_validators/common_validator.py+++ b/api/core/model_runtime/schema_validators/common_validator.py@@ -87,6 +87,6 @@ class CommonValidator:if value.lower() not in {"true", "false"}:raise ValueError(f"Variable {credential_form_schema.variable} should be true or false")- value = True if value.lower() == "true" else False+ value = value.lower() == "true"return valuediff --git a/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py b/api/core/rag/datasource/vdb/lindorm/lindorm_vector.pyindex d7a14207e93..66fba763e73 100644--- a/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py+++ b/api/core/rag/datasource/vdb/lindorm/lindorm_vector.py@@ -258,7 +258,7 @@ class LindormVectorStore(BaseVector):hnsw_ef_construction = kwargs.pop("hnsw_ef_construction", 500)ivfpq_m = kwargs.pop("ivfpq_m", dimension)nlist = kwargs.pop("nlist", 1000)- centroids_use_hnsw = kwargs.pop("centroids_use_hnsw", True if nlist >= 5000 else False)+ centroids_use_hnsw = kwargs.pop("centroids_use_hnsw", nlist >= 5000)centroids_hnsw_m = kwargs.pop("centroids_hnsw_m", 24)centroids_hnsw_ef_construct = kwargs.pop("centroids_hnsw_ef_construct", 500)centroids_hnsw_ef_search = kwargs.pop("centroids_hnsw_ef_search", 100)@@ -305,7 +305,7 @@ def default_text_mapping(dimension: int, method_name: str, **kwargs: Any) -> dicif method_name == "ivfpq":ivfpq_m = kwargs["ivfpq_m"]nlist = kwargs["nlist"]- centroids_use_hnsw = True if nlist > 10000 else False+ centroids_use_hnsw = nlist > 10000centroids_hnsw_m = 24centroids_hnsw_ef_construct = 500centroids_hnsw_ef_search = 100