|
23 | 23 |
|
24 | 24 |
|
25 | 25 | async def get_providers_health_statuses() -> list[ProviderHealthStatus]: |
26 | | - """Check health of all providers. |
| 26 | + """ |
| 27 | + Retrieve the health status of all configured providers. |
27 | 28 |
|
28 | 29 | Returns: |
29 | | - List of provider health statuses. |
| 30 | + list[ProviderHealthStatus]: A list containing the health |
| 31 | + status of each provider. If provider health cannot be |
| 32 | + determined, returns a single entry indicating an error. |
30 | 33 | """ |
31 | 34 | try: |
32 | 35 | client = AsyncLlamaStackClientHolder().get_client() |
@@ -70,7 +73,13 @@ async def get_providers_health_statuses() -> list[ProviderHealthStatus]: |
70 | 73 |
|
71 | 74 | @router.get("/readiness", responses=get_readiness_responses) |
72 | 75 | async def readiness_probe_get_method(response: Response) -> ReadinessResponse: |
73 | | - """Ready status of service with provider health details.""" |
| 76 | + """ |
| 77 | + Handle the readiness probe endpoint, returning service readiness. |
| 78 | +
|
| 79 | + If any provider reports an error status, responds with HTTP 503 |
| 80 | + and details of unhealthy providers; otherwise, indicates the |
| 81 | + service is ready. |
| 82 | + """ |
74 | 83 | provider_statuses = await get_providers_health_statuses() |
75 | 84 |
|
76 | 85 | # Check if any provider is unhealthy (not counting not_implemented as unhealthy) |
@@ -104,5 +113,10 @@ async def readiness_probe_get_method(response: Response) -> ReadinessResponse: |
104 | 113 |
|
105 | 114 | @router.get("/liveness", responses=get_liveness_responses) |
106 | 115 | def liveness_probe_get_method() -> LivenessResponse: |
107 | | - """Live status of service.""" |
| 116 | + """ |
| 117 | + Return the liveness status of the service. |
| 118 | +
|
| 119 | + Returns: |
| 120 | + LivenessResponse: Indicates that the service is alive. |
| 121 | + """ |
108 | 122 | return LivenessResponse(alive=True) |
0 commit comments