OpenAI API provider: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 25: Line 25:
.[[File:OpenAI.jpg|none|thumb|600x600px|OpenAI Dashboard]]
.[[File:OpenAI.jpg|none|thumb|600x600px|OpenAI Dashboard]]


==== Configuring OpenAI API provider actions ====
 
====Configuring OpenAI API provider actions====
[[File:OpenAI Actions.png|none|thumb|600x600px|OpenAI Actions]]
[[File:OpenAI Actions.png|none|thumb|600x600px|OpenAI Actions]]
Access to the Settings link on each action to configure them.  
Access to the Settings link on each action to configure them.  




'''Generate text''': You can configure the following settings:  
'''Generate text''': You can configure the following settings:
 
*AI model: OpenAI API is powered by a diverse set of models with different capabilities and price points. There is more information about OpenAI models in the following link https://platform.openai.com/docs/models  As default is set to “GPT-4o” but it can be change for any other compatible model, see your settings organization limits for more information (https://platform.openai.com/settings/organization/limits)
 
*API endpoint. Please ensure your API endpoint is compatible with your Model, see more information in the following link https://platform.openai.com/docs/models/model-endpoint-compatibility


* AI model: OpenAI API is powered by a diverse set of models with different capabilities and price points. There is more information about OpenAI models in the following link https://platform.openai.com/docs/models  As default is set to “GPT-4o” but it can be change for any other compatible model, see your settings organization limits for more information (https://platform.openai.com/settings/organization/limits)
*System instruction: There are some system instructions as default, but this can be adapted to your needs.


* API endpoint. Please ensure your API endpoint is compatible with your Model, see more information in the following link https://platform.openai.com/docs/models/model-endpoint-compatibility


* 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.   
'''Summarise text:''' The required configuration is the same as for the Generate text action.   


'''Generate image''': You can configure the following settings:


* AI model: As default is set to “dall-e-3” but it can be changed for any other image generation compatible model. See more information in the following link https://platform.openai.com/docs/models/dall-e  
'''Generate image''': You can configure the following settings: 
 
*AI model: As default is set to “dall-e-3” but it can be changed for any other image generation compatible model. See more information in the following link https://platform.openai.com/docs/models/dall-e
* API endpoint:  Please ensure your API endpoint is compatible with your Model.
* API endpoint:  Please ensure your API endpoint is compatible with your Model.


[[File:Generate text in OpenAI.png|none|thumb|600x600px|Generate text in OpenAI]]
[[File:Generate text in OpenAI.png|none|thumb|600x600px|Generate text in OpenAI]]
Line 48: Line 53:


Now we should be able to use OpenAI 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|AI Placements]] settings.  
Now we should be able to use OpenAI 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|AI Placements]] settings.  




[[es:Proveedor OpenAI API]]
[[es:Proveedor OpenAI API]]

Revision as of 19:02, 15 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.0!


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

More information about OpenAI can be found on the following link https://platform.openai.com

Requirements:

An OpenAI account with access to the API key (Usage limits and pricing tiers are dependent on the level of access and the volume of queries).

Configuring OpenAI API provider settings

  1. Go to Admin -> General -> AI -> AI providers
  2. Enable the "OpenAI API Provider" by clicking on the “Enabled” toggle.
  3. Click on the "OpenAI API Provider" settings link.
  4. In the “Settings” area proceed to configure the following:
    • OpenAI API key: You can get the key from your OpenAI account / API Keys (OpenAI API keys).
    • OpenAI organization ID: You can get it from  your OpenAI account / Organization settings page (OpenAI account).
    • Set site-wide rate limit: Limit the number of requests that the OpenAI 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.

.

OpenAI Dashboard


Configuring OpenAI API provider actions

OpenAI Actions

Access to the Settings link on each action to configure them.


Generate text: You can configure the following settings:

  • 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:

  • AI model: As default is set to “dall-e-3” but it can be changed for any other image generation compatible model. See more information in the following link https://platform.openai.com/docs/models/dall-e
  • API endpoint:  Please ensure your API endpoint is compatible with your Model.


Generate text in OpenAI


Now we should be able to use OpenAI 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.