-
New Feature
-
Resolution: Done
-
Minor
-
None
-
Future Dev
-
MDL-80889-main-s1 -
-
10
-
Team Hedgehog 2024 Review 2, Team Hedgehog 2024 Sprint 3.1
Implement the initial AI subsystem into Moodle LMS.
Working to the guide that the AI subsystem will: provide a consistent and user-friendly way for users to interact with AI in Moodle's user interface, as they do their teaching and learning activities. As well as providing a straightforward way to integrate with various AI providers on the backend.
An overview of the approach is as follows:
Overview:
Broadly the AI subsystem will provide several "Placements". These placements will be UI elements (and associated workflows) in specific user contexts, that will allow users to interact with AI services connected to Moodle LMS. For example when a teacher creates course content, or when a student is interacting with their course content. Placements will also be LMS plugins, allowing for placements to be added overtime and developed by the community.
The available Placements will allow users to access one or more AI "Actions". These actions are provided by the AI services connected to LMS and are the specific things a user can do. For example when creating course content a teacher could access an action to create an image. Or for students they could use an action to summarise complex text.
The available Actions will be determined by which AI "Providers" the LMS instance is connected to. These providers are connected to LMS via "Provider Plugins". Each provider plugin will make available one or more actions to the LMS. For example a plugin that connects to the OpenAI API could provide an action that summarises text. OR a Midjourney provider plugin could provide an action to generate an image.
To help separate out the design and development activities there are individual (linked) trackers to cover: Placements, Actions and Providers.
TODO:
- Individual Provider settings:
- Move the “save changes button from below the “Provider actions” toggles to above, so it sits under the “Provider Specific settings”
- Hide the “Provider Specific settings” (with the save button) if the provider doesn’t have any specific settings. (This behaviour will be copied for Placements too).
- Enable toggle functionality for the “Provider actions”. Currently clicking the toggles to individually enable/disable the actions a Provider supports doesn’t work. They should update via Ajax when clicked, just like enabling the provider plugins themselves. Also the status of the actions should be saved as part of the provider plugin config. Currently only the Provider specific settings are saved
- Come up with an inherited/programatic way to render the provider actions on the admin settings page. Currently this requires some code to be copied and pasted into each of the provider plugin `settings.php`. This should just be done automatically, unless a provider wants to override it.
- Individual Placement settings:
- The exact same todo’s exist for placements as they do for providers.
Action class namespaceCurrently the action classes namespace is `core_ai\actions\responses` path is `aii/classes/actions` this needs to be updated from “actions” to “aiactions”Add an entry to `lib/apis.json`, this needs to be:
```
"aiactions": { "component": "core_ai", "allowedlevel2": true, "allowedspread": false }
,
```
- Privacy API
- The core ai subsystem stores user data and data about the requests made to the AI. There needs to be correct Privacy API support for this. (DB tables already exist for the implemented actions).
Summarise Text ActionThis action only has an initial (empty class) implemented. This action will need to be implemented forMDL-80890to work.
- Unit test coverage
- There is unit test coverage for existing functions. But like everything it could be better. Will need to review and address any gaps.
- Behat test coverage
- There are currently zero behat tests. However, we should be able to add them for some of the admin settings. This might be blocked until we have some providers and placements ready to go.
- General clean up
- The code isn’t in a bad state in general and once the above is done it should be pretty good to go. But it would be worth checking and fixing things as we go