Conversation
✅ Deploy Preview for kongdeveloper ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
lmilan
marked this pull request as ready for review
September 17, 2026 14:30
cloudjumpercat
approved these changes
Sep 18, 2026
cloudjumpercat
left a comment
Contributor
There was a problem hiding this comment.
Just some nitpicks!
| @@ -1,9 +1,74 @@ | |||
| --- | |||
| description: Use powerful regular expressions, variables, and templates to transform API requests | |||
Contributor
Comment on lines
+10
to
+13
| tags: | ||
| - transformations | ||
| categories: | ||
| - transformations |
Contributor
There was a problem hiding this comment.
Suggested change
| tags: | |
| - transformations | |
| categories: | |
| - transformations |
| @@ -0,0 +1,8 @@ | |||
| This Policy lets you configure simple transformations of requests before {{site.ai_gateway}} forwards them to the upstream provider. These transformations can be simple substitutions or complex ones matching portions of incoming requests using regular expressions, saving those matched strings into variables, and substituting those strings into transformed requests using flexible templates. | |||
Contributor
There was a problem hiding this comment.
Suggested change
| This Policy lets you configure simple transformations of requests before {{site.ai_gateway}} forwards them to the upstream provider. These transformations can be simple substitutions or complex ones matching portions of incoming requests using regular expressions, saving those matched strings into variables, and substituting those strings into transformed requests using flexible templates. | |
| This Policy lets you configure transformations of requests before {{site.ai_gateway}} forwards them to the upstream provider. | |
| These transformations can be simple substitutions or complex ones. | |
| For example, complex transformations can match portions of incoming requests using regular expressions, save those matched strings into variables, and substitute those strings into transformed requests using flexible templates. |
| @@ -0,0 +1,8 @@ | |||
| This Policy lets you configure simple transformations of requests before {{site.ai_gateway}} forwards them to the upstream provider. These transformations can be simple substitutions or complex ones matching portions of incoming requests using regular expressions, saving those matched strings into variables, and substituting those strings into transformed requests using flexible templates. | |||
|
|
|||
| This Policy operates on the raw HTTP request only: headers, query string, and body fields. To transform a request based on its meaning, using an LLM (for example, rewriting a prompt), use the [AI Request Transformer Policy](/ai-gateway/policies/ai-request-transformer/) instead. | |||
Contributor
There was a problem hiding this comment.
Suggested change
| This Policy operates on the raw HTTP request only: headers, query string, and body fields. To transform a request based on its meaning, using an LLM (for example, rewriting a prompt), use the [AI Request Transformer Policy](/ai-gateway/policies/ai-request-transformer/) instead. | |
| This Policy operates on the raw HTTP request only: headers, query string, and body fields. To transform a request based on its meaning using an LLM (for example, rewriting a prompt), use the [AI Request Transformer Policy](/ai-gateway/policies/ai-request-transformer/) instead. |
|
|
||
| {% include md/ai-gateway/v2/policies/request-response-transformer/templates.md %} | ||
|
|
||
| ## Example |
Contributor
There was a problem hiding this comment.
Suggested change
| ## Example | |
| ## Example: Remove Anthropic-specific beta fields |
|
|
||
| {% include md/ai-gateway/v2/policies/request-response-transformer/request-transformer-description.md %} | ||
|
|
||
| The Request Transformer Advanced Policy provides features that aren't available in the [Request Transformer Policy](/ai-gateway/policies/request-transformer/), including the ability to limit the list of allowed parameters in the request body with the [config.allow.body](./reference/#schema--config-allow-body) parameter. |
Contributor
There was a problem hiding this comment.
Suggested change
| The Request Transformer Advanced Policy provides features that aren't available in the [Request Transformer Policy](/ai-gateway/policies/request-transformer/), including the ability to limit the list of allowed parameters in the request body with the [config.allow.body](./reference/#schema--config-allow-body) parameter. | |
| The Request Transformer Advanced Policy provides features that aren't available in the [Request Transformer Policy](/ai-gateway/policies/request-transformer/), including the ability to limit the list of allowed parameters in the request body with the [`config.allow.body`](./reference/#schema--config-allow-body) parameter. |
|
|
||
| Body transformations are only performed for requests where the `Content-Type` header is set to `application/json`. | ||
|
|
||
| ## Example |
Contributor
There was a problem hiding this comment.
Suggested change
| ## Example | |
| ## Example: Define JSON fields a client can send and move query parameters |
| 1. [Rename](./reference/#schema--config-rename) | ||
| 1. [Replace](./reference/#schema--config-replace) | ||
| 1. [Add](./reference/#schema--config-add) | ||
| 1. [Append](./reference/#schema--config-append) |
Contributor
There was a problem hiding this comment.
Suggested change
| 1. [Append](./reference/#schema--config-append) | |
| 1. [Append](./reference/#schema--config-append) | |
| 1. [Allow](./reference/#schema--config-allow) |
Learned this from Hal https://kongstrong.slack.com/archives/C0B913DUBLP/p1789766639575629?thread_ts=1789766632.370589&cid=C0B913DUBLP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Fixes #6406
Fixes #6407
Preview Links
Checklist
descriptionentry in frontmatter.