diff --git a/docs/openapi.json b/docs/openapi.json index fa840281..e01f1f79 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1718,11 +1718,18 @@ "properties": { "provider_id": { "type": "string", - "title": "Provider Id" + "title": "Provider Id", + "description": "The ID of the provider" }, "status": { "type": "string", - "title": "Status" + "title": "Status", + "description": "The health status", + "examples": [ + "ok", + "unhealthy", + "not_implemented" + ] }, "message": { "anyOf": [ @@ -1733,7 +1740,12 @@ "type": "null" } ], - "title": "Message" + "title": "Message", + "description": "Optional message about the health status", + "examples": [ + "All systems operational", + "Llama Stack is unavailable" + ] } }, "type": "object", @@ -1980,7 +1992,7 @@ "providers" ], "title": "ReadinessResponse", - "description": "Model representing response to a readiness request.\n\nAttributes:\n ready: If service is ready.\n reason: The reason for the readiness.\n providers: List of unhealthy providers in case of readiness failure.\n\nExample:\n ```python\n readiness_response = ReadinessResponse(\n ready=False,\n reason=\"Service is not ready\",\n providers=[\n ProviderHealthStatus(\n provider_id=\"ollama\",\n status=\"Error\",\n message=\"Server is unavailable\"\n )\n ]\n )\n ```", + "description": "Model representing response to a readiness request.\n\nAttributes:\n ready: If service is ready.\n reason: The reason for the readiness.\n providers: List of unhealthy providers in case of readiness failure.\n\nExample:\n ```python\n readiness_response = ReadinessResponse(\n ready=False,\n reason=\"Service is not ready\",\n providers=[\n ProviderHealthStatus(\n provider_id=\"ollama\",\n status=\"unhealthy\",\n message=\"Server is unavailable\"\n )\n ]\n )\n ```", "examples": [ { "providers": [], diff --git a/docs/openapi.md b/docs/openapi.md index 9f9209aa..0e03a498 100644 --- a/docs/openapi.md +++ b/docs/openapi.md @@ -907,9 +907,9 @@ Attributes: | Field | Type | Description | |-------|------|-------------| -| provider_id | string | | -| status | string | | -| message | | | +| provider_id | string | The ID of the provider | +| status | string | The health status | +| message | | Optional message about the health status | ## QueryRequest @@ -978,7 +978,7 @@ Example: providers=[ ProviderHealthStatus( provider_id="ollama", - status="Error", + status="unhealthy", message="Server is unavailable" ) ] diff --git a/docs/output.md b/docs/output.md index d649c558..5411ffd5 100644 --- a/docs/output.md +++ b/docs/output.md @@ -897,9 +897,9 @@ Attributes: | Field | Type | Description | |-------|------|-------------| -| provider_id | string | | -| status | string | | -| message | | | +| provider_id | string | The ID of the provider | +| status | string | The health status | +| message | | Optional message about the health status | ## QueryRequest @@ -968,7 +968,7 @@ Example: providers=[ ProviderHealthStatus( provider_id="ollama", - status="Error", + status="unhealthy", message="Server is unavailable" ) ] diff --git a/src/models/responses.py b/src/models/responses.py index cb8ee09c..65311bd7 100644 --- a/src/models/responses.py +++ b/src/models/responses.py @@ -127,9 +127,18 @@ class ProviderHealthStatus(BaseModel): message: Optional message about the health status. """ - provider_id: str - status: str - message: Optional[str] = None + provider_id: str = Field( + description="The ID of the provider", + ) + status: str = Field( + description="The health status", + examples=["ok", "unhealthy", "not_implemented"], + ) + message: Optional[str] = Field( + None, + description="Optional message about the health status", + examples=["All systems operational", "Llama Stack is unavailable"], + ) class ReadinessResponse(BaseModel): @@ -148,7 +157,7 @@ class ReadinessResponse(BaseModel): providers=[ ProviderHealthStatus( provider_id="ollama", - status="Error", + status="unhealthy", message="Server is unavailable" ) ]