Repository navigation
Keep short draw requests verbatim as image captions - #286
Merged
Merged
Conversation
An explicit draw command (`нарисуй X`, `!draw X`, `% X`) now records X in the message meta as `draw_request`. When X has at most 10 words and the picture is generated from text only, draw_image and draw_api show X unchanged as the caption instead of the model-written caption, and an empty model caption no longer forces a retry. Longer requests, image edits and generations from source images keep the concise model caption. The generation prompt pipeline is unchanged.
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.
Summary
Short draw requests are shown as the image caption exactly as the user wrote them again.
нарисуй X,!draw X,% X) in the message meta asdraw_request.Xhas at most 10 words and the picture is generated from text only,draw_imageanddraw_apiuseXunchanged as the caption. The model-written caption is ignored for these requests, and an empty model caption no longer forces a retry.draw_requestfollows the trigger through canonical job params and mid-turn request replacement, in the same way asrequested_tool.pulldown-cmark0.13.5, quadratic wikilink parsing). The workspace now requirespulldown-cmark0.13.6.Why
Users write short draw requests as captions and tell stories through them. Since the readable-caption change, the model rewrites even short requests (
собаквака→Собака-квака), and users report that the bot changes their requests.Verification
cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(all passed)cargo audit: no vulnerabilities after the update;cargo test -p openplotva-telegram: 237 passed