Skip to content

Commit

Permalink
refactor: add pipeline descriptions (livepeer#169)
Browse files Browse the repository at this point in the history
This commit adds pipeline descriptions so that each pipeline is clearly
explained on the docs.
  • Loading branch information
rickstaa authored Aug 26, 2024
1 parent 78b5813 commit 00471e4
Show file tree
Hide file tree
Showing 9 changed files with 1,252 additions and 5 deletions.
7 changes: 6 additions & 1 deletion runner/app/routes/audio_to_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ def handle_pipeline_error(e: Exception) -> JSONResponse:
)


@router.post("/audio-to-text", response_model=TextResponse, responses=RESPONSES)
@router.post(
"/audio-to-text",
response_model=TextResponse,
responses=RESPONSES,
description="Transcribe audio files to text.",
)
@router.post(
"/audio-to-text/",
response_model=TextResponse,
Expand Down
7 changes: 6 additions & 1 deletion runner/app/routes/image_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@

# TODO: Make model_id and other None properties optional once Go codegen tool supports
# OAPI 3.1 https://github.com/deepmap/oapi-codegen/issues/373
@router.post("/image-to-image", response_model=ImageResponse, responses=RESPONSES)
@router.post(
"/image-to-image",
response_model=ImageResponse,
responses=RESPONSES,
description="Apply image transformations to a provided image.",
)
@router.post(
"/image-to-image/",
response_model=ImageResponse,
Expand Down
7 changes: 6 additions & 1 deletion runner/app/routes/image_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@

# TODO: Make model_id and other None properties optional once Go codegen tool supports
# OAPI 3.1 https://github.com/deepmap/oapi-codegen/issues/373
@router.post("/image-to-video", response_model=VideoResponse, responses=RESPONSES)
@router.post(
"/image-to-video",
response_model=VideoResponse,
responses=RESPONSES,
description="Generate a video from a provided image.",
)
@router.post(
"/image-to-video/",
response_model=VideoResponse,
Expand Down
7 changes: 6 additions & 1 deletion runner/app/routes/text_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ class TextToImageParams(BaseModel):
}


@router.post("/text-to-image", response_model=ImageResponse, responses=RESPONSES)
@router.post(
"/text-to-image",
response_model=ImageResponse,
responses=RESPONSES,
description="Generate images from text prompts.",
)
@router.post(
"/text-to-image/",
response_model=ImageResponse,
Expand Down
7 changes: 6 additions & 1 deletion runner/app/routes/upscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@

# TODO: Make model_id and other None properties optional once Go codegen tool supports
# OAPI 3.1 https://github.com/deepmap/oapi-codegen/issues/373
@router.post("/upscale", response_model=ImageResponse, responses=RESPONSES)
@router.post(
"/upscale",
response_model=ImageResponse,
responses=RESPONSES,
description="Upscale an image by increasing its resolution.",
)
@router.post(
"/upscale/",
response_model=ImageResponse,
Expand Down
5 changes: 5 additions & 0 deletions runner/gateway.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"/text-to-image": {
"post": {
"summary": "Text To Image",
"description": "Generate images from text prompts.",
"operationId": "text_to_image",
"requestBody": {
"content": {
Expand Down Expand Up @@ -88,6 +89,7 @@
"/image-to-image": {
"post": {
"summary": "Image To Image",
"description": "Apply image transformations to a provided image.",
"operationId": "image_to_image",
"requestBody": {
"content": {
Expand Down Expand Up @@ -161,6 +163,7 @@
"/image-to-video": {
"post": {
"summary": "Image To Video",
"description": "Generate a video from a provided image.",
"operationId": "image_to_video",
"requestBody": {
"content": {
Expand Down Expand Up @@ -234,6 +237,7 @@
"/upscale": {
"post": {
"summary": "Upscale",
"description": "Upscale an image by increasing its resolution.",
"operationId": "upscale",
"requestBody": {
"content": {
Expand Down Expand Up @@ -307,6 +311,7 @@
"/audio-to-text": {
"post": {
"summary": "Audio To Text",
"description": "Transcribe audio files to text.",
"operationId": "audio_to_text",
"requestBody": {
"content": {
Expand Down
Loading

0 comments on commit 00471e4

Please sign in to comment.