Spaces:
Running
Running
| # Backend Development Plan | |
| ## 1. Category-Based System Instructions | |
| - **Goal:** Support system instructions tailored to specific engineering categories (e.g., mechanical, structural, civil, architectural, electrical, aerospace). | |
| - **Approach:** | |
| - Define a set of system instructions for each category. | |
| - **Allowed Categories:** | |
| - mechanical | |
| - structural | |
| - civil | |
| - architectural | |
| - electrical | |
| - aerospace | |
| - Store these instructions in a configuration file (e.g., JSON or YAML) or a database. | |
| - Update API endpoints to accept a `category` parameter. | |
| - Use the selected category in the generation logic to apply corresponding instructions. | |
| - Provide a fallback to default instructions if the category isn't recognized. | |
| ## 2. API Changes | |
| - **Add `category` field** to relevant request models (e.g., `TextGenerateRequest`, `ImageTextGenerateRequest`). | |
| - **Validate the category** against the allowed values. | |
| - **Pass category** to generation utilities to select appropriate instructions. | |
| - **Logging and Error Handling:** | |
| - Log usage statistics for different categories. | |
| - Return clear error messages if an invalid category is provided. | |
| ## 3. Future Ideas and Enhancements | |
| - Allow users to define custom categories or instructions. | |
| - Add endpoints to list available categories along with their descriptions. | |
| - Implement advanced logging and analytics to observe category usage. | |
| - Support multi-category or hybrid instructions. | |
| - **Extend the configuration:** | |
| - Provide detailed parameters per category (e.g., style, tone, structural guidelines). | |
| - Create a configuration file to manage these parameters centrally. | |
| - Explore caching mechanisms for repeated generation requests per category. | |
| --- | |
| ## Next Steps | |
| 1. Define allowed categories and specify instructions per category. | |
| 2. Refactor request models and endpoints to include a `category` parameter. | |
| 3. Update generation logic to utilize category-specific instructions. | |
| 4. Develop a configuration file for system instructions per category. | |
| 5. Enhance error handling and logging for better maintainability. | |