Skip to content

Commit 27e6c87

Browse files
authored
Merge pull request #537 from tisnik/lcore-390-field-description-for-readiness-response
LCORE-390: field description for ReadinessResponse model
2 parents 31e96ca + 9bae913 commit 27e6c87

File tree

4 files changed

+38
-13
lines changed

4 files changed

+38
-13
lines changed

docs/openapi.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,18 +2240,29 @@
22402240
"properties": {
22412241
"ready": {
22422242
"type": "boolean",
2243-
"title": "Ready"
2243+
"title": "Ready",
2244+
"description": "Flag indicating if service is ready",
2245+
"examples": [
2246+
true,
2247+
false
2248+
]
22442249
},
22452250
"reason": {
22462251
"type": "string",
2247-
"title": "Reason"
2252+
"title": "Reason",
2253+
"description": "The reason for the readiness",
2254+
"examples": [
2255+
"Service is ready"
2256+
]
22482257
},
22492258
"providers": {
22502259
"items": {
22512260
"$ref": "#/components/schemas/ProviderHealthStatus"
22522261
},
22532262
"type": "array",
2254-
"title": "Providers"
2263+
"title": "Providers",
2264+
"description": "List of unhealthy providers in case of readiness failure.",
2265+
"examples": []
22552266
}
22562267
},
22572268
"type": "object",

docs/openapi.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ Examples:
754754
feedback_request = FeedbackRequest(
755755
conversation_id="12345678-abcd-0000-0123-456789abcdef",
756756
user_question="what are you doing?",
757-
user_feedback="Great service!",
757+
user_feedback="This response is not helpful",
758758
llm_response="I don't know",
759759
sentiment=1
760760
)
@@ -1124,9 +1124,9 @@ Example:
11241124

11251125
| Field | Type | Description |
11261126
|-------|------|-------------|
1127-
| ready | boolean | |
1128-
| reason | string | |
1129-
| providers | array | |
1127+
| ready | boolean | Flag indicating if service is ready |
1128+
| reason | string | The reason for the readiness |
1129+
| providers | array | List of unhealthy providers in case of readiness failure. |
11301130

11311131

11321132
## SQLiteDatabaseConfiguration

docs/output.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,9 +1114,9 @@ Example:
11141114

11151115
| Field | Type | Description |
11161116
|-------|------|-------------|
1117-
| ready | boolean | |
1118-
| reason | string | |
1119-
| providers | array | |
1117+
| ready | boolean | Flag indicating if service is ready |
1118+
| reason | string | The reason for the readiness |
1119+
| providers | array | List of unhealthy providers in case of readiness failure. |
11201120

11211121

11221122
## SQLiteDatabaseConfiguration

src/models/responses.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,23 @@ class ReadinessResponse(BaseModel):
173173
```
174174
"""
175175

176-
ready: bool
177-
reason: str
178-
providers: list[ProviderHealthStatus]
176+
ready: bool = Field(
177+
...,
178+
description="Flag indicating if service is ready",
179+
examples=[True, False],
180+
)
181+
182+
reason: str = Field(
183+
...,
184+
description="The reason for the readiness",
185+
examples=["Service is ready"],
186+
)
187+
188+
providers: list[ProviderHealthStatus] = Field(
189+
...,
190+
description="List of unhealthy providers in case of readiness failure.",
191+
examples=[],
192+
)
179193

180194
# provides examples for /docs endpoint
181195
model_config = {

0 commit comments

Comments
 (0)