CrestApps Banner
  • Home
  • Orchard Core
  • Integrating AI Features into Your Orchard Core Project: A Guide for .NET Developers

Integrating AI Features into Your Orchard Core Project: A Guide for .NET Developers

Blog Post default image

Integrating AI into Orchard Core with CrestApps

Artificial Intelligence (AI) is transforming how web applications are developed and interacted with. As a .NET developer working with Orchard Core, you can enhance your applications by incorporating AI-driven functionalities. In this guide, we’ll walk you through integrating AI features into Orchard Core CMS using the CrestApps.OrchardCore.AI package and its implementations.


Prerequisites

Before you begin, ensure you have the following:

  • An Orchard Core CMS project set up and running.
  • A basic understanding of NuGet and Orchard Core’s module system.
  • Access to Azure OpenAI, DeepSeek, or another supported AI provider.

Step 1: Install the AI Services Module

The AI Services module provides the foundational infrastructure for AI integration in Orchard Core.

Installation Steps (With User Interface)

  1. Open your Orchard Core web project in Visual Studio or your preferred IDE.
  2. Install the CrestApps.OrchardCore.AI.Chat package using NuGet:
    Install-Package CrestApps.OrchardCore.AI.Chat
    
  3. Once installed, a new Artificial Intelligence menu item will appear in Orchard Core, along with a Profiles submenu.
Here is a sneek peak of the Chat-UI using the backend

<img src="https://github.com/CrestApps/CrestApps.OrchardCore/blob/main/docs/images/admin-ui-sample.gif" class="img-fluid" alt="AI Chat using the OrchardCore's backend" />

Here is a sneek peak of the Chat-UI using the frontend Widget

<img src="https://github.com/CrestApps/CrestApps.OrchardCore/blob/main/docs/images/admin-ui-sample.gif" class="img-fluid" alt="AI Chat using the OrchardCore's frontend widget" />

Installation Steps (With no User Interface)

  1. Open your Orchard Core web project in Visual Studio or your preferred IDE.
  2. Install the CrestApps.OrchardCore.AI package using NuGet:
    Install-Package CrestApps.OrchardCore.AI
    
  3. Once installed, a new Artificial Intelligence menu item will appear in Orchard Core, along with a Profiles submenu.

Step 2: Understanding AI Profiles

An AI Profile defines how the chatbot interacts with users. The module supports three profile types:

  • Chat: A fully interactive chatbot for multi-turn conversations.
  • Utility: Provides one-time responses, useful for workflow automation.
  • Template Generated Prompt: Uses Liquid syntax to create dynamic prompts, ideal for content summarization and structured responses.

You can configure AI Profiles within the Orchard Core Dashboard to customize chatbot behavior according to your needs.


Step 3: Choose Your AI Implementation

The CrestApps.OrchardCore.AI module is flexible and supports multiple AI providers, including:

  • Azure OpenAI
  • DeepSeek
  • OpenAI
  • Ollama (for local testing)
  • Azure AI Inference

Below, we explore the primary implementations and their configurations.

Azure OpenAI Integration

Install the Module

Use NuGet to install the Azure OpenAI module:

Install-Package CrestApps.OrchardCore.OpenAI.Azure

Configure Azure OpenAI

Modify appsettings.json to establish a connection with Azure OpenAI:

{
  "OrchardCore": {
    "CrestApps_AI": {
      "Providers": {
        "Azure": {
          "DefaultConnectionName": "your-connection-name",
          "DefaultDeploymentName": "your-deployment-name",
          "Connections": {
            "your-connection-name": {
              "Endpoint":"https://<!-- Your Azure Resource Name -->.openai.azure.com/",
              "AuthenticationType": "ApiKey",
              "ApiKey":"<!-- API Key to connect to your Azure AI instance -->",
              "DefaultDeploymentName": "the default deployment name for this connection"
            }
          }
        }
      }
    }
  }
}

Enable Azure OpenAI Features

  1. Enable the Azure OpenAI Chat feature in the Orchard Core Dashboard.
  2. Create an AI Profile and select Azure OpenAI as the provider.
  3. If using Chat with Your Data, configure Azure AI Search for custom datasets.

With Azure OpenAI, you can create intelligent chatbots, automate customer support, and enhance user interactions effortlessly.


OpenAI Integration

Install the Module

Install-Package CrestApps.OrchardCore.OpenAI

Configure OpenAI

Configure the settings using any settings provider. To configure the service with DeepSeek credentials using appsettings.json:

{
  "OrchardCore": {
    "CrestApps_AI": {
      "Providers": {
        "OpenAI": {
          "DefaultConnectionName": "openai-cloud",
          "DefaultDeploymentName": "gpt-4o-mini",
          "Connections": {
            "openai-cloud": {
              "ApiKey": "your-openai-api-key",
              "DefaultDeploymentName": "gpt-4o-mini",
            }
          }
        }
      }
    }
  }
}

To obtain an API key, visit the OpenAI Platform.

Enable OpenAI in Orchard Core

  1. Enable OpenAI Chat feature in the Orchard Core Dashboard.
  2. Navigate to Artificial Intelligence > Profiles and create a new AI Profile.
  3. Select OpenAI as the AI provider, configure the settings, and save.

Once set up, your DeepSeek AI chatbot will be available in Orchard Core.

DeepSeek Integration

The AI module allows seamless integration with any provider that follows OpenAI standards. DeepSeek is one such provider, offering an API compatible with OpenAI. This compatibility enables effortless connection using OpenAI's interface. First be sure to following "OpenAI Integration" section above. Then to configure the settings using any settings provider. To configure the service with DeepSeek credentials using appsettings.json:

{
  "OrchardCore": {
    "CrestApps_AI": {
      "Providers": {
        "OpenAI": {
          "DefaultConnectionName": "deepseek-cloud",
          "DefaultDeploymentName": "deepseek-chat",
          "Connections": {
            "deepseek": {
              "Endpoint": "https://api.deepseek.com/v1",
              "ApiKey": "your-deepseek-api-key",
              "DefaultDeploymentName": "deepseek-chat"
            }
          }
        }
      }
    }
  }
}

Other AI Implementations

CrestApps also provides implementations for:

  • Azure AI Inference
  • Ollama (for local testing)

You may look at the documentation in the repository for more info: https://github.com/CrestApps/CrestApps.OrchardCore


Managing Provider Connections

The AI module includes an AI Connection Management feature that allows you to manage provider connections through the user interface at the tenant level, instead of relying on the appsettings.json file, which applies to all tenants.

To get started, first enable the AI Connection Management feature, then follow these steps:

Enabling AI Connection Management

  1. In the Orchard Core Dashboard, enable the AI Connection Management feature.
  2. Navigate to Artificial Intelligence > Connections and create a new provider connection.
  3. Choose your preferred provider, configure the necessary settings, and save.

Once set up, the connection will be available for use with any of your AI profiles.


Extending AI Models with Custom Functions in Orchard Core

Want to see how easy it is to add custom functions? Click here to read the full article.

Conclusion

Integrating AI into Orchard Core is now easier than ever with the CrestApps AI package. Whether you opt for Azure OpenAI for enterprise-grade AI services or DeepSeek for flexible AI interactions, you can enhance your CMS with intelligent chatbot solutions and AI-driven workflows.

By following this guide, you can quickly configure AI services in Orchard Core and unlock innovative functionalities for your applications. Start exploring AI capabilities today and transform how users interact with your platform!


Additional Resources