Conversation
- Replace hard-coded API keys with environment variables (GOOGLE_API_KEY, PEXELS_API_KEY) - Add exponential backoff for 429 rate-limits in gemini_brain.py - Add unit tests with mocking (tests/test_gemini_brain.py, tests/test_backoff.py) - Add GitHub Actions CI workflow (.github/workflows/python-tests.yml) - Add .env.example and requirements-dev.txt - Update .gitignore to exclude temp files and build artifacts Co-authored-by: atherion005-byte <239668684+atherion005-byte@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes hardcoded API keys, adds exponential backoff for rate limits, and establishes test infrastructure with CI.
Security
GOOGLE_API_KEYandPEXELS_API_KEYenvironment variablesgemini_brain.py,imagen_brain.py,scan_weapons.py,veo_brain.py,veo_proof.py,pexels_brain.py.env.exampletemplate with required keysReliability
gemini_brain.get_viral_script()retries 429 rate-limit errors with increasing delays (5s → 10s → 20s)retriesandbackoff_factorparameters allow tuningTesting
tests/test_gemini_brain.pyandtests/test_backoff.pyvalidate API key handling and retry behavior.github/workflows/python-tests.ymlruns pytest on push/PRrequirements-dev.txtadded with pytestBuild artifacts
temp_*.mp3,VISUAL_*.png, etc.) and standard Python artifacts