Route references found in full chunk prompts
This commit is contained in:
@@ -100,3 +100,25 @@ def test_builder_routes_connected_references_only_to_mentioning_chunks():
|
||||
assert bundle.reference_use == "Per chunk"
|
||||
assert bundle.selectors == ("1", "1,2", "off", "off", "off", "off", "off", "off", "off")
|
||||
assert bundle.images[0] is not None and bundle.images[1] is not None
|
||||
|
||||
|
||||
def test_builder_routes_references_mentioned_anywhere_in_each_chunk_prompt():
|
||||
value = {
|
||||
"clips": [
|
||||
{"slots": [{"start": 0, "end": 4, "text": "The subject walks."}]},
|
||||
{"slots": [{"start": 0, "end": 4, "text": "The subject stops."}]},
|
||||
]
|
||||
}
|
||||
result = DumasH3SequencePromptBuilder().build(
|
||||
2,
|
||||
4,
|
||||
"Preserve the environment from @R1.",
|
||||
json.dumps(value),
|
||||
"Use ambience from @R2.",
|
||||
"Music follows @R3.",
|
||||
reference_image_1=object(),
|
||||
reference_image_2=object(),
|
||||
reference_image_3=object(),
|
||||
)
|
||||
|
||||
assert result[3].selectors[:3] == ("1,2", "1,2", "1,2")
|
||||
|
||||
Reference in New Issue
Block a user