This repository has been archived on 2026-03-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
YLHP_HR_2.0/main.py
JiaoTianBo 04596d298b feat(recruiter): 添加招聘者账号管理模块及相关支持
- 新增招聘者账号数据库表结构及SQL建表脚本
- 实现招聘者实体类及账号状态枚举
- 添加SQLAlchemy数据库模型及管理器支持招聘者数据存储
- 实现招聘者数据访问层(Mapper)进行增删改查操作
- 开发招聘者服务层,支持账号添加、启用、停用、删除、列表及爬虫注册
- 新增命令行工具add_recruiter.py,便于管理招聘者账号
- 修改主应用初始化流程,集成招聘者服务并通过数据库加载活跃账号爬虫
- 主程序示例中新增招聘者账号展示与调用爬取任务示范
- 更新项目依赖,增加SQLAlchemy、PyMySQL及Cryptography库支持
- 修改.gitignore,新增.qoder目录例外规则
2026-03-24 14:36:01 +08:00

97 lines
2.7 KiB
Python

"""Resume Intelligence Agent - Entry Point
简历智能体系统入口
Usage:
# 运行应用
uv run python main.py
# 或使用模块方式
uv run python -m src.main.python.cn.yinlihupo.ylhp_hr_2.0.main
Environment Variables:
# 数据库配置
DB_URL=mysql+pymysql://root:123456@10.200.8.25:3306/hr_agent
# LLM 配置
LLM_PROVIDER=mock
LLM_API_KEY=your_api_key
# 爬虫配置
CRAWLER_BOSS_WT_TOKEN=your_boss_token
# 通知配置
NOTIFY_WECHAT_WORK_WEBHOOK=https://qyapi.weixin.qq.com/cgi-bin/webhook/...
"""
import asyncio
import sys
from pathlib import Path
# 添加源码路径到 sys.path
src_path = Path(__file__).parent / "src" / "main" / "python"
if str(src_path) not in sys.path:
sys.path.insert(0, str(src_path))
# 导入应用
from cn.yinlihupo.ylhp_hr_2_0.main import HRAgentApplication, get_app
from cn.yinlihupo.ylhp_hr_2_0.domain.candidate import CandidateSource
async def demo():
"""演示:使用 HR Agent 进行简历处理"""
print("=" * 50)
print("简历智能体系统 - 演示")
print("=" * 50)
# 初始化应用
app = get_app()
# 显示招聘者账号
print("\n已配置的招聘者账号:")
recruiters = app.recruiter_service.list_recruiters()
if recruiters:
for r in recruiters:
status = "" if r.is_active() else ""
print(f" {status} {r.name} ({r.source.value}) - {r.status.value}")
else:
print(" - 暂无账号,请使用 add_recruiter.py 添加")
print("\n已注册爬虫:")
for source in app.crawler_factory.get_registered_sources():
print(f" - {source.value}")
print("\n已配置通知渠道:")
if app.notification_service:
for channel_type in app.notification_service.get_configured_channels():
print(f" - {channel_type.value}")
else:
print(" - 无")
print("\n可用的评价方案:")
schemas = app.analyzer.schema_service.list_schemas()
for schema in schemas:
default_mark = " (默认)" if schema.is_default else ""
print(f" - {schema.name}{default_mark}")
print("\n" + "=" * 50)
print("系统初始化完成")
print("=" * 50)
# 示例:爬取并入库
# 1. 先获取职位列表
# jobs = app.get_jobs(CandidateSource.BOSS)
# if jobs:
# print(f"\n找到 {len(jobs)} 个职位")
# first_job = jobs[0]
# print(f"使用职位: {first_job.title}")
#
# # 2. 爬取该职位下的候选人
# await app.crawl_and_ingest(
# source=CandidateSource.BOSS,
# job_id=first_job.source_id
# )
if __name__ == "__main__":
asyncio.run(demo())