File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 4242from typing import Union
4343
4444
45- TInput = TypeVar ('TInput' )
4645TOutput = TypeVar ('TOutput' )
47- TCallback = TypeVar ('TCallback' , bound = Callable )
4846
4947
50- class CallbackPipeline (Generic [TInput , TOutput ]):
48+ class CallbackPipeline (Generic [TOutput ]):
5149 """Unified callback execution pipeline.
5250
5351 This class provides a consistent way to execute callbacks with the following
@@ -241,17 +239,10 @@ async def execute_with_plugins(
241239 ... )
242240 """
243241 # Step 1: Execute plugin callback (priority)
244- result = plugin_callback (* args , ** kwargs )
245- if inspect .isawaitable (result ):
246- result = await result
247-
242+ result = await CallbackPipeline ([plugin_callback ]).execute (* args , ** kwargs )
248243 if result is not None :
249244 return result
250245
251246 # Step 2: Execute agent callbacks if plugin returned None
252- if agent_callbacks :
253- pipeline = CallbackPipeline (callbacks = agent_callbacks )
254- result = await pipeline .execute (* args , ** kwargs )
255-
256- return result
247+ return await CallbackPipeline (agent_callbacks ).execute (* args , ** kwargs )
257248
You can’t perform that action at this time.
0 commit comments