What problem does it solve?
This Skill streamlines the process of building, testing, and documenting new API endpoints, especially for long-running and asynchronous tasks, ensuring consistency and adherence to best practices within the KTRDR framework.
Core Features & Use Cases
- Structured API Creation: Guides you through creating new endpoints, defining Pydantic models for data validation, implementing business logic, and adding comprehensive tests.
- Async Operation Pattern: Provides a clear, standardized pattern for handling long-running tasks with background processes, immediate client feedback via operation IDs, and progress tracking.
- Progress Tracking & Error Handling: Standardizes how operations report their progress and how API errors are managed using FastAPI's
HTTPException for clear client communication.
- Use Case: When adding a new machine learning model, use this skill to quickly set up an API endpoint that accepts training requests, dispatches them as background tasks, and allows clients to poll for training progress and status updates.
Quick Start
I need to add a new API endpoint for a 'predict' function. Use the api-development skill to guide me through the process, including Pydantic models and async handling.