move key to .env

This commit is contained in:
Daniel Cronin 2024-10-22 03:58:34 -05:00
parent 083f67763b
commit 45071812c3
2 changed files with 5 additions and 1 deletions

1
epb_site/epb_site/.env Normal file
View File

@ -0,0 +1 @@
GEMINI_API_KEY=AIzaSyAYt9n5dF2ZwOVYTbPV4_T5S0La2u5i1LU

View File

@ -1,7 +1,10 @@
import os
import google.generativeai as genai
from dotenv import load_dotenv
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
load_dotenv()
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
# Create the model
generation_config = {