From e0e5bddb3f41e338c342c82ca63369fd04701db4 Mon Sep 17 00:00:00 2001 From: Kohulan Date: Mon, 10 Feb 2025 16:40:09 +0100 Subject: [PATCH] fix: main text --- app/main.py | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/app/main.py b/app/main.py index 9771bbf..4dbe14f 100644 --- a/app/main.py +++ b/app/main.py @@ -7,6 +7,7 @@ from fastapi.responses import RedirectResponse from fastapi_versioning import VersionedFastAPI from prometheus_fastapi_instrumentator import Instrumentator +from typing import Dict from .routers import chem from .routers import converters @@ -20,20 +21,37 @@ if os.getenv("INCLUDE_OCSR", "true").lower() == "true": from .routers import ocsr -app = FastAPI( - title="Cheminformatics Microservice", - description="This set of essential and valuable microservices is designed to be accessed via API calls to support cheminformatics. Generally, it is designed to work with SMILES-based inputs and could be used to translate between different machine-readable representations, get Natural Product (NP) likeliness scores, visualize chemical structures, and generate descriptors. In addition, the microservices also host an instance of STOUT and another instance of DECIMER (two deep learning models for IUPAC name generation and optical chemical structure recognition, respectively).", - terms_of_service="https://docs.api.naturalproducts.net", - contact={ - "name": "Steinbeck Lab", - "url": "https://cheminf.uni-jena.de/", - "email": "caffeine@listserv.uni-jena.de", - }, - license_info={ - "name": "CC BY 4.0", - "url": "https://creativecommons.org/licenses/by/4.0/", - }, -) + +def create_app_metadata() -> Dict: + return { + "title": "Cheminformatics API", + "description": """This set of essential and valuable microservices is designed to be accessed via API calls to support cheminformatics. Generally, it is designed to work with SMILES-based inputs and could be used to translate between different machine-readable representations, get Natural Product (NP) likeliness scores, visualize chemical structures, and generate descriptors. In addition, the microservices also host an instance of DECIMER (a deep learning model for optical chemical structure recognition). + """, + "version": "3.0.2", + "terms_of_service": "https://docs.api.naturalproducts.net", + "contact": { + "name": "Steinbeck Lab", + "url": "https://cheminf.uni-jena.de", + "email": "caffeine@listserv.uni-jena.de" + }, + "license_info": { + "name": "CC BY 4.0", + "url": "https://creativecommons.org/licenses/by/4.0" + }, + "openapi_tags": [{ + "name": "Chemical Analysis", + "description": "Advanced molecular structure analysis and property prediction" + }, { + "name": "Visualization", + "description": "High-fidelity chemical structure rendering and visualization" + }, { + "name": "Conversion", + "description": "Sophisticated molecular format transformation tools" + }] + } + + +app = FastAPI(**create_app_metadata()) app.include_router(chem.router) app.include_router(converters.router)