GenerativeAIExamples icon indicating copy to clipboard operation
GenerativeAIExamples copied to clipboard

log_analysis_multi_agent_rag: Support API key environment variables from main documentation

Open ftclausen opened this issue 1 month ago • 0 comments

Firstly, thanks for giving this example! We want to use this kind of approach to triage our logs and this is a great start.

I have been reading these docs and also some references elsewhere to configure my API keys. I initially set NGC_API_KEY and then NVIDIA_API_KEY expecting the underlying libraries to use these automatically if present but I kept getting unauthorized responses from the API endpoints.

Digging into the libraries in the log_analysis_multi_agent_rag example, I saw that the .env environment variable API_KEY is the only one supported. In order to prevent confusion for others in the future, I have extended utils.py to also support querying the standard environment variables if present. If not present then the old behaviour is preserved.

Finally, adding API keys to a file managed in Git is a security risk because it is easy to accidentally commit .env and push it up. By allowing the user to set their own environment variables outside of the repo we can avoid that risk.

ftclausen avatar Oct 14 '25 03:10 ftclausen