diff --git a/dify-agent/src/agenton/compositor/core.py b/dify-agent/src/agenton/compositor/core.py index 355b143356..4e77e9c1e0 100644 --- a/dify-agent/src/agenton/compositor/core.py +++ b/dify-agent/src/agenton/compositor/core.py @@ -14,7 +14,7 @@ hydrated deterministically. """ from collections import OrderedDict -from collections.abc import AsyncIterator, Mapping, Sequence +from collections.abc import AsyncGenerator, Mapping, Sequence from contextlib import asynccontextmanager from dataclasses import dataclass from typing import Any, Generic, cast @@ -178,7 +178,7 @@ class Compositor(Generic[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, *, configs: Mapping[str, LayerConfigInput] | None = None, session_snapshot: CompositorSessionSnapshotValue | None = None, - ) -> AsyncIterator[CompositorRun[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, LayerUserPromptT]]: + ) -> AsyncGenerator[CompositorRun[PromptT, ToolT, LayerPromptT, LayerToolT, UserPromptT, LayerUserPromptT]]: """Create a fresh run, enter layers in graph order, and yield it. Configs are keyed by layer node name and validated before factories run.