Skip to content

Commit 8bd3479

Browse files
authored
Merge pull request #468 from tisnik/update-openapi-docs
Update OpenAPI docs
2 parents 38be419 + a0ca1de commit 8bd3479

File tree

4 files changed

+154
-12
lines changed

4 files changed

+154
-12
lines changed

docs/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@
392392
"feedback"
393393
],
394394
"summary": "Update Feedback Status",
395-
"description": "Handle feedback status update requests.\n\nTakes a request with the desired state of the feedback status.\nReturns the updated state of the feedback status based on the request's value.\nThese changes are for the life of the service and are on a per-worker basis.\n\nReturns:\n StatusResponse: Indicates whether feedback is enabled.",
395+
"description": "Handle feedback status update requests.\n\nTakes a request with the desired state of the feedback status.\nReturns the updated state of the feedback status based on the request's value.\nThese changes are for the life of the service and are on a per-worker basis.\n\nReturns:\n FeedbackStatusUpdateResponse: Indicates whether feedback is enabled.",
396396
"operationId": "update_feedback_status_v1_feedback_status_put",
397397
"requestBody": {
398398
"content": {

docs/openapi.md

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Handle request to the / endpoint.
2626

2727
| Status Code | Description | Component |
2828
|-------------|-------------|-----------|
29-
| 200 | Successful Response | string
30-
|
29+
| 200 | Successful Response | string |
3130
## GET `/v1/info`
3231

3332
> **Info Endpoint Handler**
@@ -48,8 +47,7 @@ Returns:
4847

4948
| Status Code | Description | Component |
5049
|-------------|-------------|-----------|
51-
| 200 | Successful Response | [InfoResponse](#inforesponse)
52-
|
50+
| 200 | Successful Response | [InfoResponse](#inforesponse) |
5351
## GET `/v1/models`
5452

5553
> **Models Endpoint Handler**
@@ -76,7 +74,6 @@ Returns:
7674
|-------------|-------------|-----------|
7775
| 200 | Successful Response | [ModelsResponse](#modelsresponse) |
7876
| 503 | Connection to Llama Stack is broken | |
79-
8077
## POST `/v1/query`
8178

8279
> **Query Endpoint Handler**
@@ -229,6 +226,33 @@ Returns:
229226
| Status Code | Description | Component |
230227
|-------------|-------------|-----------|
231228
| 200 | Successful Response | [StatusResponse](#statusresponse) |
229+
## PUT `/v1/feedback/status`
230+
231+
> **Update Feedback Status**
232+
233+
Handle feedback status update requests.
234+
235+
Takes a request with the desired state of the feedback status.
236+
Returns the updated state of the feedback status based on the request's value.
237+
These changes are for the life of the service and are on a per-worker basis.
238+
239+
Returns:
240+
FeedbackStatusUpdateResponse: Indicates whether feedback is enabled.
241+
242+
243+
244+
245+
246+
### 📦 Request Body
247+
248+
[FeedbackStatusUpdateRequest](#feedbackstatusupdaterequest)
249+
250+
### ✅ Responses
251+
252+
| Status Code | Description | Component |
253+
|-------------|-------------|-----------|
254+
| 200 | Successful Response | [FeedbackStatusUpdateResponse](#feedbackstatusupdateresponse) |
255+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
232256
## GET `/v1/conversations`
233257

234258
> **Get Conversations List Endpoint Handler**
@@ -396,8 +420,7 @@ Prometheus format.
396420

397421
| Status Code | Description | Component |
398422
|-------------|-------------|-----------|
399-
| 200 | Successful Response | string
400-
|
423+
| 200 | Successful Response | string |
401424
---
402425

403426
# 📋 Components
@@ -427,17 +450,17 @@ Available actions in the system.
427450
## Attachment
428451

429452

430-
Model representing an attachment that can be send from UI as part of query.
453+
Model representing an attachment that can be send from the UI as part of query.
431454

432-
List of attachments can be optional part of 'query' request.
455+
A list of attachments can be an optional part of 'query' request.
433456

434457
Attributes:
435458
attachment_type: The attachment type, like "log", "configuration" etc.
436459
content_type: The content type as defined in MIME standard
437460
content: The actual attachment content
438461

439462
YAML attachments with **kind** and **metadata/name** attributes will
440-
be handled as resources with specified name:
463+
be handled as resources with the specified name:
441464
```
442465
kind: Pod
443466
metadata:
@@ -774,6 +797,52 @@ Example:
774797
| response | string | |
775798

776799

800+
## FeedbackStatusUpdateRequest
801+
802+
803+
Model representing a feedback status update request.
804+
805+
Attributes:
806+
status: Value of the desired feedback enabled state.
807+
808+
Example:
809+
```python
810+
feedback_request = FeedbackRequest(
811+
status=false
812+
)
813+
```
814+
815+
816+
| Field | Type | Description |
817+
|-------|------|-------------|
818+
| status | boolean | Desired state of feedback enablement, must be False or True |
819+
820+
821+
## FeedbackStatusUpdateResponse
822+
823+
824+
Model representing a response to a feedback status update request.
825+
826+
Attributes:
827+
status: The previous and current status of the service and who updated it.
828+
829+
Example:
830+
```python
831+
status_response = StatusResponse(
832+
status={
833+
"previous_status": true,
834+
"updated_status": false,
835+
"updated_by": "user/test"
836+
},
837+
)
838+
```
839+
840+
841+
| Field | Type | Description |
842+
|-------|------|-------------|
843+
| status | object | |
844+
845+
777846
## ForbiddenResponse
778847

779848

docs/output.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,33 @@ Returns:
226226
| Status Code | Description | Component |
227227
|-------------|-------------|-----------|
228228
| 200 | Successful Response | [StatusResponse](#statusresponse) |
229+
## PUT `/v1/feedback/status`
230+
231+
> **Update Feedback Status**
232+
233+
Handle feedback status update requests.
234+
235+
Takes a request with the desired state of the feedback status.
236+
Returns the updated state of the feedback status based on the request's value.
237+
These changes are for the life of the service and are on a per-worker basis.
238+
239+
Returns:
240+
FeedbackStatusUpdateResponse: Indicates whether feedback is enabled.
241+
242+
243+
244+
245+
246+
### 📦 Request Body
247+
248+
[FeedbackStatusUpdateRequest](#feedbackstatusupdaterequest)
249+
250+
### ✅ Responses
251+
252+
| Status Code | Description | Component |
253+
|-------------|-------------|-----------|
254+
| 200 | Successful Response | [FeedbackStatusUpdateResponse](#feedbackstatusupdateresponse) |
255+
| 422 | Validation Error | [HTTPValidationError](#httpvalidationerror) |
229256
## GET `/v1/conversations`
230257

231258
> **Get Conversations List Endpoint Handler**
@@ -760,6 +787,52 @@ Example:
760787
| response | string | |
761788

762789

790+
## FeedbackStatusUpdateRequest
791+
792+
793+
Model representing a feedback status update request.
794+
795+
Attributes:
796+
status: Value of the desired feedback enabled state.
797+
798+
Example:
799+
```python
800+
feedback_request = FeedbackRequest(
801+
status=false
802+
)
803+
```
804+
805+
806+
| Field | Type | Description |
807+
|-------|------|-------------|
808+
| status | boolean | Desired state of feedback enablement, must be False or True |
809+
810+
811+
## FeedbackStatusUpdateResponse
812+
813+
814+
Model representing a response to a feedback status update request.
815+
816+
Attributes:
817+
status: The previous and current status of the service and who updated it.
818+
819+
Example:
820+
```python
821+
status_response = StatusResponse(
822+
status={
823+
"previous_status": true,
824+
"updated_status": false,
825+
"updated_by": "user/test"
826+
},
827+
)
828+
```
829+
830+
831+
| Field | Type | Description |
832+
|-------|------|-------------|
833+
| status | object | |
834+
835+
763836
## ForbiddenResponse
764837

765838

src/app/endpoints/feedback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async def update_feedback_status(
193193
These changes are for the life of the service and are on a per-worker basis.
194194
195195
Returns:
196-
StatusResponse: Indicates whether feedback is enabled.
196+
FeedbackStatusUpdateResponse: Indicates whether feedback is enabled.
197197
"""
198198
user_id, _, _ = auth
199199
requested_status = feedback_update_request.get_value()

0 commit comments

Comments
 (0)