Download routes/acronym.py from muryshev/generic-chatbot-backend: direct link, hf CLI and curl.
- Browser
- Download file 787 Bytes
-
https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/routes/acronym.py
- Command line
-
hf download hf://spaces/muryshev/generic-chatbot-backend/routes/acronym.py
-
curl -L -o acronym.py https://huggingface.co/spaces/muryshev/generic-chatbot-backend/resolve/main/routes/acronym.py
787 Bytes
| from fastapi import APIRouter, Depends | |
| import logging | |
| import common.dependencies as DI | |
| from components.services.acronym import AcronymService | |
| router = APIRouter() | |
| logger = logging.getLogger(__name__) | |
| # Данный формат оставлен для обратной совместимости | |
| def get_acronym_collection(acronym_service: AcronymService = Depends(DI.get_acronym_service)): | |
| logger.info("Handling GET request to /collection/default") | |
| try: | |
| result = acronym_service.get_current_acronyms() | |
| logger.info(f"Successfully retrieved acronym collection with ID {result.collection_id}") | |
| return result | |
| except Exception as e: | |
| logger.error(f"Error retrieving acronym collection: {str(e)}") | |
| raise | |