Skip to content

Commit

Permalink
Fix WebApps OpenAI usage (#269)
Browse files Browse the repository at this point in the history
The Kernel was never registered in DI, so it wasn't possible to use the AI services.
  • Loading branch information
eerhardt authored Apr 1, 2024
1 parent 7b9fa47 commit 2bb450f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/WebApp/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ private static void AddAIServices(this IHostApplicationBuilder builder)

if (!string.IsNullOrWhiteSpace(builder.Configuration.GetConnectionString("openai")) && !string.IsNullOrWhiteSpace(deploymentName))
{
builder.Services.AddKernel();
builder.AddAzureOpenAI("openai");
builder.Services.AddAzureOpenAIChatCompletion(deploymentName);
}
Expand Down

0 comments on commit 2bb450f

Please sign in to comment.