From fa521cc7e7ba903423f83abff280ea4fe2b253ae Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 12 May 2025 09:43:50 +0200 Subject: [PATCH 1/2] Updated index page --- src/app/endpoints/root.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/app/endpoints/root.py b/src/app/endpoints/root.py index f3bf6c8d..9b00bfa5 100644 --- a/src/app/endpoints/root.py +++ b/src/app/endpoints/root.py @@ -8,7 +8,20 @@ logger = logging.getLogger(__name__) router = APIRouter(tags=["root"]) +index_page = """ + + + Lightspeed core service + + +

Lightspeed core service

+ +
Swagger UI
+
ReDoc
+ + +""" @router.get("/", response_class=HTMLResponse) def root_endpoint_handler(request: Request) -> HTMLResponse: - return HTMLResponse("foo") + return HTMLResponse(index_page) From 05f0a1642e53c9424ba229a63b1288a68db42b4c Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 12 May 2025 09:44:03 +0200 Subject: [PATCH 2/2] Updated REST API endpoints --- src/app/endpoints/__init__.py | 1 + src/app/endpoints/health.py | 2 +- src/app/endpoints/models.py | 5 ++--- src/app/endpoints/query.py | 1 - src/app/endpoints/root.py | 1 + 5 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 src/app/endpoints/__init__.py diff --git a/src/app/endpoints/__init__.py b/src/app/endpoints/__init__.py new file mode 100644 index 00000000..04282dfb --- /dev/null +++ b/src/app/endpoints/__init__.py @@ -0,0 +1 @@ +"""Implementation of all endpoints.""" diff --git a/src/app/endpoints/health.py b/src/app/endpoints/health.py index 79be0b1e..cea167c7 100644 --- a/src/app/endpoints/health.py +++ b/src/app/endpoints/health.py @@ -13,8 +13,8 @@ from models.responses import ReadinessResponse, LivenessResponse, NotAvailableResponse -router = APIRouter(tags=["health"]) logger = logging.getLogger(__name__) +router = APIRouter(tags=["health"]) get_readiness_responses: dict[int | str, dict[str, Any]] = { diff --git a/src/app/endpoints/models.py b/src/app/endpoints/models.py index 546f7ad6..f2bc390f 100644 --- a/src/app/endpoints/models.py +++ b/src/app/endpoints/models.py @@ -1,11 +1,10 @@ """Handler for REST API call to provide info.""" -import asyncio import logging -from typing import Any, Optional +from typing import Any from fastapi import APIRouter, Request -from llama_stack_client import Agent, AgentEventLogger, RAGDocument, LlamaStackClient +from llama_stack_client import LlamaStackClient from models.responses import ModelsResponse diff --git a/src/app/endpoints/query.py b/src/app/endpoints/query.py index a2b4e357..f3bde3c8 100644 --- a/src/app/endpoints/query.py +++ b/src/app/endpoints/query.py @@ -5,7 +5,6 @@ from fastapi import APIRouter, Request -from version import __version__ from models.responses import QueryResponse logger = logging.getLogger(__name__) diff --git a/src/app/endpoints/root.py b/src/app/endpoints/root.py index 9b00bfa5..8c1b29b9 100644 --- a/src/app/endpoints/root.py +++ b/src/app/endpoints/root.py @@ -22,6 +22,7 @@ """ + @router.get("/", response_class=HTMLResponse) def root_endpoint_handler(request: Request) -> HTMLResponse: return HTMLResponse(index_page)