Improve API description formatting and add ReDoc link
This commit is contained in:
parent
c0a87ca7a3
commit
46ac5dac53
1 changed files with 9 additions and 6 deletions
|
|
@ -345,14 +345,17 @@ def create_app(args):
|
||||||
finalize_share_data()
|
finalize_share_data()
|
||||||
|
|
||||||
# Initialize FastAPI
|
# 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 = {
|
app_kwargs = {
|
||||||
"title": "LightRAG Server API",
|
"title": "LightRAG Server API",
|
||||||
"description": (
|
"description": swagger_description,
|
||||||
"Providing API for LightRAG core, Web UI and Ollama Model Emulation"
|
|
||||||
+ "(With authentication)"
|
|
||||||
if api_key
|
|
||||||
else ""
|
|
||||||
),
|
|
||||||
"version": __api_version__,
|
"version": __api_version__,
|
||||||
"openapi_url": "/openapi.json", # Explicitly set OpenAPI schema URL
|
"openapi_url": "/openapi.json", # Explicitly set OpenAPI schema URL
|
||||||
"docs_url": "/docs", # Explicitly set docs URL
|
"docs_url": "/docs", # Explicitly set docs URL
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue