diff --git a/docs/en/samples/pre_post_processing/js.md b/docs/en/samples/pre_post_processing/js.md index 1959e26acb..186d6bcaee 100644 --- a/docs/en/samples/pre_post_processing/js.md +++ b/docs/en/samples/pre_post_processing/js.md @@ -16,11 +16,15 @@ This guide demonstrates how to implement these patterns in your Toolbox applicat {{< tabpane persist=header >}} {{% tab header="ADK" text=true %}} -The following example demonstrates how to use the `beforeToolCallback` and `afterToolCallback` hooks in the ADK `LlmAgent` to implement pre and post processing logic. Specifically, it shows how to intercept tool calls to enforce business policies (blocking invalid actions) and enrich tool outputs (adding loyalty points) before they return to the model. +The following example demonstrates how to use the `beforeToolCallback` and `afterToolCallback` hooks in the ADK `LlmAgent` to implement pre and post processing logic. ```js {{< include "js/adk/agent.js" >}} ``` + +You can also add model-level (`beforeModelCallback`, `afterModelCallback`) and agent-level (`beforeAgentCallback`, `afterAgentCallback`) hooks to intercept messages at different stages of the execution loop. + +For more information, see the [ADK Callbacks documentation](https://google.github.io/adk-docs/callbacks/types-of-callbacks/). {{% /tab %}} {{% tab header="Langchain" text=true %}} The following example demonstrates how to use `ToolboxClient` with LangChain's middleware to implement pre and post processing for tool calls.