You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update configuration error messages for Endpoint and ApiKey
Refactor the retrieval of `Endpoint` and `ApiKey` from the application configuration.
The error messages have been made more specific by changing the context from "AzureOpenAi:Endpoint" to "Endpoint" and from "AzureOpenAi:ApiKey" to "ApiKey".
This improves clarity in error reporting when these configuration values are missing.
Copy file name to clipboardExpand all lines: common/microsoft-extensions-ai-integration/AIPromptIntegration/AIPromptIntegration/Program.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,9 @@
25
25
// dotnet user-secrets set ApiKey super-secret-api-key
26
26
27
27
// 🌐 The Uri of your provider
28
-
varendpoint=builder.Configuration["Endpoint"]??thrownewInvalidOperationException("Missing configuration: AzureOpenAi:Endpoint. See the README for details.");
28
+
varendpoint=builder.Configuration["Endpoint"]??thrownewInvalidOperationException("Missing configuration: Endpoint. See the README for details.");
29
29
// 🔑 The API Key for your provider
30
-
varapikey=builder.Configuration["ApiKey"]??thrownewInvalidOperationException("Missing configuration: AzureOpenAi:ApiKey. See the README for details.");
30
+
varapikey=builder.Configuration["ApiKey"]??thrownewInvalidOperationException("Missing configuration: ApiKey. See the README for details.");
0 commit comments