diff --git a/cookbook/agents/30_pre_and_post_hooks.py b/cookbook/agents/30_pre_and_post_hooks.py index 900387b8d..97a8bcab0 100644 --- a/cookbook/agents/30_pre_and_post_hooks.py +++ b/cookbook/agents/30_pre_and_post_hooks.py @@ -6,16 +6,16 @@ from phi.tools import tool, FunctionCall -def pre_hook(function_call: FunctionCall): - print(f"Pre-hook: {function_call.function.name}") - print(f"Arguments: {function_call.arguments}") - print(f"Result: {function_call.result}") +def pre_hook(fc: FunctionCall): + print(f"Pre-hook: {fc.function.name}") + print(f"Arguments: {fc.arguments}") + print(f"Result: {fc.result}") -def post_hook(function_call: FunctionCall): - print(f"Post-hook: {function_call.function.name}") - print(f"Arguments: {function_call.arguments}") - print(f"Result: {function_call.result}") +def post_hook(fc: FunctionCall): + print(f"Post-hook: {fc.function.name}") + print(f"Arguments: {fc.arguments}") + print(f"Result: {fc.result}") @tool(pre_hook=pre_hook, post_hook=post_hook)