Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeantonio21 committed Oct 21, 2024
1 parent 3e7a42d commit 1656494
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,25 @@ impl IntoResponse for ChatResponse {
}
}

/// Handles health check requests.
///
/// This endpoint allows external services to check if the server is up and running.
/// It always returns a 200 OK status with a simple JSON message.
///
/// # Returns
///
/// Returns a JSON response with a "status" field set to "ok".
#[utoipa::path(
get,
path = "/healthz",
responses(
(status = 200, description = "Server is healthy", body = serde_json::Value)
)
)]
async fn healthz() -> impl IntoResponse {
Json(json!({"status": "ok"}))
}

/// Handles chat completion requests by processing the input, sending it to the LLM service,
/// and returning the generated response.
///
Expand Down

0 comments on commit 1656494

Please sign in to comment.