Azure AI API provider

From MoodleDocs
Revision as of 07:37, 16 October 2024 by Raquel Ortega (talk | contribs) (Update documentation)

Note: This page is a work-in-progress. Feedback and suggested improvements are welcome. Please join the discussion on moodle.org or use the page comments.


New feature
in Moodle 4.5!


Moodle integration with Azure AI provides a service that lets people use advanced AI tools like generate a text, generate an image or summarize a text.

More information and documentation about Azure AI can be found on the following link https://learn.microsoft.com/en-us/azure/ai-services/openai

Requirements:

Create an Azure account if you don’t already have one. You can sign up for a free account on the Azure portal.

Ensure you have an active subscription to access Azure AI services. Go to the Azure Portal and sign in with your Azure account.  Obtain the API key and endpoint from the Azure portal to authenticate your requests (Keys and Endpoint” can be found under the Resource Management section)

More information about this can be found in

https://learn.microsoft.com/en-us/azure/ai-services/openai/

https://learn.microsoft.com/en-us/azure/ai-services/openai/overview#how-do-i-get-access-to-azure-openai

Configuring Azure AI API provider

  1. Go to Admin -> General -> AI -> AI providers
  2. Enable the "Azure AI API Provider" by clicking on the “Enabled” toggle.
  3. Click on the "Azure AI API Provider" settings link.
  4. In the “Settings” area proceed to configure the following:
    • Azure AI API key: You can get the key from your Azure AI account
    • Azure AI API endpoint:  Enter the endpoint URL for your Azure AI API, in the following format: https://YOUR_RESOURCE_NAME.openai.azure.com
    • Set site-wide rate limit: Limit the number of requests that the Azure AI API provider can receive across the entire site every hour.
    • Maximum number of site-wide requests can be configured after enable “Set site-wide rate limit”
    • Set user rate limit
    • Maximum number of requests per user can be configured after enable “Set user rate limit”
  5. In the “Actions” area enable all actions by clicking on their “Enabled” toggle.

Configuring Azure AI API provider actions

Generate text: You can configure the following settings:

  • Deployment ID: It can be found in the "Deployments" section within your resource.
  • API version; The API version can be found in the API Reference section of your service. Azure API documentation.
  • System Instruction: There are some system instructions as default, but this can be adapted to your needs.


Summarise text: The required configuration is the same as for the Generate text action.

Generate image: You can configure the following settings:

  • API version.
Azure AI Provider - Generate text


Now we should be able to use Azure AI API provider for the AI placements available in our Moodle instance: Course Assistance and HTML Text Editor Placements.

Don't forget to enable and configure AI Placements settings.