From 057cae426fd978a808fe1cc39460b14bddff2dd3 Mon Sep 17 00:00:00 2001 From: Twisha Bansal Date: Mon, 9 Feb 2026 11:27:09 +0530 Subject: [PATCH] update js docs according to python PR --- docs/en/samples/pre_post_processing/js.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/en/samples/pre_post_processing/js.md b/docs/en/samples/pre_post_processing/js.md index 9705cd98ed..94284a7f33 100644 --- a/docs/en/samples/pre_post_processing/js.md +++ b/docs/en/samples/pre_post_processing/js.md @@ -1,14 +1,15 @@ --- -title: "(JS) Pre and post processing" +title: "Javascript" type: docs -weight: 5 +weight: 2 description: > - How to add pre and post processing to your JS toolbox applications. + How to add pre- and post- processing to your Agents using JS. --- ## Prerequisites -This tutorial assumes that you have set up a basic toolbox application as described in the [local quickstart](../../getting-started/local_quickstart_js). +This tutorial assumes that you have set up Toolbox with a basic agent as described in the [local quickstart](../../getting-started/local_quickstart_js). + This guide demonstrates how to implement these patterns in your Toolbox applications. @@ -19,7 +20,7 @@ This guide demonstrates how to implement these patterns in your Toolbox applicat Coming soon. {{% /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. +The following example demonstrates how to use `ToolboxClient` with LangChain's middleware to implement pre- and post- processing for tool calls. ```js {{< include "js/langchain/agent.js" >}} @@ -28,3 +29,13 @@ The following example demonstrates how to use `ToolboxClient` with LangChain's m For more information, see the [LangChain Middleware documentation](https://docs.langchain.com/oss/javascript/langchain/middleware/custom#tool-call-monitoring). {{% /tab %}} {{< /tabpane >}} + +## Results + +The output should look similar to the following. Note that exact responses may vary due to the non-deterministic nature of LLMs and differences between orchestration frameworks. + +``` +AI: Booking Confirmed! You earned 500 Loyalty Points with this stay. + +AI: Error: Maximum stay duration is 14 days. +``` \ No newline at end of file