from sqlalchemy.ext.asyncio import AsyncSession from externals.databases.pg_models import CVUser from services.agentic.filter import AgenticFilterService from services.agentic.weight import AgenticWeightService from services.agentic.profile_scoring import AgenticScoringService # from services.agentic.matching import AgenticMatchingService from utils.logger import get_logger logger = get_logger("agentic setup") class AgenticService: """ Facade / Orchestrator for all Agentic services """ def __init__(self, db: AsyncSession, user: CVUser): self.db = db self.user = user self.filter = AgenticFilterService(db, user) self.weight = AgenticWeightService(db, user) self.score = AgenticScoringService(db, user) # self.filter = AgenticMatchingService(db, user) # self.filter = AgenticScoringService(db, user) # async def scoring_profile(self, input_scoring: PayloadMatchOne): # "Generate profile scoring from an extracted profile and a criteria" # try: # profile : Profile = await get_profile(input_scoring.get("profile_id")) # # profile : Profile = asyncio.run(get_profile(input_scoring.get("profile_id"))) # tobe_match = InputScoring( # **profile, # criteria=input_scoring.get("criteria"), # criteria_weight=input_scoring.get("criteria_weight") # ) # output = await match_one(input_scoring=tobe_match) # # output = asyncio.run(match_one_profile(input_scoring=tobe_match)) # return output # except Exception as E: # logger.error(f"❌ scoring profile error, {E}") # return ResponseExtractOne( # status="failed", # message=f"scoring profile error, {E}", # ) # async def scoring_bulk_profile(self, input_scorings: PayloadMatchBulk): # "Generate profile scoring from list of extracted profile and a criteria" # try: # input_scoring_bulk = InputScoringBulk( # profile_ids=input_scorings.get("profile_ids"), # criteria=input_scorings.get("criteria"), # criteria_weight=input_scorings.get("criteria_weight"), # ) # outputs = await match_bulk(input_scoring_bulk) # return outputs # except Exception as E: # logger.error(f"❌ scoring profile bulk error, {E}") # return ResponseMatchBulk( # status="failed", # message=f"scoring profile bulk error, {E}", # )