Skip to content

Commit 0d1b218

Browse files
committed
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.
1 parent 66cea27 commit 0d1b218

File tree

1 file changed

+2
-2
lines changed
  • common/microsoft-extensions-ai-integration/AIPromptIntegration/AIPromptIntegration

1 file changed

+2
-2
lines changed

common/microsoft-extensions-ai-integration/AIPromptIntegration/AIPromptIntegration/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
// dotnet user-secrets set ApiKey super-secret-api-key
2626

2727
// 🌐 The Uri of your provider
28-
var endpoint = builder.Configuration["Endpoint"] ?? throw new InvalidOperationException("Missing configuration: AzureOpenAi:Endpoint. See the README for details.");
28+
var endpoint = builder.Configuration["Endpoint"] ?? throw new InvalidOperationException("Missing configuration: Endpoint. See the README for details.");
2929
// 🔑 The API Key for your provider
30-
var apikey = builder.Configuration["ApiKey"] ?? throw new InvalidOperationException("Missing configuration: AzureOpenAi:ApiKey. See the README for details.");
30+
var apikey = builder.Configuration["ApiKey"] ?? throw new InvalidOperationException("Missing configuration: ApiKey. See the README for details.");
3131
// 🧠 The model name or azure deployment name
3232
var model = "YOUR_MODEL_NAME";
3333

0 commit comments

Comments
 (0)