"""AI 人才引力场 Agent。 人才流动预测 + 主动推荐 + 9-Box 矩阵。 """ from app.services.llm_client import LLMClient async def predict_talent_flow(talent_data: str) -> dict: """AI 预测人才流动趋势。""" llm = LLMClient() prompt = f"""请分析以下人才数据,预测流动趋势: {talent_data[:4000]} 以 JSON 格式返回: {{"flow_predictions": [{{"talent_name": "姓名", "current_company": "当前公司", "flow_probability": 0.7, "likely_destinations": ["可能去向"], "reason": "原因"}}]}}""" result = await llm.chat(prompt, temperature=0.4) return result if isinstance(result, dict) else {"flow_predictions": []} async def recommend_talent(company_need: str, talent_pool: str) -> list[dict]: """AI 主动推荐人才给被投企业。""" llm = LLMClient() prompt = f"""请根据企业需求和人才池,推荐合适人才: 企业需求:{company_need[:2000]} 人才池:{talent_pool[:4000]} 以 JSON 数组格式返回: [{{"talent_name": "姓名", "match_score": 0.85, "reason": "推荐理由", "current_role": "当前职位"}}]""" result = await llm.chat(prompt, temperature=0.4) return result if isinstance(result, list) else []