init receiver UI web project using devexpress template

This commit is contained in:
2026-05-13 10:39:55 +02:00
parent 8d9480ed71
commit 48bbadc906
58 changed files with 1988 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
using Azure;
using Azure.AI.OpenAI;
using Microsoft.Extensions.AI;
namespace EnvelopeGenerator.ReceiverUI.Web.Client.Utils
{
public static class ServiceExtensions
{
// Demo AI services are rate limited and intended for demonstration purposes only.
// DevExpress does not offer a REST API and does not ship any built-in LLMs/SLMs.
// Use of demo credentials in production is strictly prohibited.
// Specify the Azure OpenAI endpoint, key, and deployment name in the 'appsettings.json' file.
public static void AddChatClient(this IServiceCollection services, string aiEndpoint, string aiKey, string deployment)
{
services.AddDevExpressAI();
services.AddScoped<IChatClient>(_ =>
{
var azureClient = new AzureOpenAIClient(new Uri(aiEndpoint), new AzureKeyCredential(aiKey));
return azureClient
.GetChatClient(deployment)
.AsIChatClient();
});
}
}
}