fix(processor): make RenderMessagesStep.recipe optional for non-recipe pipelines

This commit is contained in:
Khalil Meftah
2026-07-10 14:05:08 +02:00
parent f5c2ee1753
commit c043a6c418
@@ -40,11 +40,14 @@ class RenderMessagesStep(ProcessorStep):
``message_streams`` / ``target_message_indices`` keys.
"""
recipe: TrainingRecipe
recipe: TrainingRecipe | None = None
dataset_ctx: Any | None = None
def __call__(self, transition: EnvTransition) -> EnvTransition | None:
"""Render messages for a single transition; return ``None`` to drop it."""
if self.recipe is None:
return transition
complementary_data = transition.get(TransitionKey.COMPLEMENTARY_DATA) or {}
persistent = complementary_data.get(LANGUAGE_PERSISTENT) or []
events = complementary_data.get(LANGUAGE_EVENTS) or []