Azure AI API provider: Difference between revisions

From MoodleDocs
No edit summary
mNo edit summary
Line 3: Line 3:
{{New features}}
{{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.
Moodle integration with Azure AI provides a service that lets people use advanced AI tools like generate a text, generate an image or summarise 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
More information about Azure AI can be found at https://learn.microsoft.com/en-us/azure/ai-services/openai  


=== Requirements: ===
=== Requirements: ===
Create an Azure account if you don’t already have one. You can sign up for a free account on the Azure portal.  
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 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)
An active subscription to access [https://learn.microsoft.com/en-us/azure/ai-services/openai/ Azure AI services].


More information about this can be found in
Ensure you have an active subscription to access 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.)


https://learn.microsoft.com/en-us/azure/ai-services/openai/
=== Configuring Azure AI API provider ===


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 -> AI providers
 
=== Configuring Azure AI API provider ===
# Go to Admin -> General -> AI -> AI providers
# Enable the "Azure AI API Provider" by clicking on the “Enabled” toggle.
# Enable the "Azure AI API Provider" by clicking on the “Enabled” toggle.
# Click on the "Azure AI API Provider" settings link.
# Click on the "Azure AI API Provider" settings link.
# In the “Settings” area proceed to configure the following:  
# 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 key: You can get the key from 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>
#* 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.
#* 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”
#* Maximum number of site-wide requests can be configured after enable “Set site-wide rate limit”
#* Set user 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 enable “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.
# In the “Actions” area you can control which available Actions are enabled and configure further Action settings.
 
=== Configuring Azure AI API Provider Actions ===
[[File:Azure AI Actions.png|none|thumb|600x600px|Azure AI Actions]]


=== Configuring Azure AI API provider actions ===


===== Generate text: =====
The following Action settings are available for the Azure AI API Provider.
You can configure the following settings:


* Deployment ID: It can be found in the "Deployments" section within your resource. 
'''Generate text:''' You can configure the following settings:  
* 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.]


* System Instruction: There are some system instructions as default, but this can be adapted to your needs.
* 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 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.
* System Instruction: There are default system instructions in place, but these can be customised to suit your specific needs.


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


===== Generate image: =====
'''Generate image:''' You can configure the following settings:
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]  
* 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].
* 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.
*


* API version.
[[File:Azure AI Provider - Generate text.png|none|thumb|600x600px|Azure AI Provider - Generate text]]
[[File:Azure AI Provider - Generate text.png|none|thumb|600x600px|Azure AI Provider - Generate text]]
   
   
 
With the above enabled and configured, the Azure AI API Provider can be used for 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.
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]]

Revision as of 13:43, 17 October 2024

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 5.2!


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

More information about Azure AI can be found at https://learn.microsoft.com/en-us/azure/ai-services/openai

Requirements:

An active Azure account. If you don’t have one, you can create it through the Azure portal.

An active subscription to access Azure AI services.

Ensure 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.)

Configuring Azure AI API provider

  1. Go to Site administration -> 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:  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 enable “Set user rate limit”
  5. In the “Actions” area you can control which available Actions are enabled and configure further Action settings.

Configuring Azure AI API Provider Actions

Azure AI Actions


The following Action settings are available for the Azure AI API Provider.

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.
  • 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 Azure OpenAI resource.
  • System Instruction: There are default system instructions in place, but these can be customised to suit your specific needs.

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

Generate image: You can configure the following settings:

  • 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 API requests.
  • 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 Azure OpenAI resource.
Azure AI Provider - Generate text

With the above enabled and configured, the Azure AI API Provider can be used for 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 settings.