Skip to content

Commit 4c438ba

Browse files
authored
Fixing compiler warning and adding some error handling
Fixing compiler warning and adding some error handling
2 parents 17fa5f6 + 6f98568 commit 4c438ba

File tree

1 file changed

+1
-1
lines changed
  • 02-SettingUp.NETDev/src/BasicChat-01MEAI

1 file changed

+1
-1
lines changed

02-SettingUp.NETDev/src/BasicChat-01MEAI/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
IChatClient client = new ChatCompletionsClient(
66
endpoint: new Uri("https://models.inference.ai.azure.com"),
7-
new AzureKeyCredential(Environment.GetEnvironmentVariable("GITHUB_TOKEN")))
7+
new AzureKeyCredential(Environment.GetEnvironmentVariable("GITHUB_TOKEN") ?? throw new InvalidOperationException("Missing GITHUB_TOKEN environment variable. Ensure you followed the instructions to setup a GitHub Token to use GitHub Models.")))
88
.AsChatClient("Phi-3.5-MoE-instruct");
99

1010
var response = await client.CompleteAsync("What is AI?");

0 commit comments

Comments
 (0)