mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-10-16 06:58:51 +08:00
fix: clarify single-image animation montage notice
This commit is contained in:
@@ -127,8 +127,11 @@ async def prepare_request_images(
|
||||
req.extra_user_content_parts = [
|
||||
*req.extra_user_content_parts,
|
||||
TextPart(
|
||||
text="[Animated image] Animated inputs (e.g. GIF) have been converted "
|
||||
"to frame montages. Read each montage left to right, top to bottom "
|
||||
"as frames of the same animation; unused cells are blank."
|
||||
text="<system_notice>\n"
|
||||
"[Animated image] Each animated input (e.g. GIF) has been converted "
|
||||
"into a frame montage: a single image containing a grid of frames "
|
||||
"from the same animation. Read the frames left to right, then "
|
||||
"top to bottom; unused cells are blank.\n"
|
||||
"</system_notice>"
|
||||
).mark_as_temp(),
|
||||
]
|
||||
|
||||
@@ -348,11 +348,14 @@ async def test_animation_montage_notice_reaches_model(harness, tmp_path):
|
||||
notices = [
|
||||
part
|
||||
for part in harness.captured[-1].req.extra_user_content_parts
|
||||
if isinstance(part, TextPart) and part.text.startswith("[Animated image]")
|
||||
if isinstance(part, TextPart) and "[Animated image]" in part.text
|
||||
]
|
||||
assert len(notices) == int(expected)
|
||||
if expected:
|
||||
assert notices[0]._no_save and "frame montages" in notices[0].text
|
||||
assert notices[0]._no_save
|
||||
assert notices[0].text.startswith("<system_notice>\n")
|
||||
assert notices[0].text.endswith("\n</system_notice>")
|
||||
assert "a single image containing a grid of frames" in notices[0].text
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user