Custom Providers
Create custom AI providers to support additional AI services.
Providers are plugins that connect Umbraco.AI to AI services. Create a custom provider to add support for AI services not included out of the box.
Provider Architecture
A provider consists of:
Provider class - Main class with
[AIProvider]attributeSettings class - Configuration properties with
[AIField]attributesCapability classes - Implementations for Chat, Embedding, and so on
MyProvider/
├── MyProvider.cs # Main provider class
├── MyProviderSettings.cs # Settings with [AIField] attributes
├── MyChatCapability.cs # Chat capability implementation
└── MyEmbeddingCapability.cs # Embedding capability (optional)Quick Start
1. Create a Settings Class
using Umbraco.AI.Core.EditableModels;
public class MyProviderSettings
{
[AIField(Label = "API Key", Description = "Your API key", IsSensitive = true)]
public string? ApiKey { get; set; }
[AIField(Label = "Endpoint", Description = "API endpoint URL")]
public string? Endpoint { get; set; }
}2. Create a Chat Capability
3. Create the Provider Class
How It Works
Providers are discovered automatically via assembly scanning
The
[AIProvider]attribute registers the provider with an ID and nameSettings are rendered in the backoffice using
[AIField]metadataCapabilities are registered in the constructor with
WithCapability<T>()
In This Section
Creating a ProviderProvider SettingsChat CapabilityEmbedding CapabilityLast updated
Was this helpful?