Skip to content

docs: add pre/post processing best practices#2435

Merged
twishabansal merged 59 commits into
mainfrom
processing-best-practice
Feb 18, 2026
Merged

docs: add pre/post processing best practices#2435
twishabansal merged 59 commits into
mainfrom
processing-best-practice

Conversation

@twishabansal

Copy link
Copy Markdown
Contributor

Description

Should include a concise description of the changes (bug or feature), it's
impact, along with a summary of the solution

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 3, 2026 14:11
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 9, 2026 06:20
@twishabansal twishabansal requested a review from a team February 9, 2026 06:20
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @twishabansal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the existing documentation for pre/post-processing by introducing a dedicated 'Best Practices' section. These new guidelines aim to equip developers with actionable strategies to improve the security, observability, performance, and error handling capabilities of their tools and agents, fostering the creation of more robust, efficient, and maintainable systems.

Highlights

  • Documentation Enhancement: A new, comprehensive 'Best Practices' section has been added to the pre/post-processing documentation, providing guidelines for various aspects of tool and agent development.
  • Security & Guardrails: New recommendations cover the principle of least privilege, input sanitization to protect against PII leakage, and prompt injection defense mechanisms.
  • Observability & Debugging: Guidelines for structured logging with correlation IDs and redundant logging for improved testability have been introduced.
  • Performance & Cost Optimization: Best practices for token economy (stripping unnecessary data) and caching for read-heavy tools are now included to optimize performance and reduce costs.
  • Error Handling: Advice on implementing graceful degradation and enabling self-correction for LLMs through well-formatted error messages has been added.
Changelog
  • docs/en/samples/pre_post_processing/_index.md
    • Added a new top-level section titled 'Best Practices'.
    • Included a 'Security & Guardrails' sub-section with advice on least privilege, input sanitization, and prompt injection defense.
    • Added an 'Observability & Debugging' sub-section, recommending structured logging and redundant logging for testability.
    • Introduced a 'Performance & Cost Optimization' sub-section, covering token economy and caching strategies.
    • Provided an 'Error Handling' sub-section with guidance on graceful degradation and self-correction.
Activity
  • The pull request was created by twishabansal.
  • No human activity (comments, reviews) has occurred yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

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

Copy link
Copy Markdown
Contributor

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 adds a new 'Best Practices' section to the pre/post-processing documentation. The new content is well-structured and provides valuable guidance on security, observability, performance, and error handling. I have one minor suggestion to improve the clarity of a heading in the new documentation.

Comment thread docs/en/samples/pre_post_processing/_index.md Outdated
@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Base automatically changed from processing-docs to main February 10, 2026 16:41
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Comment thread docs/en/samples/pre_post_processing/golden.txt Outdated
@twishabansal twishabansal enabled auto-merge (squash) February 18, 2026 06:55
@github-actions

Copy link
Copy Markdown
Contributor

@twishabansal twishabansal merged commit 06e01ae into main Feb 18, 2026
14 checks passed
@twishabansal twishabansal deleted the processing-best-practice branch February 18, 2026 07:16
@github-actions

Copy link
Copy Markdown
Contributor

🧨 Preview deployments removed.

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

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## 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>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com> 06e01ae
github-actions Bot pushed a commit to renovate-bot/googleapis-_-genai-toolbox that referenced this pull request Feb 18, 2026
## Description

> Should include a concise description of the changes (bug or feature),
it's
> impact, along with a summary of the solution

## 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>
Co-authored-by: Yuan Teoh <45984206+Yuan325@users.noreply.github.com>
Co-authored-by: Averi Kitsch <akitsch@google.com> 06e01ae
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants