.. include:: /Includes.rst.txt ===== Usage ===== Backend Module ============== The AI Tools backend module is located in the **File** section of the TYPO3 backend, below the Filelist module. Overview -------- The module displays a table of all images that need ALT or title texts: - **Preview**: Thumbnail of the image (click to open full size) - **ALT Text**: The alternative text for each language - **Title Text**: The title text for each language - **Actions**: Buttons for generating texts and editing the file Language Selection ------------------ Use the language dropdown at the top to switch between languages. The table columns will update to show the texts for the selected language. Languages that have AI text generation disabled in the site configuration will appear grayed out and cannot be selected. Generating Texts ---------------- Single Image ~~~~~~~~~~~~ Click the lightning bolt icon (⚡) in the Actions column to generate ALT and title texts for a single image. The texts will be generated for all enabled languages. Bulk Processing ~~~~~~~~~~~~~~~ 1. Use the checkboxes to select multiple images 2. Click **"Generate for selected"** to process all selected images 3. A progress indicator will show the current status 4. Generated texts will appear in the table as they are completed Editing Texts ------------- You can manually edit any generated text: 1. Click in the textarea containing the text 2. Make your changes 3. Click the save icon (💾) next to the field to save Filtering Images ---------------- The module provides several filter options: - **Show only images with missing texts**: Filter to images that need attention - **Language filter**: Show texts for a specific language - **Pagination**: Navigate through large image collections Token Statistics and Cost Overview ================================== The backend module displays real-time token usage and cost information in the toolbar. Token Display ------------- The toolbar shows: - **Total Tokens**: Sum of all consumed tokens (input + output) - **Estimated Cost**: Calculated costs based on configured token prices - **Cost Limit**: The configured maximum (or "no limit" if not set) - **Warning Icon**: Appears when the cost limit has been exceeded Cost Calculation ---------------- Costs are calculated using the formula: .. code-block:: text Estimated Cost = (Input Tokens / 1000 × costPerInputTokens) + (Output Tokens / 1000 × costPerOutputTokens) The default values correspond to ``gpt-4o-mini`` pricing: - Input: $0.00015 per 1K tokens - Output: $0.0006 per 1K tokens You can adjust these values in the Extension Configuration if you use a different model. Resetting Statistics -------------------- Click the trash icon (🗑️) in the toolbar to reset all token statistics. This will: - Set all token counters to zero - Reset the estimated cost to $0.00 - Clear the cost limit warning (if displayed) .. note:: Resetting statistics does not affect your actual OpenAI account usage or billing. It only resets the local tracking within this extension. Auto-Generation =============== When **Auto-generate on Save** is enabled in the extension configuration, the extension will automatically generate texts when: 1. A ``sys_file_reference`` record is saved 2. The ALT text or title text is empty 3. The referenced file is an image This works for all enabled languages in your site configuration. API Response Format =================== The extension expects the OpenAI API to return a JSON response in this format: .. code-block:: json { "de": { "alt": "German ALT text", "title": "German title text" }, "en": { "alt": "English ALT text", "title": "English title text" } } The language keys correspond to the two-letter ISO codes from your site configuration. Support This Project ==================== Enjoying this extension? Help us keep it maintained and add new features: .. tip:: `Donate via PayPal `__ ❤️ Every contribution, no matter how small, is greatly appreciated!