Signed-off-by: yihong0618 <zouzou0208@gmail.com>tags/0.15.1
| @@ -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] | |||
| @@ -32,7 +32,7 @@ class ConversationListApi(InstalledAppResource): | |||
| pinned = None | |||
| if "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: | |||
| @@ -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) | |||
| @@ -39,7 +39,7 @@ class ConversationListApi(WebApiResource): | |||
| pinned = None | |||
| if "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: | |||
| @@ -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 value | |||
| @@ -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) -> dic | |||
| if method_name == "ivfpq": | |||
| ivfpq_m = kwargs["ivfpq_m"] | |||
| nlist = kwargs["nlist"] | |||
| centroids_use_hnsw = True if nlist > 10000 else False | |||
| centroids_use_hnsw = nlist > 10000 | |||
| centroids_hnsw_m = 24 | |||
| centroids_hnsw_ef_construct = 500 | |||
| centroids_hnsw_ef_search = 100 | |||