Skip to content

Commit e6f4c84

Browse files
akihironittaBorda
andauthored
[docs] Include all components in the API reference (#15805)
* Update docs Co-authored-by: Jirka Borovec <[email protected]>
1 parent b8c7018 commit e6f4c84

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

docs/source-app/api_references.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,19 @@ ___________________
3232
:nosignatures:
3333
:template: classtemplate_no_index.rst
3434

35+
~database.client.DatabaseClient
36+
~database.server.Database
3537
~python.popen.PopenPythonScript
3638
~python.tracer.TracerPythonScript
3739
~training.LightningTrainerScript
3840
~serve.gradio.ServeGradio
3941
~serve.serve.ModelInferenceAPI
42+
~serve.python_server.PythonServer
43+
~serve.streamlit.ServeStreamlit
44+
~multi_node.base.MultiNode
45+
~multi_node.lite.LiteMultiNode
46+
~multi_node.pytorch_spawn.PyTorchSpawnMultiNode
47+
~multi_node.trainer.LightningTrainerMultiNode
4048
~auto_scaler.AutoScaler
4149

4250
----

src/lightning_app/components/serve/python_server.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,26 @@ def __init__( # type: ignore
114114
The default data type is good enough for the basic usecases and it expects the data
115115
to be a json object that has one key called `payload`
116116
117-
```
118-
input_data = {"payload": "some data"}
119-
```
117+
.. code-block:: python
118+
119+
input_data = {"payload": "some data"}
120120
121121
and this can be accessed as `request.payload` in the `predict` method.
122122
123-
```
124-
def predict(self, request):
125-
data = request.payload
126-
```
123+
.. code-block:: python
124+
125+
def predict(self, request):
126+
data = request.payload
127127
128128
output_type: Optional `output_type` to be provided. This needs to be a pydantic BaseModel class.
129129
The default data type is good enough for the basic usecases. It expects the return value of
130130
the `predict` method to be a dictionary with one key called `prediction`.
131131
132-
```
133-
def predict(self, request):
134-
# some code
135-
return {"prediction": "some data"}
136-
```
132+
.. code-block:: python
133+
134+
def predict(self, request):
135+
# some code
136+
return {"prediction": "some data"}
137137
138138
and this can be accessed as `response.json()["prediction"]` in the client if
139139
you are using requests library

0 commit comments

Comments
 (0)