Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Dec 10, 2024
1 parent 8453edf commit 4a2c492
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cookbook/agents/30_pre_and_post_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4a2c492

Please sign in to comment.