Download apps/client/services/wiring.py from jun2024/fc: direct link, hf CLI and curl.
- Browser
- Download file 1.24 kB
-
https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/client/services/wiring.py
- Command line
-
hf download hf://spaces/jun2024/fc/apps/client/services/wiring.py
-
curl -L -o wiring.py https://huggingface.co/spaces/jun2024/fc/resolve/main/apps/client/services/wiring.py
1.24 kB
| """Dependency injection wiring.""" | |
| from __future__ import annotations | |
| from typing import TYPE_CHECKING | |
| from apps.client.adapters import ( | |
| CredentialAdapter, | |
| FileUploadAdapter, | |
| FileValidatorAdapter, | |
| GsxtReportAdapter, | |
| TaskServiceAdapter, | |
| ) | |
| from apps.client.ports import CredentialPort, FileUploadPort, FileValidatorPort, GsxtReportPort, TaskServicePort | |
| from apps.core.interfaces import ServiceLocator | |
| if TYPE_CHECKING: | |
| from apps.core.protocols import ILLMService | |
| def get_llm_service() -> ILLMService: | |
| return ServiceLocator.get_llm_service() | |
| # ==================== Port Factories ==================== | |
| def get_gsxt_report_port() -> GsxtReportPort: | |
| """获取企业信用报告端口。""" | |
| return GsxtReportAdapter() | |
| def get_credential_port() -> CredentialPort: | |
| """获取账号凭证端口。""" | |
| return CredentialAdapter() | |
| def get_file_upload_port() -> FileUploadPort: | |
| """获取文件上传端口。""" | |
| return FileUploadAdapter() | |
| def get_file_validator_port() -> FileValidatorPort: | |
| """获取文件验证端口。""" | |
| return FileValidatorAdapter() | |
| def get_task_service_port() -> TaskServicePort: | |
| """获取任务服务端口。""" | |
| return TaskServiceAdapter() | |