@@ -61,59 +61,100 @@ async def health_check() -> dict[str, str]:
6161async def head_root () -> HTMLResponse :
6262 """Respond to HTTP HEAD requests for the root URL.
6363
64- Mirrors the headers and status code of the index page.
64+ **This endpoint mirrors the headers and status code of the index page**
65+ for HTTP HEAD requests, providing a lightweight way to check if the server
66+ is responding without downloading the full page content.
6567
66- Returns
67- -------
68- HTMLResponse
69- An empty HTML response with appropriate headers.
68+ **Returns**
69+
70+ - **HTMLResponse**: An empty HTML response with appropriate headers
7071
7172 """
7273 return HTMLResponse (content = None , headers = {"content-type" : "text/html; charset=utf-8" })
7374
7475
7576@app .get ("/robots.txt" , include_in_schema = False )
7677async def robots () -> FileResponse :
77- """Serve the `` robots.txt`` file to guide search engine crawlers.
78+ """Serve the robots.txt file to guide search engine crawlers.
7879
79- Returns
80- -------
81- FileResponse
82- The ``robots.txt`` file located in the static directory.
80+ **This endpoint serves the ``robots.txt`` file located in the static directory**
81+ to provide instructions to search engine crawlers about which parts of the site
82+ they should or should not index.
83+
84+ **Returns**
85+
86+ - **FileResponse**: The ``robots.txt`` file located in the static directory
8387
8488 """
8589 return FileResponse ("static/robots.txt" )
8690
8791
8892@app .get ("/llm.txt" )
8993async def llm_txt () -> FileResponse :
90- """Serve the ``llm.txt`` file to provide information about the site to LLMs.
94+ """Serve the llm.txt file to provide information about the site to LLMs.
95+
96+ **This endpoint serves the ``llm.txt`` file located in the static directory**
97+ to provide information about the site to Large Language Models (LLMs)
98+ and other AI systems that may be crawling the site.
99+
100+ **Returns**
91101
92- Returns
93- -------
94- FileResponse
95- The ``llm.txt`` file located in the static directory.
102+ - **FileResponse**: The ``llm.txt`` file located in the static directory
96103
97104 """
98105 return FileResponse ("static/llm.txt" )
99106
100107
101108@app .get ("/docs" , response_class = HTMLResponse , include_in_schema = False )
102109async def custom_swagger_ui (request : Request ) -> HTMLResponse :
103- """Swagger UI documentation."""
110+ """Serve custom Swagger UI documentation.
111+
112+ **This endpoint serves a custom Swagger UI interface**
113+ for the API documentation, providing an interactive way to explore
114+ and test the available endpoints.
115+
116+ **Parameters**
117+
118+ - **request** (`Request`): The incoming HTTP request
119+
120+ **Returns**
121+
122+ - **HTMLResponse**: Custom Swagger UI documentation page
123+
124+ """
104125 return templates .TemplateResponse ("swagger_ui.jinja" , {"request" : request })
105126
106127
107128@app .get ("/api" , include_in_schema = True )
108129def openapi_json_get () -> JSONResponse :
109- """Return the OpenAPI schema (openapi.json)."""
130+ """Return the OpenAPI schema.
131+
132+ **This endpoint returns the OpenAPI schema (openapi.json)**
133+ that describes the API structure, endpoints, and data models
134+ for documentation and client generation purposes.
135+
136+ **Returns**
137+
138+ - **JSONResponse**: The OpenAPI schema as JSON
139+
140+ """
110141 return JSONResponse (app .openapi ())
111142
112143
113144@app .api_route ("/api" , methods = ["POST" , "PUT" , "DELETE" , "OPTIONS" , "HEAD" ], include_in_schema = False )
114145@app .api_route ("/api/" , methods = ["GET" , "POST" , "PUT" , "DELETE" , "OPTIONS" , "HEAD" ], include_in_schema = False )
115146def openapi_json () -> JSONResponse :
116- """Return the OpenAPI schema (openapi.json)."""
147+ """Return the OpenAPI schema for various HTTP methods.
148+
149+ **This endpoint returns the OpenAPI schema (openapi.json)**
150+ for multiple HTTP methods, providing API documentation
151+ for clients that may use different request methods.
152+
153+ **Returns**
154+
155+ - **JSONResponse**: The OpenAPI schema as JSON
156+
157+ """
117158 return JSONResponse (app .openapi ())
118159
119160
0 commit comments