Services
Core service interfaces for AI operations.
Umbraco.AI provides core services for AI operations. All services are registered with dependency injection and can be injected into controllers, composers, or other services.
Available Services
Service
Purpose
Chat completions (streaming and non-streaming)
Text embedding generation
Profile CRUD operations
Connection management
Usage Pattern
All services follow standard dependency injection patterns:
using Umbraco.AI.Core.Chat;
using Umbraco.AI.Core.Profiles;
public class MyController : Controller
{
private readonly IAIChatService _chatService;
private readonly IAIProfileService _profileService;
public MyController(IAIChatService chatService, IAIProfileService profileService)
{
_chatService = chatService;
_profileService = profileService;
}
public async Task<IActionResult> Chat()
{
var messages = new[] { new ChatMessage(ChatRole.User, "Hello") };
var response = await _chatService.GetChatResponseAsync(
chat => chat.WithAlias("content-chat"),
messages);
return Ok(response.Message.Text);
}
}In This Section
IAIChatServiceIAIEmbeddingServiceIAIProfileServiceIAIConnectionServiceLast updated
Was this helpful?