From e2c700bec609a45cddb61be827ee356bab08ad92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viviana=20Due=C3=B1as=20Chavez?= Date: Thu, 25 Sep 2025 07:52:31 -0700 Subject: [PATCH 1/3] Move Ollama-specific HTTP client resiliency configuration out of Extensions.cs in ServiceDefaults --- .../Extensions.cs | 13 -------- .../Program.Aspire.cs | 32 +++++++++++++++++++ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.ServiceDefaults/Extensions.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.ServiceDefaults/Extensions.cs index 108f1ed2a08..2fa2f11898e 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.ServiceDefaults/Extensions.cs +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.ServiceDefaults/Extensions.cs @@ -29,21 +29,8 @@ public static TBuilder AddServiceDefaults(this TBuilder builder) where http.RemoveAllResilienceHandlers(); #pragma warning restore EXTEXP0001 -#if (IsOllama) - // Turn on resilience by default - http.AddStandardResilienceHandler(config => - { - // Extend the HTTP Client timeout for Ollama - config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); - - // Must be at least double the AttemptTimeout to pass options validation - config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); - config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); - }); -#else // Turn on resilience by default http.AddStandardResilienceHandler(); -#endif // Turn on service discovery by default http.AddServiceDiscovery(); diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs index 84475f45a54..7be37f1174c 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs @@ -50,6 +50,38 @@ #endif builder.Services.AddScoped(); builder.Services.AddSingleton(); +#if (IsOllama) +// Get the IHttpClientBuilder for chat_httpClient +var chatClientBuilder = builder.Services.AddHttpClient("chat_httpClient"); +#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental +chatClientBuilder.RemoveAllResilienceHandlers(); +#pragma warning restore EXTEXP0001 +// Override resilience for this client +chatClientBuilder.AddStandardResilienceHandler(config => +{ + // Extend the HTTP Client timeout for Ollama + config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); + // Must be at least double the AttemptTimeout to pass options validation + config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); + config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); +}); +chatClientBuilder.AddServiceDiscovery(); +// Get the IHttpClientBuilder for embeddings_httpClient +var embeddingsClientBuilder = builder.Services.AddHttpClient("embeddings_httpClient"); +#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental +embeddingsClientBuilder.RemoveAllResilienceHandlers(); +#pragma warning restore EXTEXP0001 +// Override resilience for this client +embeddingsClientBuilder.AddStandardResilienceHandler(config => +{ + // Extend the HTTP Client timeout for Ollama + config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); + // Must be at least double the AttemptTimeout to pass options validation + config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); + config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); +}); +embeddingsClientBuilder.AddServiceDiscovery(); +#endif var app = builder.Build(); From 3c3ebe65ca0738f835aed641e93ddcaedbc4cd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viviana=20Due=C3=B1as=20Chavez?= Date: Mon, 29 Sep 2025 15:07:20 -0700 Subject: [PATCH 2/3] PR feedback: Add an extension method to handle Ollama's resilience handler settings instead of the hardcoded calls in Web/Program.cs --- .../.template.config/template.json | 7 ++++ ...AspireOllamaResilienceHandlerExtensions.cs | 34 ++++++++++++++++++ .../Program.Aspire.cs | 35 +++---------------- .../aichatweb.ServiceDefaults/Extensions.cs | 10 +----- ...AspireOllamaResilienceHandlerExtensions.cs | 34 ++++++++++++++++++ .../aichatweb/aichatweb.Web/Program.cs | 5 +++ 6 files changed, 86 insertions(+), 39 deletions(-) create mode 100644 src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs create mode 100644 test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json index d95f7c41c13..a1d0b589aaa 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json @@ -60,10 +60,17 @@ "ChatWithCustomData-CSharp.AppHost/**", "ChatWithCustomData-CSharp.ServiceDefaults/**", "ChatWithCustomData-CSharp.Web/Program.Aspire.cs", + "ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs", "README.Aspire.md", "*.sln" ] }, + { + "condition": "(IsAspire && !IsOllama)", + "exclude": [ + "ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs" + ] + }, { "condition": "(IsAspire)", "exclude": [ diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs new file mode 100644 index 00000000000..6a2584098aa --- /dev/null +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Extensions.DependencyInjection; + +namespace ChatWithCustomData_CSharp.Web.Services; + +public static class AspireOllamaResilienceHandlerExtensions +{ + public static IServiceCollection AddOllamaHttpClientResilience(this IServiceCollection services) + { + services.ConfigureHttpClientDefaults(http => + { +#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental + http.RemoveAllResilienceHandlers(); +#pragma warning restore EXTEXP0001 + + // Turn on resilience by default + http.AddStandardResilienceHandler(config => + { + // Extend the HTTP Client timeout for Ollama + config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); + + // Must be at least double the AttemptTimeout to pass options validation + config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); + config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); + }); + + // Turn on service discovery by default + http.AddServiceDiscovery(); + }); + + return services; + } +} + diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs index 7be37f1174c..2d1ea72e10a 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs @@ -51,36 +51,11 @@ builder.Services.AddScoped(); builder.Services.AddSingleton(); #if (IsOllama) -// Get the IHttpClientBuilder for chat_httpClient -var chatClientBuilder = builder.Services.AddHttpClient("chat_httpClient"); -#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental -chatClientBuilder.RemoveAllResilienceHandlers(); -#pragma warning restore EXTEXP0001 -// Override resilience for this client -chatClientBuilder.AddStandardResilienceHandler(config => -{ - // Extend the HTTP Client timeout for Ollama - config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); - // Must be at least double the AttemptTimeout to pass options validation - config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); - config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); -}); -chatClientBuilder.AddServiceDiscovery(); -// Get the IHttpClientBuilder for embeddings_httpClient -var embeddingsClientBuilder = builder.Services.AddHttpClient("embeddings_httpClient"); -#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental -embeddingsClientBuilder.RemoveAllResilienceHandlers(); -#pragma warning restore EXTEXP0001 -// Override resilience for this client -embeddingsClientBuilder.AddStandardResilienceHandler(config => -{ - // Extend the HTTP Client timeout for Ollama - config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); - // Must be at least double the AttemptTimeout to pass options validation - config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); - config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); -}); -embeddingsClientBuilder.AddServiceDiscovery(); +// Applies robust HTTP resilience settings for all HttpClients in the Web project, +// not across the entire solution. It's aimed at supporting Ollama scenarios due +// to its self-hosted nature and potentially slow responses. +// Remove this if you want to use the global or a different HTTP resilience policy instead. +builder.Services.AddOllamaHttpClientResilience(); #endif var app = builder.Build(); diff --git a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.ServiceDefaults/Extensions.cs b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.ServiceDefaults/Extensions.cs index 81cc28b27d2..f56908872e0 100644 --- a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.ServiceDefaults/Extensions.cs +++ b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.ServiceDefaults/Extensions.cs @@ -30,15 +30,7 @@ public static TBuilder AddServiceDefaults(this TBuilder builder) where #pragma warning restore EXTEXP0001 // Turn on resilience by default - http.AddStandardResilienceHandler(config => - { - // Extend the HTTP Client timeout for Ollama - config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); - - // Must be at least double the AttemptTimeout to pass options validation - config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); - config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); - }); + http.AddStandardResilienceHandler(); // Turn on service discovery by default http.AddServiceDiscovery(); diff --git a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs new file mode 100644 index 00000000000..f3f7c5ebf4d --- /dev/null +++ b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs @@ -0,0 +1,34 @@ +using System; +using Microsoft.Extensions.DependencyInjection; + +namespace aichatweb.Web.Services; + +public static class AspireOllamaResilienceHandlerExtensions +{ + public static IServiceCollection AddOllamaHttpClientResilience(this IServiceCollection services) + { + services.ConfigureHttpClientDefaults(http => + { +#pragma warning disable EXTEXP0001 // RemoveAllResilienceHandlers is experimental + http.RemoveAllResilienceHandlers(); +#pragma warning restore EXTEXP0001 + + // Turn on resilience by default + http.AddStandardResilienceHandler(config => + { + // Extend the HTTP Client timeout for Ollama + config.AttemptTimeout.Timeout = TimeSpan.FromMinutes(3); + + // Must be at least double the AttemptTimeout to pass options validation + config.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(10); + config.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(10); + }); + + // Turn on service discovery by default + http.AddServiceDiscovery(); + }); + + return services; + } +} + diff --git a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs index cdc88a082b7..7d0b86dd330 100644 --- a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs +++ b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs @@ -20,6 +20,11 @@ builder.Services.AddQdrantCollection("data-aichatweb-documents"); builder.Services.AddScoped(); builder.Services.AddSingleton(); +// Applies robust HTTP resilience settings for all HttpClients in the Web project, +// not across the entire solution. It's aimed at supporting Ollama scenarios due +// to its self-hosted nature and potentially slow responses. +// Remove this if you want to use the global or a different HTTP resilience policy instead. +builder.Services.AddOllamaHttpClientResilience(); var app = builder.Build(); From 285693bbd09bd155bfbd2c4c016d27ac7bd9beea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viviana=20Due=C3=B1as=20Chavez?= Date: Tue, 30 Sep 2025 13:12:38 -0700 Subject: [PATCH 3/3] Address PR feedback. Rename extension class/method --- .../src/ChatWithCustomData/.template.config/template.json | 5 ++--- ...lerExtensions.cs => OllamaResilienceHandlerExtensions.cs} | 4 ++-- .../ChatWithCustomData-CSharp.Web/Program.Aspire.cs | 2 +- ...lerExtensions.cs => OllamaResilienceHandlerExtensions.cs} | 4 ++-- .../aichatweb/aichatweb.Web/Program.cs | 2 +- 5 files changed, 8 insertions(+), 9 deletions(-) rename src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/{AspireOllamaResilienceHandlerExtensions.cs => OllamaResilienceHandlerExtensions.cs} (86%) rename test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/{AspireOllamaResilienceHandlerExtensions.cs => OllamaResilienceHandlerExtensions.cs} (86%) diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json index a1d0b589aaa..3c5ca06f86d 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/.template.config/template.json @@ -60,15 +60,14 @@ "ChatWithCustomData-CSharp.AppHost/**", "ChatWithCustomData-CSharp.ServiceDefaults/**", "ChatWithCustomData-CSharp.Web/Program.Aspire.cs", - "ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs", "README.Aspire.md", "*.sln" ] }, { - "condition": "(IsAspire && !IsOllama)", + "condition": "(!IsAspire || !IsOllama)", "exclude": [ - "ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs" + "ChatWithCustomData-CSharp.Web/OllamaResilienceHandlerExtensions.cs" ] }, { diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/OllamaResilienceHandlerExtensions.cs similarity index 86% rename from src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs rename to src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/OllamaResilienceHandlerExtensions.cs index 6a2584098aa..fed9c91ca93 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/AspireOllamaResilienceHandlerExtensions.cs +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/OllamaResilienceHandlerExtensions.cs @@ -3,9 +3,9 @@ namespace ChatWithCustomData_CSharp.Web.Services; -public static class AspireOllamaResilienceHandlerExtensions +public static class OllamaResilienceHandlerExtensions { - public static IServiceCollection AddOllamaHttpClientResilience(this IServiceCollection services) + public static IServiceCollection AddOllamaResilienceHandler(this IServiceCollection services) { services.ConfigureHttpClientDefaults(http => { diff --git a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs index 2d1ea72e10a..243aa46c8d7 100644 --- a/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs +++ b/src/ProjectTemplates/Microsoft.Extensions.AI.Templates/src/ChatWithCustomData/ChatWithCustomData-CSharp.Web/Program.Aspire.cs @@ -55,7 +55,7 @@ // not across the entire solution. It's aimed at supporting Ollama scenarios due // to its self-hosted nature and potentially slow responses. // Remove this if you want to use the global or a different HTTP resilience policy instead. -builder.Services.AddOllamaHttpClientResilience(); +builder.Services.AddOllamaResilienceHandler(); #endif var app = builder.Build(); diff --git a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/OllamaResilienceHandlerExtensions.cs similarity index 86% rename from test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs rename to test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/OllamaResilienceHandlerExtensions.cs index f3f7c5ebf4d..ae82393302c 100644 --- a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/AspireOllamaResilienceHandlerExtensions.cs +++ b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/OllamaResilienceHandlerExtensions.cs @@ -3,9 +3,9 @@ namespace aichatweb.Web.Services; -public static class AspireOllamaResilienceHandlerExtensions +public static class OllamaResilienceHandlerExtensions { - public static IServiceCollection AddOllamaHttpClientResilience(this IServiceCollection services) + public static IServiceCollection AddOllamaResilienceHandler(this IServiceCollection services) { services.ConfigureHttpClientDefaults(http => { diff --git a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs index 7d0b86dd330..c67c70db5d6 100644 --- a/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs +++ b/test/ProjectTemplates/Microsoft.Extensions.AI.Templates.IntegrationTests/Snapshots/aichatweb.Ollama_Qdrant.verified/aichatweb/aichatweb.Web/Program.cs @@ -24,7 +24,7 @@ // not across the entire solution. It's aimed at supporting Ollama scenarios due // to its self-hosted nature and potentially slow responses. // Remove this if you want to use the global or a different HTTP resilience policy instead. -builder.Services.AddOllamaHttpClientResilience(); +builder.Services.AddOllamaResilienceHandler(); var app = builder.Build();