mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-10 23:25:17 -05:00
update js docs according to python PR
This commit is contained in:
@@ -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.
|
||||
```
|
||||
Reference in New Issue
Block a user