You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/callbacks/types-of-callbacks.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,33 @@ These callbacks are available on *any* agent that inherits from `BaseAgent` (inc
13
13
!!! Note
14
14
The specific method names or return types may vary slightly by SDK language (e.g., return `None` in Python, return `Optional.empty()` or `Maybe.empty()` in Java). Refer to the language-specific API documentation for details.
15
15
16
+
??? warning "Python: Use the documented callback parameter names"
17
+
18
+
In Python, callback function parameter names must match the documented
19
+
names exactly because ADK passes callback arguments by keyword. For example,
20
+
use `callback_context` for agent and model callbacks, and `tool_context` for
21
+
tool callbacks. Renaming these parameters to aliases such as `ctx` will cause
**When:** Called *immediately before* the agent's `_run_async_impl` (or `_run_live_impl`) method is executed. It runs after the agent's `InvocationContext` is created but *before* its core logic begins.
0 commit comments