From f74bae8ff66bf8dbfce7ba4e6cccc965b6bd8f0f Mon Sep 17 00:00:00 2001 From: Twisha Bansal <58483338+twishabansal@users.noreply.github.com> Date: Wed, 11 Feb 2026 13:40:07 +0530 Subject: [PATCH] Update agent.js --- docs/en/samples/pre_post_processing/js/adk/agent.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/en/samples/pre_post_processing/js/adk/agent.js b/docs/en/samples/pre_post_processing/js/adk/agent.js index 7b44719657..19f80a9aa3 100644 --- a/docs/en/samples/pre_post_processing/js/adk/agent.js +++ b/docs/en/samples/pre_post_processing/js/adk/agent.js @@ -13,9 +13,7 @@ const systemPrompt = ` Don't ask for confirmations from the user. `; -/** - * Pre-processing: Enforce Business Rules - */ +// Pre-Processing function preProcess({tool, args}) { const name = tool.name; console.log(`POLICY CHECK: Intercepting '${name}'`); @@ -33,9 +31,7 @@ function preProcess({tool, args}) { return undefined; } -/** - * Post-processing: Enrich Response - */ +// Post-Processing function postProcess({tool, response}) { const name = tool.name; console.log(`ENRICHING RESPONSE: Intercepting '${name}'`); @@ -82,6 +78,7 @@ export async function main() { description: 'Agent for hotel bookings and administration.', instruction: systemPrompt, tools: tools, + // Add any pre- and post- processing callbacks beforeToolCallback: preProcess, afterToolCallback: postProcess });