Skip to content

Commit

Permalink
OPENAI_API_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
terapevt1981 committed Nov 11, 2024
1 parent e50d78f commit 6d2f128
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion translation_service/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
# Базовые настройки сервиса перевода
DATABASE_URL = os.getenv('TRANSLATION_SERVICE_DATABASE_URL')
SERVICE_PORT = int(os.getenv('TRANSLATION_SERVICE_PORT', 8080))
# Получение переменных из окружения

# Получение переменных из окружения с обязательной проверкой
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
if not OPENAI_API_KEY:
raise ValueError("OPENAI_API_KEY must be set in environment variables")

# Получение переменных из окружения
# OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
TRANSLATION_SERVICE_DATABASE_URL = os.getenv('TRANSLATION_SERVICE_DATABASE_URL', '')
TRANSLATION_SERVICE_PORT = os.getenv('TRANSLATION_SERVICE_PORT', '8080')
TRANSLATION_SERVICE_LOG_LEVEL = os.getenv('TRANSLATION_SERVICE_LOG_LEVEL', 'INFO')
Expand Down

0 comments on commit 6d2f128

Please sign in to comment.