diff --git a/backend/main.py b/backend/main.py index bef3b94..7933bdc 100644 --- a/backend/main.py +++ b/backend/main.py @@ -19,8 +19,18 @@ from prompts import assemble_prompt from routes import screenshot from access_token import validate_access_token + +# Useful for debugging purposes when you don't want to waste GPT4-Vision credits +# Setting to True will stream a mock response instead of calling the OpenAI API +# TODO: Should only be set to true when value is 'True', not any abitrary truthy value +SHOULD_MOCK_AI_RESPONSE = bool(os.environ.get("MOCK", False)) + +# Set to True when running in production (on the hosted version) +# Used as a feature flag to enable or disable certain features +IS_PROD = os.environ.get("IS_PROD", False) + # Setup Sentry (only relevant in prod) -if os.environ.get("IS_PROD"): +if IS_PROD: import sentry_sdk SENTRY_DSN = os.environ.get("SENTRY_DSN") @@ -45,17 +55,6 @@ app.add_middleware( allow_headers=["*"], ) - -# Useful for debugging purposes when you don't want to waste GPT4-Vision credits -# Setting to True will stream a mock response instead of calling the OpenAI API -# TODO: Should only be set to true when value is 'True', not any abitrary truthy value -SHOULD_MOCK_AI_RESPONSE = bool(os.environ.get("MOCK", False)) - -# Set to True when running in production (on the hosted version) -# Used as a feature flag to enable or disable certain features -IS_PROD = os.environ.get("IS_PROD", False) - - app.include_router(screenshot.router)