refactor: remove httpx proxy, call GLiNER model directly
Robin+1: Claude Sonnet 4.6
bfeb704
- ner.py: restored GLiNER.from_pretrained with cache_dir
- config.py: restored MODEL_NAME, MODEL_CACHE_DIR, HF_ENDPOINT
- main.py: pass MODEL_NAME and MODEL_CACHE_DIR to NERService
- requirements.txt: replaced httpx with gliner
- conftest.py: restored gliner/torch stubs for unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: add /api/v1 prefix and restore port 4000
Robin+1: Claude Sonnet 4.6
9a7f7d0
- Routes changed to /api/v1/health and /api/v1/extract
- Default PORT reverted to 4000 (8000 was in use)
- conftest.py: remove gliner/torch stubs (ner.py now uses httpx)
- Tests updated to match new route prefix
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: GLiNER NER HTTP API
Robin+1: Claude Sonnet 4.6
d470d45
- POST /extract 接收文本和实体类型,返回抽取结果
- 模型启动时加载一次,多次请求复用
- 通过 HF_ENDPOINT 使用国内镜像,MODEL_CACHE_DIR 本地缓存
- 默认端口 4000,支持环境变量配置
- 包含单元测试(mock)和集成测试(真实 API)
- start.bat 从 conda ai 环境启动
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>