From 05e69dacac95fee8e0cdc6b2b6c99f23dc854f5f Mon Sep 17 00:00:00 2001
From: awstools Queries a knowledge base and generates responses based on the retrieved results. The response cites up to five sources but only selects the ones that are relevant to the query. The Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Session context. Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Control session context. Contains parameters that specify various attributes of the session. Contains parameters that specify various attributes of the session. For more information, see Control session context. Contains information about where the text with a citation begins and ends in the generated output. This data type is used in the following API operations:
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the Contains the part of the generated text that contains a citation, alongside where it begins and ends. This data type is used in the following API operations:
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the Contains metadata about a part of the generated response that is accompanied by a citation. This data type is used in the following API operations:
+ * Retrieve response – in the
+ * RetrieveAndGenerate response – in the Contains the cited text from the data source. This data type is used in the following API operations:
+ * Retrieve response – in the
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the Contains the S3 location of the data source. This data type is used in the following API operations:
+ * Retrieve response – in the
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the Contains information about the location of the data source. This data type is used in the following API operations:
+ * Retrieve response – in the
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the Contains metadata about a sources cited for the generated response. Contains metadata about a source cited for the generated response. This data type is used in the following API operations:
+ * RetrieveAndGenerate response – in the
+ * Retrieve response – in the An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source. This data type is used in the following API operations:
+ * Retrieve response – in the
+ * RetrieveAndGenerate response – in the Contains the query made to the knowledge base. This data type is used in the following API operations:
+ * RetrieveAndGenerate request – in the Contains the template for the prompt that's sent to the model for response generation. For more information, see Knowledge base prompt templates. This data type is used in the following API operations:
+ * RetrieveAndGenerate request
+ * The template for the prompt that's sent to the model for response generation. You can include prompt placeholders, which become replaced before the prompt is sent to the model to provide instructions and context to the model. In addition, you can include XML tags to delineate meaningful sections of the prompt template. For more information, see the following resources:
+ * Knowledge base prompt templates
+ * Contains configurations for response generation based on the knowledge base query results. This data type is used in the following API operations:
+ * RetrieveAndGenerate request
+ * Contains the template for the prompt that's sent to the model for response generation. Configurations for how to carry out the search. Configurations for how to perform the search query and return results. For more information, see Query configurations. This data type is used in the following API operations:
+ * Retrieve request – in the
+ * RetrieveAndGenerate request – in the The number of results to return. The The number of source chunks to retrieve. Contains details about how the results should be returned. Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations. This data type is used in the following API operations:
- * Retrieve request body
- * numberOfResults
field is currently unsupported for RetrieveAndGenerate
. Don't include it in the vectorSearchConfiguration object.
+ *
* @public
*/
export interface Span {
@@ -286,6 +297,17 @@ export interface Span {
/**
* span
fieldspan
field
+ *
* @public
*/
export interface TextResponsePart {
@@ -304,6 +326,17 @@ export interface TextResponsePart {
/**
* textResponsePart
fieldtextResponsePart
field
+ *
* @public
*/
export interface GeneratedResponsePart {
@@ -316,6 +349,21 @@ export interface GeneratedResponsePart {
/**
* generatedResponsePart
fieldgeneratedResponsePart
field
+ *
* @public
*/
export interface RetrievalResultContent {
@@ -328,6 +376,21 @@ export interface RetrievalResultContent {
/**
* content
fieldcontent
fieldcontent
field
+ *
* @public
*/
export interface RetrievalResultS3Location {
@@ -354,6 +417,21 @@ export type RetrievalResultLocationType =
/**
* s3Location
fields3Location
fields3Location
field
+ *
* @public
*/
export interface RetrievalResultLocation {
@@ -371,7 +449,18 @@ export interface RetrievalResultLocation {
}
/**
- * location
fieldlocation
fieldlocatino
field
+ *
* @public
*/
export interface RetrievedReference {
@@ -390,6 +479,17 @@ export interface RetrievedReference {
/**
* retrievedReferences
fieldretrievedReferences
field
+ *
* @public
*/
export interface Citation {
@@ -1608,6 +1708,13 @@ export interface InvokeAgentResponse {
/**
* citations
fieldcitations
field
+ *
* @public
*/
export interface RetrieveAndGenerateInput {
@@ -1618,6 +1725,59 @@ export interface RetrieveAndGenerateInput {
text: string | undefined;
}
+/**
+ * input
field
+ *
+ * @public
+ */
+export interface PromptTemplate {
+ /**
+ *
+ *
+ * @public
+ */
+ textPromptTemplate?: string;
+}
+
+/**
+ *
+ *
+ * @public
+ */
+export interface GenerationConfiguration {
+ /**
+ *
+ *
* @public
*/
export interface KnowledgeBaseVectorSearchConfiguration {
/**
- * vectorSearchConfiguration
fieldvectorSearchConfiguration
fieldnumberOfResults
field is currently unsupported for RetrieveAndGenerate
. Don't include it in this field if you are sending a RetrieveAndGenerate
request.
*
retrievalConfiguration
field
- * RetrieveAndGenerate request body - *
+ * RetrieveAndGenerate request – in theretrievalConfiguration
field
* Contains details about how the results from the vector search should be returned.
+ *Contains details about how the results from the vector search should be returned. For more information, see Query configurations.
* @public */ vectorSearchConfiguration: KnowledgeBaseVectorSearchConfiguration | undefined; @@ -1680,6 +1846,17 @@ export interface KnowledgeBaseRetrievalConfiguration { /** *Contains details about the resource being queried.
+ *This data type is used in the following API operations:
+ *
+ * Retrieve request – in the knowledgeBaseConfiguration
field
+ * RetrieveAndGenerate request – in the knowledgeBaseConfiguration
field
Contains configurations for response generation based on the knowwledge base query results.
+ * @public + */ + generationConfiguration?: GenerationConfiguration; } /** @@ -1717,6 +1900,13 @@ export type RetrieveAndGenerateType = (typeof RetrieveAndGenerateType)[keyof typ /** *Contains details about the resource being queried.
+ *This data type is used in the following API operations:
+ *
+ * RetrieveAndGenerate request – in the retrieveAndGenerateConfiguration
field
Contains configuration about the session with the knowledge base.
+ *This data type is used in the following API operations:
+ *
+ * RetrieveAndGenerate request – in the sessionConfiguration
field
Contains the query made to the knowledge base.
+ *Contains the query to be made to the knowledge base.
* @public */ input: RetrieveAndGenerateInput | undefined; /** - *Contains details about the resource being queried and the foundation model used for generation.
+ *Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
* @public */ retrieveAndGenerateConfiguration?: RetrieveAndGenerateConfiguration; @@ -1776,6 +1973,13 @@ export interface RetrieveAndGenerateRequest { /** *Contains the response generated from querying the knowledge base.
+ *This data type is used in the following API operations:
+ *
+ * RetrieveAndGenerate response – in the output
field
Contains the query made to the knowledge base.
+ *This data type is used in the following API operations:
+ *
+ * Retrieve request – in the retrievalQuery
field
The query to send the knowledge base.
+ *Contains the query to send the knowledge base.
* @public */ retrievalQuery: KnowledgeBaseQuery | undefined; /** - *Contains details about how the results should be returned.
+ *Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
* @public */ retrievalConfiguration?: KnowledgeBaseRetrievalConfiguration; @@ -1852,6 +2063,13 @@ export interface RetrieveRequest { /** *Details about a result from querying the knowledge base.
+ *This data type is used in the following API operations:
+ *
+ * Retrieve response – in the retrievalResults
field
An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source.
" + "smithy.api#documentation": "An object containing a segment of the generated response that is based on a source in the knowledge base, alongside information about the source.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the citations
field
\n RetrieveAndGenerate response – in the citations
field
Contains metadata about a part of the generated response that is accompanied by a citation.
" + "smithy.api#documentation": "Contains metadata about a part of the generated response that is accompanied by a citation.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the generatedResponsePart
field
\n RetrieveAndGenerate response – in the generatedResponsePart
field
Contains the template for the prompt that's sent to the model for response generation.
" + } + } + }, + "traits": { + "smithy.api#documentation": "Contains configurations for response generation based on the knowledge base query results.
\nThis data type is used in the following API operations:
\nContains parameters that specify various attributes of the session.
" + "smithy.api#documentation": "Contains parameters that specify various attributes of the session. For more information, see Control session context.
" } }, "agentId": { @@ -1316,7 +1330,7 @@ } }, "traits": { - "smithy.api#documentation": "Contains the query made to the knowledge base.
", + "smithy.api#documentation": "Contains the query made to the knowledge base.
\nThis data type is used in the following API operations:
\n\n Retrieve request – in the retrievalQuery
field
Contains details about how the results from the vector search should be returned.
", + "smithy.api#documentation": "Contains details about how the results from the vector search should be returned. For more information, see Query configurations.
", "smithy.api#required": {} } } }, "traits": { - "smithy.api#documentation": "Contains details about how the results should be returned.
\nThis data type is used in the following API operations:
\nContains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
\nThis data type is used in the following API operations:
\n\n Retrieve request – in the retrievalConfiguration
field
\n RetrieveAndGenerate request – in the retrievalConfiguration
field
Details about a result from querying the knowledge base.
" + "smithy.api#documentation": "Details about a result from querying the knowledge base.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the retrievalResults
field
Contains configurations for how to retrieve and return the knowledge base query.
" } + }, + "generationConfiguration": { + "target": "com.amazonaws.bedrockagentruntime#GenerationConfiguration", + "traits": { + "smithy.api#documentation": "Contains configurations for response generation based on the knowwledge base query results.
" + } } }, "traits": { - "smithy.api#documentation": "Contains details about the resource being queried.
" + "smithy.api#documentation": "Contains details about the resource being queried.
\nThis data type is used in the following API operations:
\n\n Retrieve request – in the knowledgeBaseConfiguration
field
\n RetrieveAndGenerate request – in the knowledgeBaseConfiguration
field
The number of results to return.
\nThe numberOfResults
field is currently unsupported for RetrieveAndGenerate
. Don't include it in this field if you are sending a RetrieveAndGenerate
request.
The number of source chunks to retrieve.
", "smithy.api#range": { "min": 1, - "max": 25 + "max": 100 } } }, @@ -1422,7 +1442,7 @@ } }, "traits": { - "smithy.api#documentation": "Configurations for how to carry out the search.
" + "smithy.api#documentation": "Configurations for how to perform the search query and return results. For more information, see Query configurations.
\nThis data type is used in the following API operations:
\n\n Retrieve request – in the vectorSearchConfiguration
field
\n RetrieveAndGenerate request – in the vectorSearchConfiguration
field
The template for the prompt that's sent to the model for response generation. You can include prompt placeholders, which become replaced before the prompt is sent to the model to provide instructions and context to the model. In addition, you can include XML tags to delineate meaningful sections of the prompt template.
\nFor more information, see the following resources:
\nContains the template for the prompt that's sent to the model for response generation. For more information, see Knowledge base prompt templates.
\nThis data type is used in the following API operations:
\nContains the cited text from the data source.
", + "smithy.api#documentation": "Contains the cited text from the data source.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the content
field
\n RetrieveAndGenerate response – in the content
field
\n Retrieve response – in the content
field
Contains information about the location of the data source.
", + "smithy.api#documentation": "Contains information about the location of the data source.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the location
field
\n RetrieveAndGenerate response – in the location
field
\n Retrieve response – in the locatino
field
Contains the S3 location of the data source.
" + "smithy.api#documentation": "Contains the S3 location of the data source.
\nThis data type is used in the following API operations:
\n\n Retrieve response – in the s3Location
field
\n RetrieveAndGenerate response – in the s3Location
field
\n Retrieve response – in the s3Location
field
Queries a knowledge base and generates responses based on the retrieved results. The response cites up to five sources but only selects the ones that are relevant to the query.
\nThe numberOfResults
field is currently unsupported for RetrieveAndGenerate
. Don't include it in the vectorSearchConfiguration object.
Queries a knowledge base and generates responses based on the retrieved results. The response cites up to five sources but only selects the ones that are relevant to the query.
", "smithy.api#http": { "code": 200, "method": "POST", @@ -2146,7 +2180,7 @@ } }, "traits": { - "smithy.api#documentation": "Contains details about the resource being queried.
" + "smithy.api#documentation": "Contains details about the resource being queried.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate request – in the retrieveAndGenerateConfiguration
field
Contains the query made to the knowledge base.
", + "smithy.api#documentation": "Contains the query made to the knowledge base.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate request – in the input
field
Contains the response generated from querying the knowledge base.
", + "smithy.api#documentation": "Contains the response generated from querying the knowledge base.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate response – in the output
field
Contains the query made to the knowledge base.
", + "smithy.api#documentation": "Contains the query to be made to the knowledge base.
", "smithy.api#required": {} } }, "retrieveAndGenerateConfiguration": { "target": "com.amazonaws.bedrockagentruntime#RetrieveAndGenerateConfiguration", "traits": { - "smithy.api#documentation": "Contains details about the resource being queried and the foundation model used for generation.
" + "smithy.api#documentation": "Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
" } }, "sessionConfiguration": { @@ -2265,7 +2299,7 @@ } }, "traits": { - "smithy.api#documentation": "Contains configuration about the session with the knowledge base.
" + "smithy.api#documentation": "Contains configuration about the session with the knowledge base.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate request – in the sessionConfiguration
field
The query to send the knowledge base.
", + "smithy.api#documentation": "Contains the query to send the knowledge base.
", "smithy.api#required": {} } }, "retrievalConfiguration": { "target": "com.amazonaws.bedrockagentruntime#KnowledgeBaseRetrievalConfiguration", "traits": { - "smithy.api#documentation": "Contains details about how the results should be returned.
" + "smithy.api#documentation": "Contains configurations for the knowledge base query and retrieval process. For more information, see Query configurations.
" } }, "nextToken": { @@ -2360,7 +2394,7 @@ } }, "traits": { - "smithy.api#documentation": "Contains metadata about a sources cited for the generated response.
" + "smithy.api#documentation": "Contains metadata about a source cited for the generated response.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate response – in the retrievedReferences
field
\n Retrieve response – in the retrievedReferences
field
Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Session context.
" + "smithy.api#documentation": "Contains parameters that specify various attributes that persist across a session or prompt. You can define session state attributes as key-value pairs when writing a Lambda function for an action group or pass them when making an InvokeAgent request. Use session state attributes to control and provide conversational context for your agent and to help customize your agent's behavior. For more information, see Control session context.
" } }, "com.amazonaws.bedrockagentruntime#Source": { @@ -2487,7 +2521,7 @@ } }, "traits": { - "smithy.api#documentation": "Contains information about where the text with a citation begins and ends in the generated output.
" + "smithy.api#documentation": "Contains information about where the text with a citation begins and ends in the generated output.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate response – in the span
field
\n Retrieve response – in the span
field
Contains the part of the generated text that contains a citation, alongside where it begins and ends.
", + "smithy.api#documentation": "Contains the part of the generated text that contains a citation, alongside where it begins and ends.
\nThis data type is used in the following API operations:
\n\n RetrieveAndGenerate response – in the textResponsePart
field
\n Retrieve response – in the textResponsePart
field