Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
  • Loading branch information
stephentoub and eerhardt authored Nov 22, 2024
1 parent 491ca3c commit 929fc83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Catalog.API/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void AddApplicationServices(this IHostApplicationBuilder builder)
else if (!string.IsNullOrWhiteSpace(builder.Configuration.GetConnectionString("openai")))
{
builder.AddOpenAIClientFromConfiguration("openai");
builder.Services.AddEmbeddingGenerator(s => s.GetRequiredService<OpenAIClient>().AsEmbeddingGenerator(builder.Configuration["AI:OpenAI:EmbeddingModel"]!))
builder.Services.AddEmbeddingGenerator(sp => sp.GetRequiredService<OpenAIClient>().AsEmbeddingGenerator(builder.Configuration["AI:OpenAI:EmbeddingModel"]!))
.UseOpenTelemetry()
.UseLogging()
.Build();
Expand Down
2 changes: 1 addition & 1 deletion src/WebApp/Extensions/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static void AddAIServices(this IHostApplicationBuilder builder)
if (!string.IsNullOrWhiteSpace(builder.Configuration.GetConnectionString("openai")) && !string.IsNullOrWhiteSpace(chatModel))
{
builder.AddOpenAIClientFromConfiguration("openai");
builder.Services.AddChatClient(s => s.GetRequiredService<OpenAIClient>().AsChatClient(chatModel ?? "gpt-4o-mini"))
builder.Services.AddChatClient(sp => sp.GetRequiredService<OpenAIClient>().AsChatClient(chatModel ?? "gpt-4o-mini"))
.UseFunctionInvocation()
.UseOpenTelemetry(configure: t => t.EnableSensitiveData = true)
.UseLogging()
Expand Down

0 comments on commit 929fc83

Please sign in to comment.