Assert no LLMContextFrame when run_llm is not set in message frame tests

This commit is contained in:
Paul Kompfner
2026-04-02 18:41:12 -04:00
parent 6111df947e
commit 70469e3c0c

View File

@@ -92,9 +92,13 @@ class TestLLMUserAggregator(unittest.IsolatedAsyncioTestCase):
] ]
) )
] ]
expected_down_frames = [
SpeechControlParamsFrame # no LLMContextFrame expected, run_llm defaults to False
]
await run_test( await run_test(
pipeline, pipeline,
frames_to_send=frames_to_send, frames_to_send=frames_to_send,
expected_down_frames=expected_down_frames,
) )
assert context.messages[0]["content"] == "Hi there!" assert context.messages[0]["content"] == "Hi there!"
@@ -135,9 +139,13 @@ class TestLLMUserAggregator(unittest.IsolatedAsyncioTestCase):
] ]
) )
] ]
expected_down_frames = [
SpeechControlParamsFrame # no LLMContextFrame expected, run_llm defaults to False
]
await run_test( await run_test(
pipeline, pipeline,
frames_to_send=frames_to_send, frames_to_send=frames_to_send,
expected_down_frames=expected_down_frames,
) )
assert context.messages[0]["content"] == "Hi there!" assert context.messages[0]["content"] == "Hi there!"
@@ -1038,6 +1046,7 @@ class TestLLMAssistantAggregator(unittest.IsolatedAsyncioTestCase):
) )
], ],
frames_to_send_direction=FrameDirection.UPSTREAM, frames_to_send_direction=FrameDirection.UPSTREAM,
expected_up_frames=[], # no LLMContextFrame expected, run_llm defaults to False
) )
assert context.messages[0]["content"] == "Hi there!" assert context.messages[0]["content"] == "Hi there!"
@@ -1081,6 +1090,7 @@ class TestLLMAssistantAggregator(unittest.IsolatedAsyncioTestCase):
) )
], ],
frames_to_send_direction=FrameDirection.UPSTREAM, frames_to_send_direction=FrameDirection.UPSTREAM,
expected_up_frames=[], # no LLMContextFrame expected, run_llm defaults to False
) )
assert context.messages[0]["content"] == "Hi there!" assert context.messages[0]["content"] == "Hi there!"
@@ -1125,6 +1135,7 @@ class TestLLMAssistantAggregator(unittest.IsolatedAsyncioTestCase):
aggregator, aggregator,
frames_to_send=[LLMMessagesTransformFrame(transform=keep_user_messages)], frames_to_send=[LLMMessagesTransformFrame(transform=keep_user_messages)],
frames_to_send_direction=FrameDirection.UPSTREAM, frames_to_send_direction=FrameDirection.UPSTREAM,
expected_up_frames=[], # no LLMContextFrame expected, run_llm defaults to False
) )
assert len(context.messages) == 2 assert len(context.messages) == 2
assert context.messages[0]["content"] == "Hello" assert context.messages[0]["content"] == "Hello"