Integrating OpenAI with Sitefinity CMS

sitefinity | 2023-11-20

⚙️ Prerequisites

Ensure that you have the following before proceeding:

  1. Sitefinity CMS 15.0+ (or higher)
  2. Progress.Sitefinity.AIServiceConnector NuGet package installed
  3. Azure Subscription with appropriate permissions

☁️ Setting Up Azure OpenAI

Follow these steps to configure Azure OpenAI for integration with Sitefinity:

1. Access Azure Portal

Go to the Azure Portal and log in with your Azure credentials.

2. Create a Resource Group

Create a new Resource Group within your Azure Subscription to organize your OpenAI resources.

3. Create an OpenAI Service

Within the resource group, create a new Azure OpenAI service.

screen1

4. Search and Select OpenAI

In the Azure Marketplace, search for "OpenAI", select Azure OpenAI, and create the service.

screen2

5. Obtain API Keys and Endpoint

Navigate to Keys and Endpoints in the Azure OpenAI service. Save either KEY 1 or KEY 2 and the Endpoint for later use.

screen3

6. Access Azure OpenAI Studio

In the Overview section, click Go to Azure OpenAI Studio to start configuring your OpenAI models.

screen4

7. Create a Deployment

In the Azure OpenAI Studio, create a new Deployment and select the gpt-35-turbo model. Set a Deployment Name.

screen5

8. Save the Deployment Name

Remember the Deployment Name as it will be required for Sitefinity configuration.


🏗️ Configuring Sitefinity

1. Install the AIServiceConnector NuGet Package

In your Sitefinity project, install the Progress.Sitefinity.AIServiceConnector NuGet package to enable AI service integration.

2. Log in to Sitefinity CMS Dashboard

Log into your Sitefinity CMS Dashboard, and navigate to Administration → Modules & Services.

3. Install AI Services

Install the AI Services module in Sitefinity to enable AI functionalities.

screen6

4. Configure AI Services

Go to Administration → Settings → AI Services to configure the API keys and endpoints:

  • API Key: Use either KEY 1 or KEY 2 from Azure (Step 5 above).
  • Endpoint: Use the Endpoint provided by Azure.
  • Deployment Name: Enter the Deployment Name from Azure.

screen7

5. Set API Version

Check the stable API Version by clicking the question mark tooltip. In this demo, we are using version 2023-05-15.

screen8

6. Save and Restart

Save your changes and restart the Sitefinity instance to ensure the configuration is applied correctly. (Restart is required for proper integration).


📱 Sitefinity OpenAI Integration Demo

1. Create a Content Block

Log into Sitefinity CMS, navigate to Content → Content Blocks, and create a new content block.

2. Open the Content Editor

In the content editor, you will see an AI button that enables the integration of OpenAI.

3. Available AI Features

The AI button supports three key options:

screen9

4. Generate Content

Select Compose new text, provide the necessary details, and let the AI assist in generating content.

screen10

5. Insert or Modify Content

Once the content is generated, you can insert it into your content block or modify it further as needed.

screen11

screen12

6. Generate Tags with AI (Sitefinity 15.1)

In Sitefinity 15.1, you can also generate tags for content using AI. For example, the article on Sport Singapore launches fairer facility booking platform is tagged using AI.

7. Generate Tags with AI

Click the "Use AI" icon next to the tags section, and the AI will generate relevant tags for your content.

screen13

screen14

8. Save and Review Generated Tags

Once you save, you’ll see the new AI-generated tags attached to the article.

screen15


📚 References