File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -258,16 +258,17 @@ async def _exec_with_plugin(
258258 early_exit_result = await plugin_manager .run_before_run_callback (
259259 invocation_context = invocation_context
260260 )
261- if isinstance (early_exit_result , Event ):
261+ if isinstance (early_exit_result , types .Content ):
262+ early_exit_event = Event (
263+ invocation_id = invocation_context .invocation_id ,
264+ author = 'model' ,
265+ content = early_exit_result ,
266+ )
262267 await self .session_service .append_event (
263268 session = session ,
264- event = Event (
265- invocation_id = invocation_context .invocation_id ,
266- author = 'model' ,
267- content = early_exit_result ,
268- ),
269+ event = early_exit_event ,
269270 )
270- yield early_exit_result
271+ yield early_exit_event
271272 else :
272273 # Step 2: Otherwise continue with normal execution
273274 async for event in execute_fn (invocation_context ):
You can’t perform that action at this time.
0 commit comments