Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/endpoints/authorized.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ async def authorized_endpoint_handler(
Process POST requests to the /authorized endpoint, returning
the authenticated user's ID and username.

The response intentionally omits any authentication token.

Returns:
AuthorizedResponse: Contains the user ID and username of the authenticated user.
"""
Expand Down
2 changes: 2 additions & 0 deletions src/app/endpoints/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async def config_endpoint_handler(
Process GET requests to the /config endpoint and returns the
current service configuration.

Ensures the application configuration is loaded before returning it.

Returns:
ConfigurationResponse: The loaded service configuration response.
"""
Expand Down
6 changes: 6 additions & 0 deletions src/app/endpoints/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ async def info_endpoint_handler(
Process GET requests to the /info endpoint, returning the
service name, version and Llama-stack version.

Raises:
HTTPException: with status 500 and a detail object
containing `response` and `cause` when unable to connect to
Llama Stack. It can also return status 401 or 403 for
unauthorized access.
Comment on lines +47 to +51
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incorrect HTTP status code in docstring.

The docstring states "status 500" but the actual code raises a 503 Service Unavailable (via ServiceUnavailableResponse at line 81). This matches the get_info_responses dictionary at line 31 which declares 503: ServiceUnavailableResponse.

📝 Suggested fix
     Raises:
-        HTTPException: with status 500 and a detail object
+        HTTPException: with status 503 and a detail object
         containing `response` and `cause` when unable to connect to
         Llama Stack. It can also return status 401 or 403 for
         unauthorized access.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Raises:
HTTPException: with status 500 and a detail object
containing `response` and `cause` when unable to connect to
Llama Stack. It can also return status 401 or 403 for
unauthorized access.
Raises:
HTTPException: with status 503 and a detail object
containing `response` and `cause` when unable to connect to
Llama Stack. It can also return status 401 or 403 for
unauthorized access.
🤖 Prompt for AI Agents
In `@src/app/endpoints/info.py` around lines 47 - 51, Update the docstring in
src/app/endpoints/info.py to reflect the actual HTTP status used: change the
description that currently says "status 500" to "status 503 Service Unavailable"
(or explicitly reference ServiceUnavailableResponse) and note that the raised
HTTPException includes a detail object containing `response` and `cause` when
unable to connect to Llama Stack; ensure this text aligns with the
get_info_responses mapping and the ServiceUnavailableResponse used in the
function (e.g., where ServiceUnavailableResponse is raised).


Returns:
InfoResponse: An object containing the service's name and version.
"""
Expand Down
Loading