diff --git a/src/Libraries/Microsoft.Extensions.AI/README.md b/src/Libraries/Microsoft.Extensions.AI/README.md index eb091eb0435..5354e0ccc5c 100644 --- a/src/Libraries/Microsoft.Extensions.AI/README.md +++ b/src/Libraries/Microsoft.Extensions.AI/README.md @@ -83,3 +83,12 @@ Optionally also run the following. The values shown here are the defaults if you dotnet user-secrets set AzureAIInference:ChatModel gpt-4o-mini dotnet user-secrets set AzureAIInference:EmbeddingModel text-embedding-3-small ``` + +### Configuring Ollama tests + +Run commands like the following. The settings will be saved in your user profile. + +``` +cd test/Libraries/Microsoft.Extensions.AI.Integration.Tests +dotnet user-secrets set Ollama:Endpoint http://localhost:11434/ +``` diff --git a/test/Libraries/Microsoft.Extensions.AI.Ollama.Tests/IntegrationTestHelpers.cs b/test/Libraries/Microsoft.Extensions.AI.Ollama.Tests/IntegrationTestHelpers.cs index d25d750ce37..2cd17719e74 100644 --- a/test/Libraries/Microsoft.Extensions.AI.Ollama.Tests/IntegrationTestHelpers.cs +++ b/test/Libraries/Microsoft.Extensions.AI.Ollama.Tests/IntegrationTestHelpers.cs @@ -13,7 +13,8 @@ internal static class IntegrationTestHelpers /// Gets a to use for testing, or null if the associated tests should be disabled. public static Uri? GetOllamaUri() { - // return new Uri("http://localhost:11434"); - return null; + return TestRunnerConfiguration.Instance["Ollama:Endpoint"] is string endpoint + ? new Uri(endpoint) + : null; } }