Skip to content

Commit 3480801

Browse files
Merge pull request mendix#8711 from strategicalliances/patch-7
Update amazon-bedrock retrieve and generate.md
2 parents 268186e + c84d474 commit 3480801

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • content/en/docs/appstore/use-content/platform-supported-content/modules/aws

content/en/docs/appstore/use-content/platform-supported-content/modules/aws/amazon-bedrock.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,20 @@ The input and output for this service are shown in the table below:
252252

253253
The request object passed to this operation must include a KnowledgeBaseTool object, which can be added to the request using the [Request: Add Knowledge Base Tool to Collection](#add-knowledge-base-tool) operation.
254254

255+
##### Prompt Template {#PromptTemplate}
256+
257+
Amazon Bedrock's Retrieve and Generate action has a limitation: it does not support system prompts within the request. This can pose challenges when trying to orchestrate responses in specific ways, such as adopting a subject expert's tone or providing tailored advice when certain conditions are met (for example, suggesting contacting support if no search results are found).
258+
259+
To address this limitation, Amazon Bedrock offers a solution through prompt templates. A prompt template acts as an orchestration prompt that is sent along with the request response generation when a user queries a knowledge base using Amazon Bedrock's Retrieve and Generate feature. While prompt templates can contain instructions similar to system prompts, they are distinct and serve a different purpose in the query process.
260+
261+
Prompt templates allow for greater flexibility in response generation. When creating a prompt template, you can use various tokens to customize the output. It is crucial to note that the *$searchresult$* token is mandatory in every prompt template, as it represents where the retrieved information will be inserted.
262+
263+
By leveraging prompt templates, you can influence the tone, structure, and content of responses, even in scenarios where the standard Retrieve and Generate action might fall short. This feature enables more nuanced and context-appropriate interactions with the knowledge base.
264+
265+
For a deeper understanding of prompt templates and their implementation, refer to the [Amazon documentation on prompt templates](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-test-config.html#kb-test-config-sysprompt), which provides comprehensive guidance on their usage and best practices. .
266+
267+
For more information about how to structure your prompts, see [Prompt engineering](https://docs.mendix.com/appstore/modules/genai/prompt-engineering/).
268+
255269
#### Chatting with History {#retrieve-and-generate-with-history}
256270

257271
The `RetrieveAndGenerate` operation only allows a single user message to be part of the request. Unlike the `ChatCompletions` operation, it is not supported to send a history of messages to the model.

0 commit comments

Comments
 (0)