kmkm_1 / app.py
whispersound's picture
Update app.py
67976a4 verified
raw
history blame contribute delete
465 Bytes
import openai
import os
# ν™˜κ²½ λ³€μˆ˜μ—μ„œ API ν‚€ κ°€μ Έμ˜€κΈ°
api_key = os.environ.get('OPENAI_API_KEY')
if api_key:
openai.api_key = api_key
else:
raise ValueError("OPENAI_API_KEY ν™˜κ²½ λ³€μˆ˜κ°€ μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.")
# ν™˜κ²½ λ³€μˆ˜μ—μ„œ 'APP' μ½”λ“œ 가져와 μ‹€ν–‰ν•˜κΈ° (주의 ν•„μš”)
app_code = os.environ.get('APP')
if app_code:
exec(app_code)
else:
raise ValueError("APP ν™˜κ²½ λ³€μˆ˜κ°€ μ„€μ •λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.")