fix(speakerdeck-knowledge): 画像読解のコンテキスト消費を抑える - #102
Merged
Merged
Conversation
This was referenced Sep 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
SpeakerDeck の読解で全ページの画像確認を促す指示があり、画像の寸法や再読の基準もなかったため、AI セッションへ必要以上の画像が入る可能性がありました。本文から確認対象を選び、縮小画像・必要領域の切り出し・少数ページの俯瞰画像を使って根拠を確認する流れに変更します。
対象プラグイン
変更内容
prepare_images.pyを追加。既定で長辺1280px以下のプレビュー、元画像からの切り出し、最大6ページのコンタクトシートを生成する。ページ指定は必須で、標準出力にはパス・ページ番号・寸法だけを返す。動作確認
python3 -m unittest discover -s plugins/speakerdeck-knowledge/tests -v: 20件成功。画像の寸法、ページ順と分割、切り出し、元画像の保持、キャッシュ再利用、透明画像、失敗時の挙動を確認。bash scripts/verify-versions.sh: 成功。bash scripts/tests/verify-versions-completeness.test.sh: 6件成功。quick_validate.py: スキル検証成功。git diff --check: 成功。チェックリスト
補足
実際のモデルによる一連の知識抽出と token 使用量の比較、ローカル marketplace への再インストールは未実施です。画像の枚数・寸法・再読を抑えるための変更であり、固定の token 削減率は示しません。