Classify images inline instead of via batch API #86

Manually merged
marvin8 merged 2 commits from feat/issue-84-inline-vision into feat/issue-80-collect 2026-08-13 20:22:13 +00:00
Collaborator

Replaces the overnight Batch API vision job with inline image classification that runs in the stream fetch job, immediately after the text check:

  • save_fetched_posts now returns the newly-saved Post objects, so classification is scoped to the current fetch — not the historical backlog.
  • ai_batch.pyai_vision.py: the Batch API machinery (JSONL build/shard/upload/poll) and the ai_vision_batch cron job are gone.
  • _classify_fetched_posts runs text + vision inline per post. A failed download/API call leaves the post ai_would_reject = NULL (pending, reviewed manually); a post with no still image is marked pass.
  • Removed the AI_BATCH_HOUR setting; updated docs.

Also fixes the flaky test suite (intermittent SECRET_KEY placeholder errors) by setting SECRET_KEY in the AI test files before the settings singleton is imported.

Closes #84
Closes #82

Replaces the overnight Batch API vision job with inline image classification that runs in the stream fetch job, immediately after the text check: - `save_fetched_posts` now returns the newly-saved `Post` objects, so classification is scoped to the current fetch — not the historical backlog. - `ai_batch.py` → `ai_vision.py`: the Batch API machinery (JSONL build/shard/upload/poll) and the `ai_vision_batch` cron job are gone. - `_classify_fetched_posts` runs text + vision inline per post. A failed download/API call leaves the post `ai_would_reject = NULL` (pending, reviewed manually); a post with no still image is marked pass. - Removed the `AI_BATCH_HOUR` setting; updated docs. Also fixes the flaky test suite (intermittent `SECRET_KEY placeholder` errors) by setting `SECRET_KEY` in the AI test files before the `settings` singleton is imported. Closes #84 Closes #82
♻️ classify images inline instead of via batch API
Some checks failed
/ gitleaks (pull_request) Successful in 17s
/ pr-review (pull_request) Successful in 42s
/ checks (pull_request) Failing after 2m12s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
46ae38a906
🐛 set SECRET_KEY in AI tests to fix flaky app startup
All checks were successful
/ pr-review (pull_request) Successful in 43s
/ checks (pull_request) Successful in 2m13s
/ gitleaks (pull_request) Successful in 2m56s
/ publish (pull_request) Has been skipped
/ publish-container (pull_request) Has been skipped
/ deploy-docs (pull_request) Has been skipped
0bf8f26c19
marvin8 approved these changes 2026-08-13 20:21:31 +00:00
marvin8 manually merged commit fe019862da into feat/issue-80-collect 2026-08-13 20:22:13 +00:00
marvin8 deleted branch feat/issue-84-inline-vision 2026-08-13 20:30:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marvin8/dujiangyan!86
No description provided.