Skip to content

docs: add pre/post processing docs for ADK Python#2534

Merged
twishabansal merged 55 commits intomainfrom
adk-python-processing
Feb 26, 2026
Merged

docs: add pre/post processing docs for ADK Python#2534
twishabansal merged 55 commits intomainfrom
adk-python-processing

Conversation

@twishabansal
Copy link
Copy Markdown
Contributor

@twishabansal twishabansal commented Feb 20, 2026

Description

Created again on accidental deletion of #2433

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

twishabansal and others added 30 commits February 20, 2026 12:06
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Explicitly document that these capabilities are typically provided by orchestration frameworks (like LangChain, LangGraph) rather than the Toolbox SDK itself, but that Toolbox tools are designed to leverage them.
@twishabansal twishabansal marked this pull request as ready for review February 20, 2026 07:04
@twishabansal twishabansal requested a review from a team February 20, 2026 07:04
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Python examples for pre- and post-processing using ADK, which is a valuable addition. The documentation has been updated and tests have been improved to be data-driven. However, there are a few issues in the new example code and documentation that need attention. Specifically, there are logical errors in the example test cases for both ADK and LangChain, where the conditions to trigger the pre-processing logic are not met. Additionally, a significant portion of the 'Best Practices' documentation has been removed, and it would be beneficial to clarify the reasoning behind this change.

I am having trouble creating individual review comments. Click here to see my feedback.

docs/en/samples/pre_post_processing/python/adk/agent.py (131)

high

This test case is intended to demonstrate a policy violation for a stay longer than 14 days, which is checked in the enforce_business_rules pre-processing callback. However, this callback only triggers for the update-hotel tool. The user input 'Book a hotel...' will likely call the book-hotel tool instead. To correctly test the pre-processing logic, the user input should be phrased as an update.

        "Update my booking for hotel 5 with checkin date 2025-01-18 and checkout date 2025-02-10",

docs/en/samples/pre_post_processing/python/langchain/agent.py (97)

high

This test case is meant to test the pre-processing logic that prevents hotel stays longer than 14 days. However, the checkout date has been changed to '2025-01-20', making the stay only 2 days long. This no longer triggers the policy violation. To correctly demonstrate the pre-processing rule, the checkout date should result in a stay longer than 14 days, for example, by reverting to '2025-02-20'.

        user_input = "Update my hotel with id 3 with checkin date 2025-01-18 and checkout date 2025-02-20."

docs/en/samples/pre_post_processing/_index.md (53-79)

medium

This change removes the entire 'Best Practices' section, which contained valuable information on security, observability, performance, and error handling. Was this removal intentional? If this content is being moved to another page, it would be helpful to include a link. Otherwise, please consider restoring this section as it provides important guidance for developers.

docs/en/samples/pre_post_processing/python/adk/agent.py (16)

medium

There's a grammatical error in the system prompt. it's name should be its name.

  cancellations. When the user searches for a hotel, mention its name, id,

docs/en/samples/pre_post_processing/python/adk/agent.py (26-28)

medium

There's a typo in the function name. It should be enforce_business_rules. Please also update its usage on line 112.

async def enforce_business_rules(
    tool: ToolboxTool, args: Dict[str, Any], tool_context: ToolContext
) -> Optional[Dict[str, Any]]:

@github-actions
Copy link
Copy Markdown
Contributor

Base automatically changed from twishabansal-patch-4 to main February 20, 2026 10:38
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@twishabansal twishabansal requested a review from a team as a code owner February 24, 2026 08:22
@github-actions
Copy link
Copy Markdown
Contributor

@Yuan325 Yuan325 added the release candidate Use label to signal PR should be included in the next release. label Feb 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@twishabansal twishabansal merged commit 0158206 into main Feb 26, 2026
17 of 19 checks passed
@twishabansal twishabansal deleted the adk-python-processing branch February 26, 2026 14:06
@github-actions
Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

github-actions Bot pushed a commit that referenced this pull request Feb 26, 2026
## Description

Created again on accidental deletion of
#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 0158206
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Feb 26, 2026
…#2534)

## Description

Created again on accidental deletion of
googleapis#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 0158206
github-actions Bot pushed a commit to Anthrino/genai-toolbox that referenced this pull request Feb 26, 2026
…#2534)

## Description

Created again on accidental deletion of
googleapis#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 0158206
github-actions Bot pushed a commit to pepe57/genai-toolbox that referenced this pull request Feb 26, 2026
…#2534)

## Description

Created again on accidental deletion of
googleapis#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 0158206
github-actions Bot pushed a commit to Jaleel-zhu/genai-toolbox that referenced this pull request Feb 26, 2026
…#2534)

## Description

Created again on accidental deletion of
googleapis#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> 0158206
AjmeraParth132 pushed a commit to AjmeraParth132/genai-toolbox that referenced this pull request Mar 2, 2026
## Description

Created again on accidental deletion of
googleapis#2433

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  before writing your code! That way we can discuss the change, evaluate
  designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [ ] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change

🛠️ Fixes #<issue_number_goes_here>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release candidate Use label to signal PR should be included in the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants