Skip to main content

Azure AI Inference Chat Feature

Feature NameAzure AI Inference Chat
Feature IDCrestApps.OrchardCore.AzureAIInference

Provides a way to interact with GitHub Models using Azure Inference service provider.

Overview

The Azure AI Inference Chat feature enhances the AI Services functionality by integrating GitHub models using Azure AI Inference provider. It provides a suite of services to interact with these models, enabling advanced AI capabilities.

Configuration

To configure the OpenAI connection, add the following settings to the appsettings.json file:

{
"OrchardCore": {
"CrestApps_AI": {
"Providers": {
"AzureAIInference": {
"DefaultConnectionName": "default",
"Connections": {
"default": {
"Endpoint": "https://<!-- Your Azure Resource Name -->.services.ai.azure.com/models",
"AuthenticationType": "ApiKey",
"ApiKey": "<!-- Your GitHub Access Token goes here -->",
"Deployments": [
{ "Name": "Phi-3-medium-4k-instruct", "Type": "Chat", "IsDefault": true },
{ "Name": "Phi-3-medium-4k-instruct", "Type": "Utility", "IsDefault": true }
]
}
}
}
}
}
}
}
Legacy Format (Deprecated)

The following format using ChatDeploymentName, UtilityDeploymentName, etc. is still supported but deprecated. Existing configurations will be auto-migrated at runtime.

{
"Connections": {
"default": {
"Endpoint": "https://my-resource.services.ai.azure.com/models",
"AuthenticationType": "ApiKey",
"ApiKey": "...",
"ChatDeploymentName": "Phi-3-medium-4k-instruct",
"UtilityDeploymentName": "Phi-3-medium-4k-instruct",
"EmbeddingDeploymentName": "",
"ImagesDeploymentName": ""
}
}
}

Authentication Type in the connection can be Default, ManagedIdentity or ApiKey. When using ApiKey authentication type, ApiKey is required.

When using ManagedIdentity, you can optionally provide an IdentityId to use a user-assigned managed identity. If IdentityId is omitted or empty, the system-assigned managed identity is used.

{
"Connections": {
"default": {
"Endpoint": "https://my-resource.services.ai.azure.com/models",
"AuthenticationType": "ManagedIdentity",
"IdentityId": "<!-- Optional: client ID of a user-assigned managed identity -->"
}
}
}

For detailed instructions on creating Azure AI Inference and obtaining the Endpoint, refer to the official documentation.