diff --git a/api/services/billing_service.py b/api/services/billing_service.py index 13f9d1fcf4..0f0c49e7fe 100644 --- a/api/services/billing_service.py +++ b/api/services/billing_service.py @@ -37,7 +37,11 @@ class _VectorSpaceQuota(TypedDict): class _KnowledgeRateLimit(TypedDict): + # NOTE (hj24): + # 1. Return for sandbox users but is null for other plans, it's defined but never used. + # 2. Keep it for compatibility for now, can be deprecated in future versions. size: NotRequired[int] + # NOTE END limit: int diff --git a/api/services/feature_service.py b/api/services/feature_service.py index 56d896629c..df653e0ba7 100644 --- a/api/services/feature_service.py +++ b/api/services/feature_service.py @@ -336,7 +336,11 @@ class FeatureService: features.model_load_balancing_enabled = billing_info["model_load_balancing_enabled"] if "knowledge_rate_limit" in billing_info: + # NOTE (hj24): + # 1. knowledge_rate_limit size is nullable, currently it's defined but never used, only limit is used. + # 2. So be careful if later we decide to use [size], we cannot assume it is always present. features.knowledge_rate_limit = billing_info["knowledge_rate_limit"]["limit"] + # NOTE END if "knowledge_pipeline_publish_enabled" in billing_info: features.knowledge_pipeline.publish_enabled = billing_info["knowledge_pipeline_publish_enabled"]