diff --git a/README.md b/README.md index 56e67d6..f7e4ecb 100644 --- a/README.md +++ b/README.md @@ -117,9 +117,11 @@ Careful while loading embeddings, it uses the OpenAI API, and hence make sure th #### Navigate to the UI on the browser ```bash -http://localhost: +https://localhost: ``` +Note that the URL uses `https`, and hence in the browser you will get a warning about the insecure connection. You can ignore it and proceed. + #### In case, you wish to update frontend dependencies, run the following commands in the `ui` directory: ```bash diff --git a/docs/source/api.rst b/docs/source/api.rst index 422d237..e75a50c 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -1,7 +1,7 @@ API Reference ============= -This section provides detailed information about the API endpoints. +This section provides detailed information about the API endpoints for the Health Recommendation System. Health Recommendations ---------------------- @@ -21,13 +21,42 @@ Health Recommendations "radius": 5000 } - :json string recommendation: Generated recommendation text - :>json array services: List of relevant health services + :json string message: Generated recommendation text :>json boolean is_emergency: Indicates if the query suggests an emergency + :>json boolean is_out_of_scope: Indicates if the query is outside service scope + :>json array services: List of relevant health services (optional) + :>json boolean no_services_found: Indicates if no matching services were found :status 200: Recommendation generated successfully :status 422: Invalid request parameters :status 500: Server error @@ -45,8 +74,20 @@ Question Generation GET /questions?query=mental+health+support&recommendation=Based+on+your+query... - :query string query: The user's original health query - :query string recommendation: The previously generated recommendation + :query string query: The user's original health query (required) + :query string recommendation: The previously generated recommendation (required) + + **Response Body** + + .. code-block:: json + + { + "questions": [ + "Do you prefer in-person or virtual care?", + "What type of mental health support are you looking for?" + ] + } + :>json array questions: List of generated follow-up questions :status 200: Questions generated successfully :status 400: Invalid query parameters @@ -75,13 +116,38 @@ Recommendation Refinement "recommendation": "Previous recommendation text..." } - :json string recommendation: Refined recommendation text - :>json array services: Updated list of relevant services + :json string message: Refined recommendation text :>json boolean is_emergency: Updated emergency status + :>json boolean is_out_of_scope: Updated scope status + :>json array services: Updated list of relevant services (optional) + :>json boolean no_services_found: Indicates if no matching services were found :status 200: Recommendation refined successfully :status 422: Invalid request data :status 500: Server error @@ -93,24 +159,27 @@ Service Information Retrieve all available health services from the database. - :>json array services: List of all health services with details: + **Response Body** .. code-block:: json - [{ - "id": "service_id", - "name": "Service Name", - "description": "Service description", - "categories": ["category1", "category2"], - "address": "123 Health St", - "phone_numbers": [{ - "number": "+1-123-456-7890", - "type": "Main" - }], - "website": "https://example.com", - "hours": "Monday-Friday 9AM-5PM" - }] - + [ + { + "id": "service_id", + "name": "Service Name", + "description": "Service description", + "categories": ["category1", "category2"], + "address": "123 Health St", + "phone_numbers": [{ + "number": "+1-123-456-7890", + "type": "Main" + }], + "website": "https://example.com", + "hours": "Monday-Friday 9AM-5PM" + } + ] + + :>json array services: List of all health services :status 200: Services retrieved successfully :status 500: Server error @@ -118,6 +187,14 @@ Service Information Get the total number of available health services. + **Response Body** + + .. code-block:: json + + { + "count": 150 + } + :>json integer count: Total number of services in the database :status 200: Count retrieved successfully :status 500: Server error @@ -132,3 +209,11 @@ All endpoints may return the following error responses: { "detail": "Error message describing what went wrong" } + +Common HTTP Status Codes +------------------------ + +- ``200 OK``: Request successful +- ``400 Bad Request``: Invalid parameters +- ``422 Unprocessable Entity``: Invalid request body +- ``500 Internal Server Error``: Server-side error diff --git a/docs/source/index.md b/docs/source/index.md index b17ebd0..e45a518 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -125,9 +125,11 @@ Careful while loading embeddings, it uses the OpenAI API, and hence make sure th #### Navigate to the UI on the browser ```bash -http://localhost: +https://localhost: ``` +Note that the URL uses `https`, and hence in the browser you will get a warning about the insecure connection. You can ignore it and proceed. + #### In case, you wish to update frontend dependencies, run the following commands in the `ui` directory: ```bash