Update app.py
Browse files
app.py
CHANGED
|
@@ -3,13 +3,12 @@ import openai
|
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
|
| 5 |
|
| 6 |
-
API_KEY = "
|
| 7 |
|
| 8 |
# Write the API key to the .env file
|
| 9 |
with open(".env", "w") as env_file:
|
| 10 |
env_file.write(f"openai_api_key={API_KEY}\n")
|
| 11 |
|
| 12 |
-
#echo openai_api_key="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" > .env
|
| 13 |
|
| 14 |
load_dotenv(".env")
|
| 15 |
|
|
|
|
| 3 |
from dotenv import load_dotenv
|
| 4 |
|
| 5 |
|
| 6 |
+
API_KEY = os.getenv("open_ai_key")
|
| 7 |
|
| 8 |
# Write the API key to the .env file
|
| 9 |
with open(".env", "w") as env_file:
|
| 10 |
env_file.write(f"openai_api_key={API_KEY}\n")
|
| 11 |
|
|
|
|
| 12 |
|
| 13 |
load_dotenv(".env")
|
| 14 |
|