Contact Us 1-800-596-4880

A2A Prompt Decorator Policy

Policy Name

A2A Prompt Decorator

Summary

Decorates prompts with context information

Category

A2A

First Flex Gateway version available

v1.9.3

Returned Status Codes

No return codes exist for this policy.

Summary

The A2A Prompt Decorator policy injects additional content into provided prompts before they are sent to the upstream server. You can specify the content to inject either as a DataWeave string parameter or by referencing a file. Additionally, you can use a DataWeave expression to filter which requests should have prompts decorated.

Configuring Policy Parameters

Flex Gateway Local Mode

The A2A Prompt Decorator policy isn’t supported in Local Mode.

Managed Flex Gateway and Flex Gateway Connected Mode

When you apply the policy to your API instance from the UI, the following parameters are displayed:

Element Description

Text Decorators

List of text decorations you want to add to the prompts.

Prompt Text

DataWeave Expression that generates the prompt text injected into the request. For example: #['Use Imperial metric units'].

Condition

DataWeave Expression that filters which prompts to decorate. For example: #[attributes.headers['id']==1].

File Decorators

List of file decorations to add to the prompts.

Condition

DataWeave Expression that filters which prompts to decorate. For example: #[attributes.headers['id']==1].

File Name

DataWeave Expression with the File Name. For example: #['Decorator name'].

File Mime Type

DataWeave Expression with the Mime Type of the file to inject. For example: #['application/json'].

File Source

Select Base64 if the file Content is base64-encoded data, or Uri if the file Content is a URL to an external file.

Content

DataWeave Expression containing either base64-encoded file content or a URL to download the content file. For example: #['https://domain/file-location'] or #['QmFzZTY0IGVuY29kZWQgZmlsZSBjb250ZW50'].