11import numpy
2- from fastapi import APIRouter , HTTPException , Depends
2+ from fastapi import APIRouter , Depends , HTTPException
33from welearn_database .data .models import ContextDocument
44
55from src .app .models .documents import JourneySectionType
99 collection_and_model_id_according_lang ,
1010 convert_embedding_bytes ,
1111)
12+ from src .app .services .search import SearchService , get_search_service
1213from src .app .services .sql_db import get_context_documents , get_subject , get_subjects
1314from src .app .utils .logger import logger as logger_utils
14- from src .app .services .search import SearchService , get_search_service
1515
1616router = APIRouter ()
1717logger = logger_utils (__name__ )
2323 description = "Retrieve all the subjects" ,
2424 response_model = list [str ],
2525)
26- async def get_subject_list (lang : str | None = None ,sp : SearchService = Depends (get_search_service )) -> list [str ]:
26+ async def get_subject_list (
27+ lang : str | None = None , sp : SearchService = Depends (get_search_service )
28+ ) -> list [str ]:
2729 collection_info , model_id = await collection_and_model_id_according_lang (
2830 sp = sp , lang = lang
2931 )
@@ -38,7 +40,12 @@ async def get_subject_list(lang: str | None = None,sp: SearchService = Depends(g
3840 summary = "get the full journey" ,
3941 description = "Get all documents for the micro learning journey of one sdg" ,
4042)
41- async def get_full_journey (sdg : int , subject : str , lang : str | None = None ):
43+ async def get_full_journey (
44+ sdg : int ,
45+ subject : str ,
46+ lang : str | None = None ,
47+ sp : SearchService = Depends (get_search_service ),
48+ ):
4249 collection_info , model_id = await collection_and_model_id_according_lang (
4350 sp = sp , lang = lang
4451 )
0 commit comments