diff --git a/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py b/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py index 68ac02de25..118bd0b84e 100644 --- a/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py +++ b/api/core/rag/datasource/vdb/tidb_on_qdrant/tidb_service.py @@ -24,9 +24,7 @@ _tidb_http_client: httpx.Client = get_pooled_http_client( class TidbService: @staticmethod - def fetch_qdrant_endpoint( - api_url: str, public_key: str, private_key: str, cluster_id: str - ) -> str | None: + def fetch_qdrant_endpoint(api_url: str, public_key: str, private_key: str, cluster_id: str) -> str | None: """Fetch the qdrant endpoint for a cluster by calling the Get Cluster API. The Get Cluster response contains ``status.connection_strings.standard.host`` @@ -34,9 +32,7 @@ class TidbService: as an ``https://`` URL. """ try: - cluster_response = TidbService.get_tidb_serverless_cluster( - api_url, public_key, private_key, cluster_id - ) + cluster_response = TidbService.get_tidb_serverless_cluster(api_url, public_key, private_key, cluster_id) if not cluster_response: return None # v1beta: status.connection_strings.standard.host @@ -100,9 +96,7 @@ class TidbService: cluster_response = TidbService.get_tidb_serverless_cluster(api_url, public_key, private_key, cluster_id) if cluster_response["state"] == "ACTIVE": user_prefix = cluster_response["userPrefix"] - qdrant_endpoint = TidbService.fetch_qdrant_endpoint( - api_url, public_key, private_key, cluster_id - ) + qdrant_endpoint = TidbService.fetch_qdrant_endpoint(api_url, public_key, private_key, cluster_id) return { "cluster_id": cluster_id, "cluster_name": display_name, diff --git a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_on_qdrant_vector.py b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_on_qdrant_vector.py index 98dd662b32..4a5cfc0387 100644 --- a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_on_qdrant_vector.py +++ b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_on_qdrant_vector.py @@ -468,7 +468,9 @@ class TidbOnQdrantVectorFactory(AbstractVectorFactory): else: TIDB_ON_QDRANT_API_KEY = f"{tidb_auth_binding.account}:{tidb_auth_binding.password}" - qdrant_url = (tidb_auth_binding.qdrant_endpoint if tidb_auth_binding else None) or dify_config.TIDB_ON_QDRANT_URL or "" + qdrant_url = ( + (tidb_auth_binding.qdrant_endpoint if tidb_auth_binding else None) or dify_config.TIDB_ON_QDRANT_URL or "" + ) if dataset.index_struct_dict: class_prefix: str = dataset.index_struct_dict["vector_store"]["class_prefix"] diff --git a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py index cfdc9cdd59..b426cd476c 100644 --- a/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py +++ b/api/providers/vdb/vdb-tidb-on-qdrant/src/dify_vdb_tidb_on_qdrant/tidb_service.py @@ -24,9 +24,7 @@ _tidb_http_client: httpx.Client = get_pooled_http_client( class TidbService: @staticmethod - def fetch_qdrant_endpoint( - api_url: str, public_key: str, private_key: str, cluster_id: str - ) -> str | None: + def fetch_qdrant_endpoint(api_url: str, public_key: str, private_key: str, cluster_id: str) -> str | None: """Fetch the qdrant endpoint for a cluster by calling the Get Cluster API. The Get Cluster response contains ``status.connection_strings.standard.host`` @@ -34,9 +32,7 @@ class TidbService: as an ``https://`` URL. """ try: - cluster_response = TidbService.get_tidb_serverless_cluster( - api_url, public_key, private_key, cluster_id - ) + cluster_response = TidbService.get_tidb_serverless_cluster(api_url, public_key, private_key, cluster_id) if not cluster_response: return None # v1beta: status.connection_strings.standard.host @@ -100,9 +96,7 @@ class TidbService: cluster_response = TidbService.get_tidb_serverless_cluster(api_url, public_key, private_key, cluster_id) if cluster_response["state"] == "ACTIVE": user_prefix = cluster_response["userPrefix"] - qdrant_endpoint = TidbService.fetch_qdrant_endpoint( - api_url, public_key, private_key, cluster_id - ) + qdrant_endpoint = TidbService.fetch_qdrant_endpoint(api_url, public_key, private_key, cluster_id) return { "cluster_id": cluster_id, "cluster_name": display_name,