Azure AI API provider: Difference between revisions

From MoodleDocs
No edit summary
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{AI subsystem}}
{{AI subsystem}}
{{Work in progress}}
The Moodle integration with Azure AI provides access to AI actions such as generate text, summarise text and explain text.
{{New features}}


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.
For more information on Azure AI, see the [https://learn.microsoft.com/en-us/azure/ai-services/openai Azure OpenAI documentation].


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==


=== Requirements: ===
You need an active Azure account. If you don't have one, you can create it in the [https://portal.azure.com Azure portal].  
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)
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.)


More information about this can be found in
==Azure AI provider instance set-up==


https://learn.microsoft.com/en-us/azure/ai-services/openai/
To create a provider instance:


https://learn.microsoft.com/en-us/azure/ai-services/openai/overview#how-do-i-get-access-to-azure-openai
# 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'.


=== Configuring Azure AI API provider ===
To configure the Azure AI provider instance:
# Go to Admin -> General -> AI -> AI providers
# 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 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: <nowiki>https://YOUR_RESOURCE_NAME.openai.azure.com</nowiki>
#* 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”
# In the “Actions” area enable all actions by clicking on their “Enabled” toggle.


=== Configuring Azure AI API provider actions ===
# Go to ''Site administration > General > AI providers''.
# Click the settings link for Azure AI.
# Enable/disable actions as required.


===== Generate text: =====
For each action, you can customise the model's behaviour via the settings link.
You can configure the following settings:


* Deployment ID: It can be found in the "Deployments" section within your resource.
# 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; The API version can be found in the '''API Reference''' section of your service. [https://learn.microsoft.com/en-us/azure/ai-services/openai/ Azure API documentation.]
# 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.


* System Instruction: There are some system instructions as default, but this can be adapted to your needs.
To enable the Azure AI provider instance:


===== Summarise text: =====
# Go to ''Site administration > General > AI providers''.
The required configuration is the same as for the Generate text action.
# Click the toggle to enable the instance.


===== Generate image: =====
You can configure the following settings:
* Deployment ID: More information can be found in image generation area of [https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#image-generation Azure API documentation]
* API version.
[[File:Azure AI Provider - Generate text.png|none|thumb|600x600px|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.'''
[[es:Proveedor Azure AI API]]
[[es:Proveedor Azure AI API]]
[[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.