mirror of
https://github.com/langgenius/dify.git
synced 2026-08-24 12:32:54 -04:00
70a513fc62
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
"""Feature-query gateway backed by the existing FeatureService."""
|
|
|
|
from typing import override
|
|
|
|
from services.entities.feature_entities import (
|
|
FeatureModel,
|
|
LicenseModel,
|
|
SystemFeatureModel,
|
|
VectorSpaceLimitationModel,
|
|
)
|
|
from services.feature_query_service import FeatureQueryGateway
|
|
from services.feature_service import FeatureService
|
|
|
|
|
|
class FeatureServiceGateway(FeatureQueryGateway):
|
|
"""Read dynamic feature resources through FeatureService."""
|
|
|
|
@override
|
|
def get_workspace_features(self, workspace_id: str) -> FeatureModel:
|
|
return FeatureService.get_features(workspace_id, exclude_vector_space=True)
|
|
|
|
@override
|
|
def get_trial_models(self, workspace_id: str) -> list[str]:
|
|
return FeatureService.get_trial_models(workspace_id)
|
|
|
|
@override
|
|
def get_vector_space(self, workspace_id: str) -> VectorSpaceLimitationModel:
|
|
return FeatureService.get_vector_space(workspace_id)
|
|
|
|
@override
|
|
def get_public_system_features(self) -> SystemFeatureModel:
|
|
return FeatureService.get_system_features()
|
|
|
|
@override
|
|
def get_license(self) -> LicenseModel:
|
|
return FeatureService.get_license()
|