mirror of
https://github.com/discourse/discourse.git
synced 2026-08-06 13:08:40 +08:00
### settings Settings required for V2 captions: - discourse_ai_enabled = true - ai_post_image_descriptions_enabled = true - ai_helper_image_caption_agent must be set. It defaults to -26, the default image caption agent `+` optional tuning: - ai_post_image_descriptions_per_post_limit, default 10 - ai_post_image_descriptions_backfill_hourly_rate, default 0, so backfill is off by default - ai_post_image_descriptions_backfill_max_age_days, default 30 These settings are required for generation/backfill: - the selected `ai_helper_image_caption_agent` must exist and be enabled - the agent/persona must be vision-enabled - the resolved LLM must be vision-capable - credits must be available - ai_post_image_descriptions_backfill_hourly_rate > 0 for scheduled backfill ______ ### this pr ... does _a few things_. 1. removes the old AI image captioning flow (v1)... - removes the composer manual captioning UI - stops inserting generated captions into post raw - removes `image_caption` from the AI helper enabled features setting 2. adds the new post image description flow (v2)... - backfills descriptions for existing post images - stores descriptions in `ai_post_image_descriptions`, keyed by `post_id`, `locale`, and `base62_sha1` - keeps duplicate rows per post image instead of relying only on uploads - cook-time lookup, deletion, and per-post editing stay simple even when multiple posts reuse the same upload - doing this also prevents the author of one post image from affecting another post's image if they have the same image - uses `base62_sha1` and `locale` for reuse when the same image appears again - exposes caption editing from the composer preview for already-described post images - includes descriptions in search indexing without inserting them into raw - decorates cooked post images with localized `aria-description` - shows the AI description visibly in the lightbox under the existing image title |
||
|---|---|---|
| .. | ||
| fixtures | ||
| migrate | ||
| post_migrate | ||
| api_test_seeds.rb | ||
| structure.sql | ||