Configure API Keys for Azure OpenAI

Azure OpenAI

In this example, we are using Azure OpenAI to generate the keys.

Note: You will likely need a paid plan and have to pay per usage. See here for up-to-date details and pricing .

Platforms will always change so this guide may not reflect 100% process.

:information_source: In order to use certain AI modules, users must have an API Key from a 3rd party provider such as OpenAI (ChatGPT), Anthropic (Claude), Stability AI (Stable Diffusion), etc

Please check each AI module to see which 3rd party providers can be used for it.

Obtain API keys

  1. First you will need to request access for Azure OpenAI
  2. Once accepted, agree to their pricing and terms
  3. Go through the documentation here to obtain the necessary API keys depending on the OpenAI models you choose and the Discourse AI modules/features you use
  4. Once the keys are obtained, store them in a safe and secure place and copy it

Using API keys for Discourse AI

  1. Go to Admin settings from the sidebar or profile and then Plugins
  2. Search or find Discourse AI and click settings
  3. Search or find the following settings and input your copied-over the keys

The settings will depend on the OpenAI model you choose and the Discourse AI modules/features you use

  • ai openai API key: API key for OpenAI API
  • ai openai embeddings url: Custom URL used for OpenAI embeddings API (use specific URL for Azure)
  • ai openai gpt35 url: Custom URL used for GPT 3.5 chat completions
  • ai openai gpt35 16k url: Custom URL used for GPT 3.5 16k context chat completions
  • ai openai gpt4 url: Custom URL used for GPT 4 chat completions
  • ai openai gpt4 32k url: Custom URL used for GPT 4 32k context chat completions

2 Likes

Hello,

Iā€™m encountering an issue with the OpenAI Azure endpoint. It seems not to be working as expected for the following URL:

https://***.openai.azure.com/openai/deployments/DEPLOYMENT_NAME/chat/completions?api-version=2023-07-01-preview

Where DEPLOYMENT_NAME is set to gpt-4-32k.

Could you please assist in resolving this issue? Any guidance or suggestions would be greatly appreciated.

Additionally, I have some queries regarding Discourse plugins:

  1. How to Fork a Discourse Plugin: Could you provide detailed instructions or a guide on how to fork an existing Discourse plugin?
  2. Testing the Forked Plugin: Once I have forked a plugin, what are the steps to test this forked version on my own Discourse instance?
  3. Uploading and Activating the Plugin: After testing, how can I upload and activate this forked plugin on my Discourse instance?

Your assistance with these queries would be extremely helpful. Thank you for your time and support.

Best regards,

1 Like