Skip to content

Commit

Permalink
Add environment variables for API keys
Browse files Browse the repository at this point in the history
  • Loading branch information
haseeb-heaven committed Jan 7, 2024
1 parent 195e5ad commit e96f4fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Set environment variables
run: |
echo "HUGGINGFACE_API_KEY=${{ secrets.HUGGINGFACE_API_KEY }}" >> $GITHUB_ENV
echo "PALM_API_KEY=${{ secrets.PALM_API_KEY }}" >> $GITHUB_ENV
echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV
echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -36,4 +42,4 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python -m unittest discover -s tests
python -m unittest discover -s tests
12 changes: 0 additions & 12 deletions tests/test_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,5 @@ def test_interpreter_gpt_4_model(self):
interpreter = Interpreter(args)
self.assertEqual(interpreter.args.model, 'gpt-4')

def setup_fake_keys():
keys = {
"HUGGINGFACE_API_KEY": "hf_BPubw...",
"PALM_API_KEY": "AIzaSyDlvk....",
"GEMINI_API_KEY": "AIzaSyCl...",
"OPENAI_API_KEY": "sk-ZUZjBz...."
}

with open('.env', 'w') as f:
for key, value in keys.items():
f.write(f'{key}={value}\n')

if __name__ == '__main__':
unittest.main()

0 comments on commit e96f4fd

Please sign in to comment.