diff --git a/contributing/samples/callbacks/agent.py b/contributing/samples/callbacks/agent.py index 0a45aba..b849e50 100755 --- a/contributing/samples/callbacks/agent.py +++ b/contributing/samples/callbacks/agent.py @@ -92,7 +92,9 @@ def after_agent_cb1(callback_context): def after_agent_cb2(callback_context): print('@after_agent_cb2') - return types.Content( + # ModelContent (or Content with role set to 'model') must be returned. + # Otherwise, the event will be excluded from the context in the next turn. + return types.ModelContent( parts=[ types.Part( text='(stopped) after_agent_cb2',