fix: read DASHSCOPE_API_KEY from environment in GovDoc2Poster basemodel#549
fix: read DASHSCOPE_API_KEY from environment in GovDoc2Poster basemodel#549Fahmid-Arman wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Fahmid-Arman The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Code Review
This pull request improves API key handling in the base model by retrieving the key from kwargs or falling back to the DASHSCOPE_API_KEY environment variable, raising a ValueError if it is missing. Feedback suggests using or chaining instead of kwargs.get default arguments to robustly handle cases where api_key is explicitly passed as None.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Signed-off-by: Fahmid Arman <fahmid.brac@gmail.com>
659d306 to
21ec00b
Compare
|
Feedback addressed:
/assign @jaypume |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The
GovDoc2Posterexample ignored theDASHSCOPE_API_KEYenvironment variable, defaulting to the hardcoded"your_api"string. This caused downstream LLM/VLM components to fail authentication silently.This PR updates
basemodel.pyto:kwargsor fallback toos.environ.get("DASHSCOPE_API_KEY").ValueErrorif the key is missing or set to the placeholder, enforcing a fail-fast mechanism.Which issue(s) this PR fixes:
Fixes #530