Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82626

Site registration: AI usage

XMLWordPrintable

    • MOODLE_405_STABLE
    • MDL-82626-main
    • Hide

      There is a unit test for the new method which collects the AI usage data.

      Setup

      1. Use a Moodle site that has not been registered yet.
      2. Use Ngrok or similar to create a publicly accessible Moodle site.

      Manual testing

      1. Checkout the 'main' branch (don't use this patch yet).
      2. Log in as admin
      3. Go to Site admin -> General -> Registration
      4. Fill out the form and register your site
      5. Ensure that your site is now registered before proceeding.
      6. Apply this patch and purge your caches.
      7. Go to the registration page again.
      8. CONFIRM there is a banner stating 'Registration information has been changed ...'
      9. Expand the 'More information' section
      10. CONFIRM there is a new list item regarding 'AI usage stats' and that it is highlighted.
      11. Click the 'Update registration' button
      12. CONFIRM you see a banner stating 'Site registration updated'
      Show
      There is a unit test for the new method which collects the AI usage data. Setup Use a Moodle site that has not been registered yet. Use Ngrok or similar to create a publicly accessible Moodle site. Manual testing Checkout the 'main' branch (don't use this patch yet). Log in as admin Go to  Site admin -> General -> Registration Fill out the form and register your site Ensure that your site is now registered before proceeding. Apply this patch and purge your caches. Go to the registration page again. CONFIRM there is a banner stating 'Registration information has been changed ...' Expand the 'More information' section CONFIRM there is a new list item regarding 'AI usage stats' and that it is highlighted. Click the 'Update registration' button CONFIRM you see a banner stating 'Site registration updated'
    • 6
    • Team Hedgehog 2024 Sprint 3.1, Team Hedgehog 2024 Sprint 3.2

      With the new AI subsystem introduced in MDL-80889, we need to collect usage data from registered sites for this new functionality. This will be valuable in understanding the usage of the subsystem in LMS and be a necessary source of data for further development as we continue to improve and extend the AI functionality in LMS.

      The `ai_action_register` table that is introduced by MDL-80889 contains the raw data we want. Processing will be required to aggregate and extract only the required data. Primarily we are after information about:

      • How many actions were processed in a given time period (time between registration data update periods ~ 1 week),
      • What provider was used for the action
      • What was the success rate of the calls
      • What was the majority error code for failures
      • The time range used to collect the data

      In JSON the extracted data will look something like:

      {
          "OpenAI API Provider": {
              "generate_text": {
                  "success_count": 3,
                  "fail_count": 1,
                  "predominant_error": 403,
                  "average_time": 2
              },
              "generate_image": {
                  "success_count": 1,
                  "fail_count": 1,
                  "predominant_error": 403,
                  "average_time": 20
              }
          },
          "time_range": {
              "timefrom": 1723001586,
              "timeto": 1723606386
          }
      },
      {
          "Azure": {
              "generate_text": {
                  "success_count": 3,
                  "fail_count": 1,
                  "predominant_error": 403,
                  "average_time": 2
              },
              "generate_image": {
                  "success_count": 1,
                  "fail_count": 1,
                  "predominant_error": 403,
                  "average_time": 20
              }
          },
          "time_range": {
              "timefrom": 1723001586,
              "timeto": 1723606386
          }
      }

      In the above example the data is grouped by provider, with the actions underneath. It could also be grouped by action and then provider. There are going to be more actions than providers in a standard install.

      The specified metrics we want to collect above don't include any, but to be extra clear this work doesn't extract or transmit any personal data (PII).

            david.woloszyn@moodle.com David Woloszyn
            matt.porritt@moodle.com Matt Porritt
            Meirza Meirza
            Jun Pataleta Jun Pataleta
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour
                1d 1h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.