-
New Feature
-
Resolution: Done
-
Minor
-
None
-
Future Dev
-
MDL-80891-main -
-
10
-
Team Hedgehog 2024 Review 2, Team Hedgehog 2024 Sprint 3.1
Provide a way for users to interact with an AI action to generate an image or text based on a description and LMS contextual information, from within the TinyMCE editor interface and allow this image to be inserted into existing content. Both images and text will be implemented together as they are different actions within the same placement (so there is a lot of reusable code).
Inline with our AI Principles we will need to provide notification to users that they are using an AI enhanced service, and provide them a way to understand what this means.
Base code for this issue is available here, and further changes should be based on these commits: **
https://github.com/moodle/moodle/compare/main...mattporritt:moodle:main_MDL-80891
Please arrange a handover session with matt.porritt@moodle.com prior to commencing any work on this issue.
Below details outline image and text information, and the todo lists are tasks not yet completed in the provided branch.
Image action
Image metadata should indicate that the image was generated (or altered) using AI.
Images TODO:
- Action selection:
- Currently the action selection displayed in the toolbar and Insert menu of TinyMCE do not respect the enabled action settings for this Placement, only enabled actions should be available
- Related to the above only actions that have a provider that can provide the action should be available
- Related to the above only users with the required capability for that action in this placement should be able to use the action. The capabilities already exist, they are just not being respected.
- We should follow the same pattern as what was implemented in
MDL-81212for how to display the actions.
- Error handling:
- There is currently error handling if the API returns an error, but it is general
- We should add a specific message for when the error is due to a rate limit
- We should add a specific message for when the error is due to a content moderation or AI guard rail issue.
- There is currently a “bug” where after an error with generating an image and then the next generation succeeds, the error class isn’t removed from the preview window.
- Handoff to image management
- After the image is generated and it is “handed off” to the regular LMS Image insertion workflow, there is currently a JS error being thrown.
- Use the user description that made the image to prefill the alt tag field for the image
- Use the image dimensions to prefill the image size attributes
- Watermark
- Add a watermark to the generated image to say it was generated by AI. (Depending on timing this could be a follow up issue).
Text action
This covers the initial implementation which will be basic text generation and insertion. There will be a follow up issue to add greater configuration options later.
generated text content should be tagged (indicated in markup etc.) that it was generated with the assistance of AI, to allow future identification of AI generated content.
Technical Spike Plugin: https://github.com/mattporritt/moodle-tiny_ai
Text TODO:
- Action selection:
- Currently the action selection displayed in the toolbar and Insert menu of TinyMCE do not respect the enabled action settings for this Placement, only enabled actions should be available
- Related to the above only actions that have a provider that can provide the action should be available
- Related to the above only users with the required capability for that action in this placement should be able to use the action. The capabilities already exist, they are just not being respected.
- We should follow the same pattern as what was implemented in
MDL-81212for how to display the actions.
- Error handling:
- There is currently error handling if the API returns an error, but it is general
- We should add a specific message for when the error is due to a rate limit
- We should add a specific message for when the error is due to a content moderation or AI guard rail issue.
- There is currently a “bug” where after an error with generating an image and then the next generation succeeds, the error class isn’t removed from the preview window.