Improve API description formatting and add ReDoc link

This commit is contained in:
yangdx 2025-10-17 16:24:01 +08:00
parent c0a87ca7a3
commit 46ac5dac53

View file

@ -345,14 +345,17 @@ def create_app(args):
finalize_share_data()
# Initialize FastAPI
base_description = (
"Providing API for LightRAG core, Web UI and Ollama Model Emulation"
)
swagger_description = (
base_description
+ (" (With authentication)" if api_key else "")
+ "\n\n[View ReDoc documentation](/redoc)"
)
app_kwargs = {
"title": "LightRAG Server API",
"description": (
"Providing API for LightRAG core, Web UI and Ollama Model Emulation"
+ "(With authentication)"
if api_key
else ""
),
"description": swagger_description,
"version": __api_version__,
"openapi_url": "/openapi.json", # Explicitly set OpenAPI schema URL
"docs_url": "/docs", # Explicitly set docs URL