From 6a4843662c728a391f5b5bc315365b4e099dd129 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Mon, 25 Aug 2025 15:52:17 -0400 Subject: [PATCH 1/5] add endpoint for toggling feedback enablement for life of service Signed-off-by: Jordan Dubrick --- src/app/endpoints/feedback.py | 32 +++++++++++++++ src/models/requests.py | 23 +++++++++++ tests/unit/app/endpoints/test_feedback.py | 47 +++++++++++++++++++++++ 3 files changed, 102 insertions(+) diff --git a/src/app/endpoints/feedback.py b/src/app/endpoints/feedback.py index 39d2a269..5d26b595 100644 --- a/src/app/endpoints/feedback.py +++ b/src/app/endpoints/feedback.py @@ -20,6 +20,7 @@ UnauthorizedResponse, ForbiddenResponse, ) +from models.requests import FeedbackRequest, FeedbackToggleRequest from utils.suid import get_suid logger = logging.getLogger(__name__) @@ -174,3 +175,34 @@ def feedback_status() -> StatusResponse: return StatusResponse( functionality="feedback", status={"enabled": feedback_status_enabled} ) + +@router.post("/toggle") +def feedback_toggle(feedback_toggle_request: FeedbackToggleRequest) -> StatusResponse: + """ + Handle feedback toggle requests. + + Returns the current enbaled status of the feedback functionality after it has been + updated to the desired value from the request. + + Returns: + StatusResponse: Indicates whether feedback is enabled. + """ + feedback_status = toggle_feedback_status(feedback_toggle_request) + return StatusResponse( + functionality="feedback", status={"enabled": feedback_status} + ) + +def toggle_feedback_status(req: FeedbackToggleRequest) -> bool: + """ + Toggles the feedback boolean stored in the configuration. + This toggling is temporary until the service is interrupted as it will not edit + any configuration files. + + Parameters: + req (FeedbackToggleRequest): The request received with a boolean for the new value. + + Returns: + bool: The current enabled status of feedback. + """ + configuration.user_data_collection_configuration.feedback_enabled = req.get_value() + return is_feedback_enabled() \ No newline at end of file diff --git a/src/models/requests.py b/src/models/requests.py index 14755fbf..614a72ab 100644 --- a/src/models/requests.py +++ b/src/models/requests.py @@ -380,3 +380,26 @@ def check_feedback_provided(self) -> Self: "'sentiment', 'user_feedback', or 'categories'" ) return self + +class FeedbackToggleRequest(BaseModel): + """Model representing a feedback toggle request. + + Attributes: + status: Boolean controlling what the Feedback status should be. + + Example: + ```python + feedback_request = FeedbackRequest( + status=false + ) + ``` + """ + + status: bool = Field( + False, + description="Desired state of feedback enablement, must be False or True", + examples=[True, False], + ) + + def get_value(self): + return self.status \ No newline at end of file diff --git a/tests/unit/app/endpoints/test_feedback.py b/tests/unit/app/endpoints/test_feedback.py index 4a155ef6..836e11b7 100644 --- a/tests/unit/app/endpoints/test_feedback.py +++ b/tests/unit/app/endpoints/test_feedback.py @@ -10,7 +10,9 @@ feedback_endpoint_handler, store_feedback, feedback_status, + feedback_toggle ) +from models.requests import FeedbackToggleRequest from tests.unit.utils.auth_helpers import mock_authorization_resolvers @@ -203,3 +205,48 @@ def test_feedback_status(): response = feedback_status() assert response.functionality == "feedback" assert response.status == {"enabled": True} + +def test_feedback_toggle_enabled(): + """Test that feedback_toggle processes feedback toggle for disabled status payloads.""" + + configuration.user_data_collection_configuration.feedback_enabled = True + + feedback_toggle_request = FeedbackToggleRequest(status=False) + + response = feedback_toggle( + feedback_toggle_request=feedback_toggle_request + ) + + assert response.functionality == "feedback" + assert response.status == {"enabled": False} + +def test_feedback_toggle_disabled(): + """Test that feedback_toggle processes feedback toggle for enabled status payloads.""" + + configuration.user_data_collection_configuration.feedback_enabled = False + + feedback_toggle_request = FeedbackToggleRequest(status=True) + + response = feedback_toggle( + feedback_toggle_request=feedback_toggle_request + ) + + assert response.functionality == "feedback" + assert response.status == {"enabled": True} + +def test_feedback_toggle_equivalent(): + """ + Test that feedback_toggle processes feedback toggle for status payloads with the same value + as what is presently set. + """ + + configuration.user_data_collection_configuration.feedback_enabled = True + + feedback_toggle_request = FeedbackToggleRequest(status=True) + + response = feedback_toggle( + feedback_toggle_request=feedback_toggle_request + ) + + assert response.functionality == "feedback" + assert response.status == {"enabled": True} From 25c4203fca9a3a9bc7db4e76ce25b98f809aec9e Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Tue, 26 Aug 2025 16:25:43 -0400 Subject: [PATCH 2/5] update format and apply linter to feedback toggle Signed-off-by: Jordan Dubrick --- src/app/endpoints/feedback.py | 13 +++++++------ src/models/requests.py | 6 ++++-- tests/unit/app/endpoints/test_feedback.py | 21 +++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/app/endpoints/feedback.py b/src/app/endpoints/feedback.py index 5d26b595..dcdcf411 100644 --- a/src/app/endpoints/feedback.py +++ b/src/app/endpoints/feedback.py @@ -20,7 +20,7 @@ UnauthorizedResponse, ForbiddenResponse, ) -from models.requests import FeedbackRequest, FeedbackToggleRequest +from models.requests import FeedbackToggleRequest from utils.suid import get_suid logger = logging.getLogger(__name__) @@ -176,6 +176,7 @@ def feedback_status() -> StatusResponse: functionality="feedback", status={"enabled": feedback_status_enabled} ) + @router.post("/toggle") def feedback_toggle(feedback_toggle_request: FeedbackToggleRequest) -> StatusResponse: """ @@ -187,14 +188,14 @@ def feedback_toggle(feedback_toggle_request: FeedbackToggleRequest) -> StatusRes Returns: StatusResponse: Indicates whether feedback is enabled. """ - feedback_status = toggle_feedback_status(feedback_toggle_request) - return StatusResponse( - functionality="feedback", status={"enabled": feedback_status} - ) + fetched_status = toggle_feedback_status(feedback_toggle_request) + return StatusResponse(functionality="feedback", status={"enabled": fetched_status}) + def toggle_feedback_status(req: FeedbackToggleRequest) -> bool: """ Toggles the feedback boolean stored in the configuration. + This toggling is temporary until the service is interrupted as it will not edit any configuration files. @@ -205,4 +206,4 @@ def toggle_feedback_status(req: FeedbackToggleRequest) -> bool: bool: The current enabled status of feedback. """ configuration.user_data_collection_configuration.feedback_enabled = req.get_value() - return is_feedback_enabled() \ No newline at end of file + return is_feedback_enabled() diff --git a/src/models/requests.py b/src/models/requests.py index 614a72ab..2d09fec3 100644 --- a/src/models/requests.py +++ b/src/models/requests.py @@ -381,6 +381,7 @@ def check_feedback_provided(self) -> Self: ) return self + class FeedbackToggleRequest(BaseModel): """Model representing a feedback toggle request. @@ -401,5 +402,6 @@ class FeedbackToggleRequest(BaseModel): examples=[True, False], ) - def get_value(self): - return self.status \ No newline at end of file + def get_value(self) -> bool: + """Return the value of the status attribute.""" + return self.status diff --git a/tests/unit/app/endpoints/test_feedback.py b/tests/unit/app/endpoints/test_feedback.py index 836e11b7..8ebd350d 100644 --- a/tests/unit/app/endpoints/test_feedback.py +++ b/tests/unit/app/endpoints/test_feedback.py @@ -10,7 +10,7 @@ feedback_endpoint_handler, store_feedback, feedback_status, - feedback_toggle + feedback_toggle, ) from models.requests import FeedbackToggleRequest from tests.unit.utils.auth_helpers import mock_authorization_resolvers @@ -206,6 +206,7 @@ def test_feedback_status(): assert response.functionality == "feedback" assert response.status == {"enabled": True} + def test_feedback_toggle_enabled(): """Test that feedback_toggle processes feedback toggle for disabled status payloads.""" @@ -213,13 +214,12 @@ def test_feedback_toggle_enabled(): feedback_toggle_request = FeedbackToggleRequest(status=False) - response = feedback_toggle( - feedback_toggle_request=feedback_toggle_request - ) + response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) assert response.functionality == "feedback" assert response.status == {"enabled": False} + def test_feedback_toggle_disabled(): """Test that feedback_toggle processes feedback toggle for enabled status payloads.""" @@ -227,26 +227,23 @@ def test_feedback_toggle_disabled(): feedback_toggle_request = FeedbackToggleRequest(status=True) - response = feedback_toggle( - feedback_toggle_request=feedback_toggle_request - ) + response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) assert response.functionality == "feedback" assert response.status == {"enabled": True} + def test_feedback_toggle_equivalent(): """ - Test that feedback_toggle processes feedback toggle for status payloads with the same value - as what is presently set. + Test that feedback_toggle processes feedback toggle for status payloads with the same value + as what is presently set. """ configuration.user_data_collection_configuration.feedback_enabled = True feedback_toggle_request = FeedbackToggleRequest(status=True) - response = feedback_toggle( - feedback_toggle_request=feedback_toggle_request - ) + response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) assert response.functionality == "feedback" assert response.status == {"enabled": True} From 8ecd41f68514783e59db5e906b71ee2d681d02de Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Wed, 27 Aug 2025 13:58:50 -0400 Subject: [PATCH 3/5] add new endpoint to openapi json Signed-off-by: Jordan Dubrick --- docs/openapi.json | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/docs/openapi.json b/docs/openapi.json index d45ff5c6..5668915f 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -388,6 +388,48 @@ } } }, + "/v1/feedback/toggle": { + "post": { + "tags": [ + "feedback" + ], + "summary": "Feedback Toggle", + "description": "Handle feedback toggle requests.\n\nReturns the current enbaled status of the feedback functionality after it has been\nupdated to the desired value from the request.\n\nReturns:\n StatusResponse: Indicates whether feedback is enabled.", + "operationId": "feedback_toggle_v1_feedback_toggle_post", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedbackToggleRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/StatusResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + } + } + }, "/v1/conversations": { "get": { "tags": [ @@ -1446,6 +1488,23 @@ } ] }, + "FeedbackToggleRequest": { + "properties": { + "status": { + "type": "boolean", + "title": "Status", + "description": "Desired state of feedback enablement, must be False or True", + "default": false, + "examples": [ + true, + false + ] + } + }, + "type": "object", + "title": "FeedbackToggleRequest", + "description": "Model representing a feedback toggle request.\n\nAttributes:\n status: Boolean controlling what the Feedback status should be.\n\nExample:\n ```python\n feedback_request = FeedbackRequest(\n status=false\n )\n ```" + }, "ForbiddenResponse": { "properties": { "detail": { From ec5e7a74402b7bfa092385f218e344ce36af2764 Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Aug 2025 09:50:54 -0400 Subject: [PATCH 4/5] move to PUT endpoint to set feedback status Signed-off-by: Jordan Dubrick --- docs/openapi.json | 46 +++++++++++---- src/app/endpoints/feedback.py | 56 ++++++++++-------- src/models/requests.py | 6 +- src/models/responses.py | 36 ++++++++++++ tests/unit/app/endpoints/test_feedback.py | 72 ++++++++--------------- 5 files changed, 131 insertions(+), 85 deletions(-) diff --git a/docs/openapi.json b/docs/openapi.json index 5668915f..be6060de 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -386,21 +386,19 @@ } } } - } - }, - "/v1/feedback/toggle": { - "post": { + }, + "put": { "tags": [ "feedback" ], - "summary": "Feedback Toggle", - "description": "Handle feedback toggle requests.\n\nReturns the current enbaled status of the feedback functionality after it has been\nupdated to the desired value from the request.\n\nReturns:\n StatusResponse: Indicates whether feedback is enabled.", - "operationId": "feedback_toggle_v1_feedback_toggle_post", + "summary": "Update Feedback Status", + "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.\n\nReturns:\n StatusResponse: Indicates whether feedback is enabled.", + "operationId": "update_feedback_status_v1_feedback_status_put", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/FeedbackToggleRequest" + "$ref": "#/components/schemas/FeedbackStatusUpdateRequest" } } }, @@ -412,7 +410,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/StatusResponse" + "$ref": "#/components/schemas/FeedbackStatusUpdateResponse" } } } @@ -1488,7 +1486,7 @@ } ] }, - "FeedbackToggleRequest": { + "FeedbackStatusUpdateRequest": { "properties": { "status": { "type": "boolean", @@ -1502,8 +1500,32 @@ } }, "type": "object", - "title": "FeedbackToggleRequest", - "description": "Model representing a feedback toggle request.\n\nAttributes:\n status: Boolean controlling what the Feedback status should be.\n\nExample:\n ```python\n feedback_request = FeedbackRequest(\n status=false\n )\n ```" + "title": "FeedbackStatusUpdateRequest", + "description": "Model representing a feedback status update request.\n\nAttributes:\n status: Value of the desired feedback enabled state.\n\nExample:\n ```python\n feedback_request = FeedbackRequest(\n status=false\n )\n ```" + }, + "FeedbackStatusUpdateResponse": { + "properties": { + "status": { + "additionalProperties": true, + "type": "object", + "title": "Status" + } + }, + "type": "object", + "required": [ + "status" + ], + "title": "FeedbackStatusUpdateResponse", + "description": "Model representing a response to a feedback status update request.\n\nAttributes:\n status: The previous and current status of the service and who updated it.\n\nExample:\n ```python\n status_response = StatusResponse(\n status={\n \"previous_status\": true,\n \"updated_status\": false,\n \"updated_by\": \"user/test\"\n },\n )\n ```", + "examples": [ + { + "status": { + "previous_status": true, + "updated_by": "user/test", + "updated_status": false + } + } + ] }, "ForbiddenResponse": { "properties": { diff --git a/src/app/endpoints/feedback.py b/src/app/endpoints/feedback.py index dcdcf411..41c8a367 100644 --- a/src/app/endpoints/feedback.py +++ b/src/app/endpoints/feedback.py @@ -1,6 +1,7 @@ """Handler for REST API endpoint for user feedback.""" import logging +import threading from typing import Annotated, Any from pathlib import Path import json @@ -12,20 +13,21 @@ from authorization.middleware import authorize from configuration import configuration from models.config import Action -from models.requests import FeedbackRequest +from models.requests import FeedbackRequest, FeedbackStatusUpdateRequest from models.responses import ( ErrorResponse, FeedbackResponse, + FeedbackStatusUpdateResponse, StatusResponse, UnauthorizedResponse, ForbiddenResponse, ) -from models.requests import FeedbackToggleRequest from utils.suid import get_suid logger = logging.getLogger(__name__) router = APIRouter(prefix="/feedback", tags=["feedback"]) auth_dependency = get_auth_dependency() +feedback_status_lock = threading.Lock() # Response for the feedback endpoint feedback_response: dict[int | str, dict[str, Any]] = { @@ -177,33 +179,39 @@ def feedback_status() -> StatusResponse: ) -@router.post("/toggle") -def feedback_toggle(feedback_toggle_request: FeedbackToggleRequest) -> StatusResponse: +@router.put("/status") +@authorize(Action.ADMIN) +async def update_feedback_status( + feedback_update_request: FeedbackStatusUpdateRequest, + auth: Annotated[AuthTuple, Depends(auth_dependency)], +) -> FeedbackStatusUpdateResponse: """ - Handle feedback toggle requests. + Handle feedback status update requests. - Returns the current enbaled status of the feedback functionality after it has been - updated to the desired value from the request. + Takes a request with the desired state of the feedback status. + Returns the updated state of the feedback status based on the request's value. Returns: StatusResponse: Indicates whether feedback is enabled. """ - fetched_status = toggle_feedback_status(feedback_toggle_request) - return StatusResponse(functionality="feedback", status={"enabled": fetched_status}) - - -def toggle_feedback_status(req: FeedbackToggleRequest) -> bool: - """ - Toggles the feedback boolean stored in the configuration. - - This toggling is temporary until the service is interrupted as it will not edit - any configuration files. + user_id, _, _ = auth + requested_status = feedback_update_request.get_value() - Parameters: - req (FeedbackToggleRequest): The request received with a boolean for the new value. + with feedback_status_lock: + previous_status = ( + configuration.user_data_collection_configuration.feedback_enabled + ) + configuration.user_data_collection_configuration.feedback_enabled = ( + requested_status + ) + updated_status = ( + configuration.user_data_collection_configuration.feedback_enabled + ) - Returns: - bool: The current enabled status of feedback. - """ - configuration.user_data_collection_configuration.feedback_enabled = req.get_value() - return is_feedback_enabled() + return FeedbackStatusUpdateResponse( + status={ + "previous_status": previous_status, + "updated_status": updated_status, + "updated_by": user_id, + } + ) diff --git a/src/models/requests.py b/src/models/requests.py index 2d09fec3..aef2778c 100644 --- a/src/models/requests.py +++ b/src/models/requests.py @@ -382,11 +382,11 @@ def check_feedback_provided(self) -> Self: return self -class FeedbackToggleRequest(BaseModel): - """Model representing a feedback toggle request. +class FeedbackStatusUpdateRequest(BaseModel): + """Model representing a feedback status update request. Attributes: - status: Boolean controlling what the Feedback status should be. + status: Value of the desired feedback enabled state. Example: ```python diff --git a/src/models/responses.py b/src/models/responses.py index d55dd65f..8d402d73 100644 --- a/src/models/responses.py +++ b/src/models/responses.py @@ -570,3 +570,39 @@ class ErrorResponse(BaseModel): ] } } + + +class FeedbackStatusUpdateResponse(BaseModel): + """Model representing a response to a feedback status update request. + + Attributes: + status: The previous and current status of the service and who updated it. + + Example: + ```python + status_response = StatusResponse( + status={ + "previous_status": true, + "updated_status": false, + "updated_by": "user/test" + }, + ) + ``` + """ + + status: dict + + # provides examples for /docs endpoint + model_config = { + "json_schema_extra": { + "examples": [ + { + "status": { + "previous_status": True, + "updated_status": False, + "updated_by": "user/test", + }, + } + ] + } + } diff --git a/tests/unit/app/endpoints/test_feedback.py b/tests/unit/app/endpoints/test_feedback.py index 8ebd350d..486818cc 100644 --- a/tests/unit/app/endpoints/test_feedback.py +++ b/tests/unit/app/endpoints/test_feedback.py @@ -9,10 +9,9 @@ assert_feedback_enabled, feedback_endpoint_handler, store_feedback, - feedback_status, - feedback_toggle, + update_feedback_status, ) -from models.requests import FeedbackToggleRequest +from models.requests import FeedbackStatusUpdateRequest from tests.unit.utils.auth_helpers import mock_authorization_resolvers @@ -198,52 +197,33 @@ def test_store_feedback_on_io_error(mocker, feedback_request_data): store_feedback(user_id, feedback_request_data) -def test_feedback_status(): - """Test that feedback_status returns the correct status response.""" +async def test_update_feedback_status_different(): + """Test that update_feedback_status returns the correct status with an update.""" configuration.user_data_collection_configuration.feedback_enabled = True - response = feedback_status() - assert response.functionality == "feedback" - assert response.status == {"enabled": True} - - -def test_feedback_toggle_enabled(): - """Test that feedback_toggle processes feedback toggle for disabled status payloads.""" - - configuration.user_data_collection_configuration.feedback_enabled = True - - feedback_toggle_request = FeedbackToggleRequest(status=False) - - response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) - - assert response.functionality == "feedback" - assert response.status == {"enabled": False} - - -def test_feedback_toggle_disabled(): - """Test that feedback_toggle processes feedback toggle for enabled status payloads.""" - - configuration.user_data_collection_configuration.feedback_enabled = False - - feedback_toggle_request = FeedbackToggleRequest(status=True) - - response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) - - assert response.functionality == "feedback" - assert response.status == {"enabled": True} - + req = FeedbackStatusUpdateRequest(status=False) + resp = await update_feedback_status( + req, + auth=("test_user_id", "test_username", "test_token"), + ) + assert resp.status == { + "previous_status": True, + "updated_status": False, + "updated_by": "test_user_id", + } -def test_feedback_toggle_equivalent(): - """ - Test that feedback_toggle processes feedback toggle for status payloads with the same value - as what is presently set. - """ +async def test_update_feedback_status_no_change(): + """Test that update_feedback_status returns the correct status with no update.""" configuration.user_data_collection_configuration.feedback_enabled = True - feedback_toggle_request = FeedbackToggleRequest(status=True) - - response = feedback_toggle(feedback_toggle_request=feedback_toggle_request) - - assert response.functionality == "feedback" - assert response.status == {"enabled": True} + req = FeedbackStatusUpdateRequest(status=True) + resp = await update_feedback_status( + req, + auth=("test_user_id", "test_username", "test_token"), + ) + assert resp.status == { + "previous_status": True, + "updated_status": True, + "updated_by": "test_user_id", + } From d683993a09842e1eba5338c60ec510a9f2044a8b Mon Sep 17 00:00:00 2001 From: Jordan Dubrick Date: Thu, 28 Aug 2025 10:13:08 -0400 Subject: [PATCH 5/5] update description to denote per-worker changes Signed-off-by: Jordan Dubrick --- docs/openapi.json | 20 +++++++++++++++++++- src/app/endpoints/feedback.py | 1 + src/models/responses.py | 3 ++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/openapi.json b/docs/openapi.json index be6060de..45686231 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -392,7 +392,7 @@ "feedback" ], "summary": "Update Feedback Status", - "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.\n\nReturns:\n StatusResponse: Indicates whether feedback is enabled.", + "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.", "operationId": "update_feedback_status_v1_feedback_status_put", "requestBody": { "content": { @@ -752,6 +752,7 @@ "title": "Actions" } }, + "additionalProperties": false, "type": "object", "required": [ "role", @@ -883,6 +884,7 @@ ] } }, + "additionalProperties": false, "type": "object", "title": "AuthenticationConfiguration", "description": "Authentication configuration." @@ -897,6 +899,7 @@ "title": "Access Rules" } }, + "additionalProperties": false, "type": "object", "title": "AuthorizationConfiguration", "description": "Authorization configuration." @@ -973,6 +976,7 @@ ] } }, + "additionalProperties": false, "type": "object", "title": "CORSConfiguration", "description": "CORS configuration." @@ -1040,6 +1044,7 @@ "default": {} } }, + "additionalProperties": false, "type": "object", "required": [ "name", @@ -1263,6 +1268,7 @@ "title": "System Prompt" } }, + "additionalProperties": false, "type": "object", "title": "Customization", "description": "Service customization." @@ -1290,6 +1296,7 @@ ] } }, + "additionalProperties": false, "type": "object", "title": "DatabaseConfiguration", "description": "Database configuration." @@ -1584,6 +1591,7 @@ "title": "Default Provider" } }, + "additionalProperties": false, "type": "object", "title": "InferenceConfiguration", "description": "Inference configuration." @@ -1650,6 +1658,7 @@ } } }, + "additionalProperties": false, "type": "object", "required": [ "url" @@ -1677,6 +1686,7 @@ "title": "Role Rules" } }, + "additionalProperties": false, "type": "object", "title": "JwtConfiguration", "description": "JWT configuration." @@ -1706,6 +1716,7 @@ "title": "Roles" } }, + "additionalProperties": false, "type": "object", "required": [ "jsonpath", @@ -1782,6 +1793,7 @@ "title": "Library Client Config Path" } }, + "additionalProperties": false, "type": "object", "title": "LlamaStackConfiguration", "description": "Llama stack configuration." @@ -1802,6 +1814,7 @@ "title": "Url" } }, + "additionalProperties": false, "type": "object", "required": [ "name", @@ -1909,6 +1922,7 @@ "title": "Ca Cert Path" } }, + "additionalProperties": false, "type": "object", "required": [ "db", @@ -2212,6 +2226,7 @@ "title": "Db Path" } }, + "additionalProperties": false, "type": "object", "required": [ "db_path" @@ -2273,6 +2288,7 @@ } } }, + "additionalProperties": false, "type": "object", "title": "ServiceConfiguration", "description": "Service configuration." @@ -2344,6 +2360,7 @@ "title": "Tls Key Password" } }, + "additionalProperties": false, "type": "object", "title": "TLSConfiguration", "description": "TLS configuration." @@ -2402,6 +2419,7 @@ "title": "Transcripts Storage" } }, + "additionalProperties": false, "type": "object", "title": "UserDataCollection", "description": "User data collection configuration." diff --git a/src/app/endpoints/feedback.py b/src/app/endpoints/feedback.py index 41c8a367..c8e81877 100644 --- a/src/app/endpoints/feedback.py +++ b/src/app/endpoints/feedback.py @@ -190,6 +190,7 @@ async def update_feedback_status( Takes a request with the desired state of the feedback status. Returns the updated state of the feedback status based on the request's value. + These changes are for the life of the service and are on a per-worker basis. Returns: StatusResponse: Indicates whether feedback is enabled. diff --git a/src/models/responses.py b/src/models/responses.py index 8d402d73..dbdd17e6 100644 --- a/src/models/responses.py +++ b/src/models/responses.py @@ -573,7 +573,8 @@ class ErrorResponse(BaseModel): class FeedbackStatusUpdateResponse(BaseModel): - """Model representing a response to a feedback status update request. + """ + Model representing a response to a feedback status update request. Attributes: status: The previous and current status of the service and who updated it.