feat: add MOCK env variable for debugging

purposes
This commit is contained in:
vagusx 2023-11-22 14:17:03 +08:00
parent 9811b8a7f7
commit ba9aa55041
2 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,9 @@ echo "OPENAI_API_KEY=sk-your-key" > .env
poetry install
poetry shell
poetry run uvicorn main:app --reload --port 7001
# Useful for debugging purposes when you don't want to waste GPT4-Vision credits
MOCK=true poetry run uvicorn main:app --reload --port 7001
```
Run the frontend:

View File

@ -33,7 +33,7 @@ app.add_middleware(
# 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
SHOULD_MOCK_AI_RESPONSE = False
SHOULD_MOCK_AI_RESPONSE = os.environ.get("MOCK", False)
app.include_router(screenshot.router)