Skip to content

Commit 6ecd1d3

Browse files
authored
Merge pull request #429 from tisnik/lcore-390-field-description-for-provider-health-status
LCORE-390: field description for provider health status
2 parents dc50deb + 98a968c commit 6ecd1d3

File tree

4 files changed

+37
-16
lines changed

4 files changed

+37
-16
lines changed

docs/openapi.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,11 +1718,18 @@
17181718
"properties": {
17191719
"provider_id": {
17201720
"type": "string",
1721-
"title": "Provider Id"
1721+
"title": "Provider Id",
1722+
"description": "The ID of the provider"
17221723
},
17231724
"status": {
17241725
"type": "string",
1725-
"title": "Status"
1726+
"title": "Status",
1727+
"description": "The health status",
1728+
"examples": [
1729+
"ok",
1730+
"unhealthy",
1731+
"not_implemented"
1732+
]
17261733
},
17271734
"message": {
17281735
"anyOf": [
@@ -1733,7 +1740,12 @@
17331740
"type": "null"
17341741
}
17351742
],
1736-
"title": "Message"
1743+
"title": "Message",
1744+
"description": "Optional message about the health status",
1745+
"examples": [
1746+
"All systems operational",
1747+
"Llama Stack is unavailable"
1748+
]
17371749
}
17381750
},
17391751
"type": "object",
@@ -1980,7 +1992,7 @@
19801992
"providers"
19811993
],
19821994
"title": "ReadinessResponse",
1983-
"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 ```",
1995+
"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 ```",
19841996
"examples": [
19851997
{
19861998
"providers": [],

docs/openapi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,9 @@ Attributes:
907907

908908
| Field | Type | Description |
909909
|-------|------|-------------|
910-
| provider_id | string | |
911-
| status | string | |
912-
| message | | |
910+
| provider_id | string | The ID of the provider |
911+
| status | string | The health status |
912+
| message | | Optional message about the health status |
913913

914914

915915
## QueryRequest
@@ -978,7 +978,7 @@ Example:
978978
providers=[
979979
ProviderHealthStatus(
980980
provider_id="ollama",
981-
status="Error",
981+
status="unhealthy",
982982
message="Server is unavailable"
983983
)
984984
]

docs/output.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,9 @@ Attributes:
897897

898898
| Field | Type | Description |
899899
|-------|------|-------------|
900-
| provider_id | string | |
901-
| status | string | |
902-
| message | | |
900+
| provider_id | string | The ID of the provider |
901+
| status | string | The health status |
902+
| message | | Optional message about the health status |
903903

904904

905905
## QueryRequest
@@ -968,7 +968,7 @@ Example:
968968
providers=[
969969
ProviderHealthStatus(
970970
provider_id="ollama",
971-
status="Error",
971+
status="unhealthy",
972972
message="Server is unavailable"
973973
)
974974
]

src/models/responses.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,18 @@ class ProviderHealthStatus(BaseModel):
127127
message: Optional message about the health status.
128128
"""
129129

130-
provider_id: str
131-
status: str
132-
message: Optional[str] = None
130+
provider_id: str = Field(
131+
description="The ID of the provider",
132+
)
133+
status: str = Field(
134+
description="The health status",
135+
examples=["ok", "unhealthy", "not_implemented"],
136+
)
137+
message: Optional[str] = Field(
138+
None,
139+
description="Optional message about the health status",
140+
examples=["All systems operational", "Llama Stack is unavailable"],
141+
)
133142

134143

135144
class ReadinessResponse(BaseModel):
@@ -148,7 +157,7 @@ class ReadinessResponse(BaseModel):
148157
providers=[
149158
ProviderHealthStatus(
150159
provider_id="ollama",
151-
status="Error",
160+
status="unhealthy",
152161
message="Server is unavailable"
153162
)
154163
]

0 commit comments

Comments
 (0)