diff --git a/app/app.py b/app/app.py index 96ac8c4..069e667 100755 --- a/app/app.py +++ b/app/app.py @@ -7,7 +7,7 @@ app = FastAPI( title="Grammatical Error Correction", - version=api_settings.version, + version=api_settings.version if api_settings.version else "dev", description="A service that performs automatic grammatical error correction." ) @@ -15,8 +15,7 @@ CORSMiddleware, allow_origins=["*"], allow_methods=["*"], - allow_headers=["*"], - allow_credentials=True, + allow_headers=["*"] ) @@ -42,7 +41,7 @@ async def shutdown(): @app.get('/health/startup', include_in_schema=False) @app.get('/health/liveness', include_in_schema=False) async def health_check(): - # Returns 200 the connection to RabbitMQ is up + # Returns 200 if connection to RabbitMQ is up if mq_connector.channel is None or mq_connector.channel.is_closed: raise HTTPException(500) return "OK" diff --git a/app/config.py b/app/config.py index efe9e75..ff70c8e 100755 --- a/app/config.py +++ b/app/config.py @@ -1,3 +1,4 @@ +from typing import Optional from pydantic import BaseSettings, validator @@ -14,9 +15,9 @@ class Config: class APISettings(BaseSettings): - version: str max_input_length: int = 10000 languages: str = "et" # comma-separated list of 2-letter codes + version: Optional[str] @validator('languages') def list_languages(cls, v): diff --git a/requirements.txt b/requirements.txt index 06482f0..e85c427 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aio-pika==8.0.3 -fastapi==0.78.0 -uvicorn==0.18.2 -pydantic==1.9.1 \ No newline at end of file +aio-pika==9.4.0 +fastapi==0.109.2 +uvicorn==0.27.1 +pydantic<2.0.0 \ No newline at end of file