From f0693409a7f520e5513bcf11de11f22c537588fd Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:06:22 +0330 Subject: [PATCH] Import source: axon/routers/index Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- axon/routers/index.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 axon/routers/index.py diff --git a/axon/routers/index.py b/axon/routers/index.py new file mode 100644 index 0000000..759fbe2 --- /dev/null +++ b/axon/routers/index.py @@ -0,0 +1,24 @@ +from fastapi import APIRouter + +from axon.models import ( + IndexSearchRequest, + IndexSearchResponse, + IngestRequest, + IngestResponse, +) +from axon.services.index import ingest_documents, search_index + +router = APIRouter() + + +@router.post("/ingest", response_model=IngestResponse) +async def ingest(request: IngestRequest) -> IngestResponse: + return IngestResponse(indexed=await ingest_documents(request.documents)) + + +@router.post("/index/search", response_model=IndexSearchResponse) +async def index_search(request: IndexSearchRequest) -> IndexSearchResponse: + return IndexSearchResponse( + query=request.query, + results=await search_index(request.query, request.max_results), + )