Azure AI API provider: Difference between revisions

From MoodleDocs
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{AI subsystem}}
{{AI subsystem}}
Moodle LMS's integration with Azure AI provides access to AI Actions such as generate text, generate an image or summarise course content.
The Moodle integration with Azure AI provides access to AI actions such as generate text, summarise text and explain text.


For more information about Azure AI, see https://learn.microsoft.com/en-us/azure/ai-services/openai  
For more information on Azure AI, see the [https://learn.microsoft.com/en-us/azure/ai-services/openai Azure OpenAI documentation].


==Requirements==
==Requirements==
An active Azure account. If you don't have one, you can create it through the [https://portal.azure.com Azure portal].


'''Ensure you have an active subscription to access''' [https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits '''Azure AI services''']. Obtain the API key and endpoint from the [https://portal.azure.com Azure Portal] to authenticate your requests (This is found under the "Keys and Endpoint" section of your resource.)
You need an active Azure account. If you don't have one, you can create it in the [https://portal.azure.com Azure portal].  


== Configuring Azure AI API provider==
Make sure you have an active subscription to access [https://learn.microsoft.com/en-us/azure/ai-services/openai/quotas-limits Azure AI services]. Obtain the API key and endpoint from the [https://portal.azure.com Azure portal] to authenticate your requests. (This is found under the "Keys and Endpoint" section of your resource.)


#Go to ''Site administration > General > AI -> AI providers''.
==Azure AI provider instance set-up==
# Enable the "Azure AI API Provider" by clicking on the “Enabled” toggle.
#Click on the "Azure AI API Provider" settings link.
#In the “Settings” area proceed to configure the following:
#*Azure AI API key: You can find the key in your [https://portal.azure.com Azure AI account].
#*Azure AI API endpoint:  Enter the endpoint URL for your Azure AI API, in the following format: <nowiki>https://YOUR_RESOURCE_NAME.openai.azure.com</nowiki>.
#*Set site-wide rate limit:  An optional feature to 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: An optional feature to limit the number of AI requests each user can make to this provider each hour.
#*Maximum number of requests per user can be configured after enabling “Set user rate limit”
# In the “Actions” area you can control which available Actions are enabled and configure further Action settings.


==Configuring Azure AI API provider actions ==
To create a provider instance:
[[File:Azure AI Actions.png|none|thumb|600x600px|Azure AI Actions]]


# Go to ''Site administration > General > AI providers''.
# Click 'Create a new provider instance'.
# Select Azure AI as AI provider plugin, enter a name and Azure AI API key from your [https://portal.azure.com Azure AI account].
# Enter the Azure AI API endpoint URL in the format <nowiki>https://YOUR_RESOURCE_NAME.openai.azure.com</nowiki>.
# If required, set a site-wide rate limit and/or a user rate limit.
# Click 'Create instance'.


The following Action settings are available for the Azure AI API provider
To configure the Azure AI provider instance:
'''Generate text:''' You can configure the following settings:  


* Deployment ID:  The unique identifier assigned to a specific model deployment, which you can find in the "Deployments" section of your Azure OpenAI resource in the Azure Portal.
# Go to ''Site administration > General > AI providers''.
* API version: The API specific version of the API you're interacting with, you can find the latest available version under the "API Management" section of your [https://learn.microsoft.com/en-us/azure/ai-services/openai/ Azure OpenAI] resource.
# Click the settings link for Azure AI.
* System instruction: There are default system instructions in place to help direct the expected response format from the AI, but these can be customised to suit your specific needs. These are used to ensure a smooth user experience where only the requested text generation is returned, with no salutations, repetition of the request etc. It is therefore recommended these are not modified unless you are confident the change is absolutely necessary.
# Enable/disable actions as required.


'''Summarise text:''' The required configuration is the same as for the Generate text Action.  
For each action, you can customise the model's behaviour via the settings link.


'''Generate image:''' You can configure the following settings:
# Deployment ID: The unique identifier assigned to a specific model deployment, which you can find in the "Deployments" section of your Azure OpenAI resource in the Azure Portal.
# API version: You can find the latest available version under the "API Management" section of your [https://learn.microsoft.com/en-us/azure/ai-services/openai/ Azure OpenAI] resource.
# Review and amend the system instruction as necessary.
# Save changes.


* Deployment ID: The unique identifier assigned to the specific DALL-E model deployment, which you can find in the "Deployments" section of your Azure OpenAI resource in the Azure Portal, allowing you to generate images via [https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#image-generation API requests].
To enable the Azure AI provider instance:
* API version. The API specific version of the API you're interacting with, you can find the latest available version under the "API Management" section of your [https://learn.microsoft.com/en-us/azure/ai-services/openai/ Azure OpenAI] resource.
 
# Go to ''Site administration > General > AI providers''.
# Click the toggle to enable the instance.


With all of the above enabled and configured, the Azure AI API provider can be used for all of the AI placements available in your Moodle LMS instance; '''Course Assistance''' and '''HTML Text Editor''' Placements. Don't forget to also enable and configure [[AI placements|'''AI Placements''']] settings. [[File:Azure AI Provider - Generate text.png|none|thumb|600x600px|Azure AI Provider - Generate text]]
[[File:Generate AI Image.png|none|thumb|600x600px|Azure AI Provider - Generate image]] 
[[es:Proveedor Azure AI API]]
[[es:Proveedor Azure AI API]]
[[de:Azure-KI-API-Anbieter]]
[[de:Azure-KI-API-Anbieter]]

Latest revision as of 08:57, 25 June 2025

The Moodle integration with Azure AI provides access to AI actions such as generate text, summarise text and explain text.

For more information on Azure AI, see the Azure OpenAI documentation.

Requirements

You need an active Azure account. If you don't have one, you can create it in the Azure portal.

Make sure you have an active subscription to access Azure AI services. Obtain the API key and endpoint from the Azure portal to authenticate your requests. (This is found under the "Keys and Endpoint" section of your resource.)

Azure AI provider instance set-up

To create a provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click 'Create a new provider instance'.
  3. Select Azure AI as AI provider plugin, enter a name and Azure AI API key from your Azure AI account.
  4. Enter the Azure AI API endpoint URL in the format https://YOUR_RESOURCE_NAME.openai.azure.com.
  5. If required, set a site-wide rate limit and/or a user rate limit.
  6. Click 'Create instance'.

To configure the Azure AI provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the settings link for Azure AI.
  3. Enable/disable actions as required.

For each action, you can customise the model's behaviour via the settings link.

  1. Deployment ID: The unique identifier assigned to a specific model deployment, which you can find in the "Deployments" section of your Azure OpenAI resource in the Azure Portal.
  2. API version: You can find the latest available version under the "API Management" section of your Azure OpenAI resource.
  3. Review and amend the system instruction as necessary.
  4. Save changes.

To enable the Azure AI provider instance:

  1. Go to Site administration > General > AI providers.
  2. Click the toggle to enable the instance.