From 90887eef60c03c532533cb563be22b121cce18b1 Mon Sep 17 00:00:00 2001 From: Anthony Phan <131195703+antphan12@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:15:01 -0500 Subject: [PATCH] Fixing Google API key --- CulinaryCommandApp/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CulinaryCommandApp/Program.cs b/CulinaryCommandApp/Program.cs index 2c9c932..9803278 100644 --- a/CulinaryCommandApp/Program.cs +++ b/CulinaryCommandApp/Program.cs @@ -119,7 +119,10 @@ // ===================== // AI Services // ===================== -builder.Services.AddSingleton(_ => new Client()); +var googleApiKey = builder.Configuration["Google:ApiKey"] + ?? Environment.GetEnvironmentVariable("GOOGLE_API_KEY") + ?? throw new InvalidOperationException("Missing config: Google:ApiKey (or GOOGLE_API_KEY env var)."); +builder.Services.AddSingleton(new Client(apiKey: googleApiKey)); builder.Services.AddScoped(); //