-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
30 lines (27 loc) · 998 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using api_transcript_service.Util;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.SemanticKernel;
string _apiDeploymentName = Helper.GetEnvironmentVariable("ApiDeploymentName");
string _apiEndpoint = Helper.GetEnvironmentVariable("ApiEndpoint");
string _apiKey = Helper.GetEnvironmentVariable("ApiKey");
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
services.AddSingleton<Kernel>(s =>
{
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(
_apiDeploymentName,
_apiEndpoint,
_apiKey
);
return builder.Build();
});
})
.Build();
host.Run();