Skip to content

Commit

Permalink
Amazon Bedrock Knowledge Bases now supports using inference profiles …
Browse files Browse the repository at this point in the history
…to increase throughput and improve resilience.
  • Loading branch information
aws-sdk-dotnet-automation committed Sep 11, 2024
1 parent d17ac14 commit 3383313
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@
},
"BedrockModelArn":{
"type":"string",
"max":1011,
"min":20,
"pattern":"^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$"
"max":2048,
"min":1,
"pattern":"^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))))|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$"
},
"Boolean":{
"type":"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"InvokeAgent": "<note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeAgent</code>.</p> </note> <p>Sends a prompt for the agent to process and respond to. Note the following fields for the request:</p> <ul> <li> <p>To continue the same conversation with an agent, use the same <code>sessionId</code> value in the request.</p> </li> <li> <p>To activate trace enablement, turn <code>enableTrace</code> to <code>true</code>. Trace enablement helps you follow the agent's reasoning process that led it to the information it processed, the actions it took, and the final result it yielded. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/agents-test.html#trace-events\">Trace enablement</a>.</p> </li> <li> <p>End a conversation by setting <code>endSession</code> to <code>true</code>.</p> </li> <li> <p>In the <code>sessionState</code> object, you can include attributes for the session or prompt or, if you configured an action group to return control, results from invocation of the action group.</p> </li> </ul> <p>The response is returned in the <code>bytes</code> field of the <code>chunk</code> object.</p> <ul> <li> <p>The <code>attribution</code> object contains citations for parts of the response.</p> </li> <li> <p>If you set <code>enableTrace</code> to <code>true</code> in the request, you can trace the agent's steps and reasoning process that led it to the response.</p> </li> <li> <p>If the action predicted was configured to return control, the response returns parameters for the action, elicited from the user, in the <code>returnControl</code> field.</p> </li> <li> <p>Errors are also surfaced in the response.</p> </li> </ul>",
"InvokeFlow": "<p>Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/flows-test.html\">Test a flow in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p> <note> <p>The CLI doesn't support streaming operations in Amazon Bedrock, including <code>InvokeFlow</code>.</p> </note>",
"Retrieve": "<p>Queries a knowledge base and retrieves information from it.</p>",
"RetrieveAndGenerate": "<p>Queries a knowledge base and generates responses based on the retrieved results. The response only cites sources that are relevant to the query.</p>"
"RetrieveAndGenerate": "<p>Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html\">inference profile</a>. The response only cites sources that are relevant to the query.</p>"
},
"shapes": {
"AccessDeniedException": {
Expand Down Expand Up @@ -152,7 +152,7 @@
"base": null,
"refs": {
"ExternalSourcesRetrieveAndGenerateConfiguration$modelArn": "<p>The modelArn used with the external source wrapper object in the retrieveAndGenerate function.</p>",
"KnowledgeBaseRetrieveAndGenerateConfiguration$modelArn": "<p>The ARN of the foundation model used to generate a response.</p>"
"KnowledgeBaseRetrieveAndGenerateConfiguration$modelArn": "<p>The ARN of the foundation model or <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html\">inference profile</a> used to generate a response.</p>"
}
},
"Boolean": {
Expand Down Expand Up @@ -847,7 +847,7 @@
"base": null,
"refs": {
"KnowledgeBaseConfiguration$knowledgeBaseId": "<p>The unique identifier for a knowledge base attached to the agent.</p>",
"KnowledgeBaseRetrieveAndGenerateConfiguration$knowledgeBaseId": "<p>The unique identifier of the knowledge base that is queried and the foundation model used for generation.</p>",
"KnowledgeBaseRetrieveAndGenerateConfiguration$knowledgeBaseId": "<p>The unique identifier of the knowledge base that is queried.</p>",
"RetrieveRequest$knowledgeBaseId": "<p>The unique identifier of the knowledge base to query.</p>"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
{"shape":"AccessDeniedException"},
{"shape":"ServiceQuotaExceededException"}
],
"documentation":"<p>Queries a knowledge base and generates responses based on the retrieved results. The response only cites sources that are relevant to the query.</p>"
"documentation":"<p>Queries a knowledge base and generates responses based on the retrieved results and using the specified foundation model or <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html\">inference profile</a>. The response only cites sources that are relevant to the query.</p>"
}
},
"shapes":{
Expand Down Expand Up @@ -392,9 +392,9 @@
},
"BedrockModelArn":{
"type":"string",
"max":1011,
"min":20,
"pattern":"^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$"
"max":2048,
"min":1,
"pattern":"^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))))|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$"
},
"Boolean":{
"type":"boolean",
Expand Down Expand Up @@ -1917,11 +1917,11 @@
},
"knowledgeBaseId":{
"shape":"KnowledgeBaseId",
"documentation":"<p>The unique identifier of the knowledge base that is queried and the foundation model used for generation.</p>"
"documentation":"<p>The unique identifier of the knowledge base that is queried.</p>"
},
"modelArn":{
"shape":"BedrockModelArn",
"documentation":"<p>The ARN of the foundation model used to generate a response.</p>"
"documentation":"<p>The ARN of the foundation model or <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html\">inference profile</a> used to generate a response.</p>"
},
"orchestrationConfiguration":{
"shape":"OrchestrationConfiguration",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@
</property-value-rule>
<property-value-rule>
<property>Amazon.BedrockAgentRuntime.Model.ExternalSourcesRetrieveAndGenerateConfiguration.ModelArn</property>
<min>20</min>
<max>1011</max>
<pattern>^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$</pattern>
<min>1</min>
<max>2048</max>
<pattern>^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))))|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.BedrockAgentRuntime.Model.FailureTrace.TraceId</property>
Expand Down Expand Up @@ -252,9 +252,9 @@
</property-value-rule>
<property-value-rule>
<property>Amazon.BedrockAgentRuntime.Model.KnowledgeBaseRetrieveAndGenerateConfiguration.ModelArn</property>
<min>20</min>
<max>1011</max>
<pattern>^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}))$</pattern>
<min>1</min>
<max>2048</max>
<pattern>^(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))))|(arn:aws(|-us-gov|-cn|-iso|-iso-b):bedrock:(|[0-9a-z-]{1,20}):(|[0-9]{12}):inference-profile/[a-zA-Z0-9-:.]+)|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)$</pattern>
</property-value-rule>
<property-value-rule>
<property>Amazon.BedrockAgentRuntime.Model.KnowledgeBaseVectorSearchConfiguration.NumberOfResults</property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ internal bool IsSetGenerationConfiguration()
/// function.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=20, Max=1011)]
[AWSProperty(Required=true, Min=1, Max=2048)]
public string ModelArn
{
get { return this._modelArn; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ internal bool IsSetGenerationConfiguration()
/// <summary>
/// Gets and sets the property KnowledgeBaseId.
/// <para>
/// The unique identifier of the knowledge base that is queried and the foundation model
/// used for generation.
/// The unique identifier of the knowledge base that is queried.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=0, Max=10)]
Expand All @@ -98,10 +97,11 @@ internal bool IsSetKnowledgeBaseId()
/// <summary>
/// Gets and sets the property ModelArn.
/// <para>
/// The ARN of the foundation model used to generate a response.
/// The ARN of the foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a> used to generate a response.
/// </para>
/// </summary>
[AWSProperty(Required=true, Min=20, Max=1011)]
[AWSProperty(Required=true, Min=1, Max=2048)]
public string ModelArn
{
get { return this._modelArn; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ namespace Amazon.BedrockAgentRuntime.Model
{
/// <summary>
/// Container for the parameters to the RetrieveAndGenerate operation.
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
public partial class RetrieveAndGenerateRequest : AmazonBedrockAgentRuntimeRequest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,8 +755,9 @@ public virtual RetrieveResponse EndRetrieve(IAsyncResult asyncResult)
#region RetrieveAndGenerate

/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,9 @@ public virtual RetrieveResponse Retrieve(RetrieveRequest request)


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
///
Expand Down Expand Up @@ -958,8 +959,9 @@ public virtual RetrieveAndGenerateResponse RetrieveAndGenerate(RetrieveAndGenera


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
/// <param name="cancellationToken">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,9 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
///
Expand Down Expand Up @@ -666,8 +667,9 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
/// <param name="cancellationToken">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,9 @@ internal virtual RetrieveAndGenerateResponse RetrieveAndGenerate(RetrieveAndGene


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
/// <param name="cancellationToken">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ public partial interface IAmazonBedrockAgentRuntime : IAmazonService, IDisposabl


/// <summary>
/// Queries a knowledge base and generates responses based on the retrieved results. The
/// response only cites sources that are relevant to the query.
/// Queries a knowledge base and generates responses based on the retrieved results and
/// using the specified foundation model or <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference.html">inference
/// profile</a>. The response only cites sources that are relevant to the query.
/// </summary>
/// <param name="request">Container for the necessary parameters to execute the RetrieveAndGenerate service method.</param>
/// <param name="cancellationToken">
Expand Down

0 comments on commit 3383313

Please sign in to comment.