Skip to content

Commit 598f288

Browse files
Add support for S3 Vectors as a vector store.
1 parent ff9455a commit 598f288

File tree

11 files changed

+405
-2
lines changed

11 files changed

+405
-2
lines changed

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.api.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4390,6 +4390,16 @@
43904390
"Collector"
43914391
]
43924392
},
4393+
"IndexArn":{
4394+
"type":"string",
4395+
"sensitive":true
4396+
},
4397+
"IndexName":{
4398+
"type":"string",
4399+
"max":63,
4400+
"min":3,
4401+
"sensitive":true
4402+
},
43934403
"InferenceConfiguration":{
43944404
"type":"structure",
43954405
"members":{
@@ -4816,7 +4826,8 @@
48164826
"RDS",
48174827
"MONGO_DB_ATLAS",
48184828
"NEPTUNE_ANALYTICS",
4819-
"OPENSEARCH_MANAGED_CLUSTER"
4829+
"OPENSEARCH_MANAGED_CLUSTER",
4830+
"S3_VECTORS"
48204831
]
48214832
},
48224833
"KnowledgeBaseSummaries":{
@@ -6636,6 +6647,14 @@
66366647
"max":1,
66376648
"min":1
66386649
},
6650+
"S3VectorsConfiguration":{
6651+
"type":"structure",
6652+
"members":{
6653+
"indexArn":{"shape":"IndexArn"},
6654+
"indexName":{"shape":"IndexName"},
6655+
"vectorBucketArn":{"shape":"VectorBucketArn"}
6656+
}
6657+
},
66396658
"SalesforceAuthType":{
66406659
"type":"string",
66416660
"enum":["OAUTH2_CLIENT_CREDENTIALS"]
@@ -6907,6 +6926,7 @@
69076926
"pineconeConfiguration":{"shape":"PineconeConfiguration"},
69086927
"rdsConfiguration":{"shape":"RdsConfiguration"},
69096928
"redisEnterpriseCloudConfiguration":{"shape":"RedisEnterpriseCloudConfiguration"},
6929+
"s3VectorsConfiguration":{"shape":"S3VectorsConfiguration"},
69106930
"type":{"shape":"KnowledgeBaseStorageType"}
69116931
}
69126932
},
@@ -7737,6 +7757,10 @@
77377757
"type":"list",
77387758
"member":{"shape":"ValidationExceptionField"}
77397759
},
7760+
"VectorBucketArn":{
7761+
"type":"string",
7762+
"sensitive":true
7763+
},
77407764
"VectorIngestionConfiguration":{
77417765
"type":"structure",
77427766
"members":{

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.docs.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,6 +2201,18 @@
22012201
"LoopIncompatibleNodeTypeFlowValidationDetails$incompatibleNodeType": "<p>The node type of the incompatible node in the DoWhile loop. Some node types, like a condition node, aren't allowed in a DoWhile loop.</p>"
22022202
}
22032203
},
2204+
"IndexArn": {
2205+
"base": null,
2206+
"refs": {
2207+
"S3VectorsConfiguration$indexArn": "<p>The Amazon Resource Name (ARN) of the vector index used for the knowledge base. This ARN identifies the specific vector index resource within Amazon Bedrock.</p>"
2208+
}
2209+
},
2210+
"IndexName": {
2211+
"base": null,
2212+
"refs": {
2213+
"S3VectorsConfiguration$indexName": "<p>The name of the vector index used for the knowledge base. This name identifies the vector index within the Amazon Bedrock service.</p>"
2214+
}
2215+
},
22042216
"InferenceConfiguration": {
22052217
"base": "<p>Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the <code>promptType</code>. For more information, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html\">Inference parameters for foundation models</a>.</p>",
22062218
"refs": {
@@ -3952,6 +3964,12 @@
39523964
"S3DataSourceConfiguration$inclusionPrefixes": "<p>A list of S3 prefixes to include certain files or content. For more information, see <a href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html\">Organizing objects using prefixes</a>.</p>"
39533965
}
39543966
},
3967+
"S3VectorsConfiguration": {
3968+
"base": "<p>Contains the storage configuration of the knowledge base for S3 vectors.</p>",
3969+
"refs": {
3970+
"StorageConfiguration$s3VectorsConfiguration": "<p>The configuration settings for storing knowledge base data using S3 vectors. This includes vector index information and S3 bucket details for vector storage.</p>"
3971+
}
3972+
},
39553973
"SalesforceAuthType": {
39563974
"base": null,
39573975
"refs": {
@@ -4638,6 +4656,12 @@
46384656
"ValidationException$fieldList": "<p>A list of objects containing fields that caused validation errors and their corresponding validation error messages.</p>"
46394657
}
46404658
},
4659+
"VectorBucketArn": {
4660+
"base": null,
4661+
"refs": {
4662+
"S3VectorsConfiguration$vectorBucketArn": "<p>The Amazon Resource Name (ARN) of the S3 bucket where vector embeddings are stored. This bucket contains the vector data used by the knowledge base.</p>"
4663+
}
4664+
},
46414665
"VectorIngestionConfiguration": {
46424666
"base": "<p>Contains details about how to ingest the documents in a data source.</p>",
46434667
"refs": {

generator/ServiceModels/bedrock-agent/bedrock-agent-2023-06-05.normal.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6233,6 +6233,16 @@
62336233
"Collector"
62346234
]
62356235
},
6236+
"IndexArn":{
6237+
"type":"string",
6238+
"sensitive":true
6239+
},
6240+
"IndexName":{
6241+
"type":"string",
6242+
"max":63,
6243+
"min":3,
6244+
"sensitive":true
6245+
},
62366246
"InferenceConfiguration":{
62376247
"type":"structure",
62386248
"members":{
@@ -6929,7 +6939,8 @@
69296939
"RDS",
69306940
"MONGO_DB_ATLAS",
69316941
"NEPTUNE_ANALYTICS",
6932-
"OPENSEARCH_MANAGED_CLUSTER"
6942+
"OPENSEARCH_MANAGED_CLUSTER",
6943+
"S3_VECTORS"
69336944
]
69346945
},
69356946
"KnowledgeBaseSummaries":{
@@ -9656,6 +9667,24 @@
96569667
"max":1,
96579668
"min":1
96589669
},
9670+
"S3VectorsConfiguration":{
9671+
"type":"structure",
9672+
"members":{
9673+
"indexArn":{
9674+
"shape":"IndexArn",
9675+
"documentation":"<p>The Amazon Resource Name (ARN) of the vector index used for the knowledge base. This ARN identifies the specific vector index resource within Amazon Bedrock.</p>"
9676+
},
9677+
"indexName":{
9678+
"shape":"IndexName",
9679+
"documentation":"<p>The name of the vector index used for the knowledge base. This name identifies the vector index within the Amazon Bedrock service.</p>"
9680+
},
9681+
"vectorBucketArn":{
9682+
"shape":"VectorBucketArn",
9683+
"documentation":"<p>The Amazon Resource Name (ARN) of the S3 bucket where vector embeddings are stored. This bucket contains the vector data used by the knowledge base.</p>"
9684+
}
9685+
},
9686+
"documentation":"<p>Contains the storage configuration of the knowledge base for S3 vectors.</p>"
9687+
},
96599688
"SalesforceAuthType":{
96609689
"type":"string",
96619690
"enum":["OAUTH2_CLIENT_CREDENTIALS"]
@@ -10048,6 +10077,10 @@
1004810077
"shape":"RedisEnterpriseCloudConfiguration",
1004910078
"documentation":"<p>Contains the storage configuration of the knowledge base in Redis Enterprise Cloud.</p>"
1005010079
},
10080+
"s3VectorsConfiguration":{
10081+
"shape":"S3VectorsConfiguration",
10082+
"documentation":"<p>The configuration settings for storing knowledge base data using S3 vectors. This includes vector index information and S3 bucket details for vector storage.</p>"
10083+
},
1005110084
"type":{
1005210085
"shape":"KnowledgeBaseStorageType",
1005310086
"documentation":"<p>The vector store service in which the knowledge base is stored.</p>"
@@ -11355,6 +11388,10 @@
1135511388
"type":"list",
1135611389
"member":{"shape":"ValidationExceptionField"}
1135711390
},
11391+
"VectorBucketArn":{
11392+
"type":"string",
11393+
"sensitive":true
11394+
},
1135811395
"VectorIngestionConfiguration":{
1135911396
"type":"structure",
1136011397
"members":{

sdk/code-analysis/ServiceAnalysis/BedrockAgent/Generated/PropertyValueRules.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2915,6 +2915,11 @@
29152915
<max>2048</max>
29162916
<pattern>^s3://.{1,128}$</pattern>
29172917
</property-value-rule>
2918+
<property-value-rule>
2919+
<property>Amazon.BedrockAgent.Model.S3VectorsConfiguration.IndexName</property>
2920+
<min>3</min>
2921+
<max>63</max>
2922+
</property-value-rule>
29182923
<property-value-rule>
29192924
<property>Amazon.BedrockAgent.Model.SalesforceSourceConfiguration.CredentialsSecretArn</property>
29202925
<pattern>^arn:aws(|-cn|-us-gov):secretsmanager:[a-z0-9-]{1,20}:([0-9]{12}|):secret:[a-zA-Z0-9!/_+=.@-]{1,512}$</pattern>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-agent-2023-06-05.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Text;
24+
using System.Xml.Serialization;
25+
26+
using Amazon.BedrockAgent.Model;
27+
using Amazon.Runtime;
28+
using Amazon.Runtime.Internal;
29+
using Amazon.Runtime.Internal.Transform;
30+
using Amazon.Runtime.Internal.Util;
31+
#pragma warning disable CS0612,CS0618
32+
namespace Amazon.BedrockAgent.Model.Internal.MarshallTransformations
33+
{
34+
/// <summary>
35+
/// S3VectorsConfiguration Marshaller
36+
/// </summary>
37+
public class S3VectorsConfigurationMarshaller : IRequestMarshaller<S3VectorsConfiguration, JsonMarshallerContext>
38+
{
39+
/// <summary>
40+
/// Unmarshaller the response from the service to the response class.
41+
/// </summary>
42+
/// <param name="requestObject"></param>
43+
/// <param name="context"></param>
44+
/// <returns></returns>
45+
public void Marshall(S3VectorsConfiguration requestObject, JsonMarshallerContext context)
46+
{
47+
if(requestObject == null)
48+
return;
49+
if(requestObject.IsSetIndexArn())
50+
{
51+
context.Writer.WritePropertyName("indexArn");
52+
context.Writer.WriteStringValue(requestObject.IndexArn);
53+
}
54+
55+
if(requestObject.IsSetIndexName())
56+
{
57+
context.Writer.WritePropertyName("indexName");
58+
context.Writer.WriteStringValue(requestObject.IndexName);
59+
}
60+
61+
if(requestObject.IsSetVectorBucketArn())
62+
{
63+
context.Writer.WritePropertyName("vectorBucketArn");
64+
context.Writer.WriteStringValue(requestObject.VectorBucketArn);
65+
}
66+
67+
}
68+
69+
/// <summary>
70+
/// Singleton Marshaller.
71+
/// </summary>
72+
public readonly static S3VectorsConfigurationMarshaller Instance = new S3VectorsConfigurationMarshaller();
73+
74+
}
75+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/*
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License").
5+
* You may not use this file except in compliance with the License.
6+
* A copy of the License is located at
7+
*
8+
* http://aws.amazon.com/apache2.0
9+
*
10+
* or in the "license" file accompanying this file. This file is distributed
11+
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12+
* express or implied. See the License for the specific language governing
13+
* permissions and limitations under the License.
14+
*/
15+
16+
/*
17+
* Do not modify this file. This file is generated from the bedrock-agent-2023-06-05.normal.json service model.
18+
*/
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Globalization;
22+
using System.IO;
23+
using System.Net;
24+
using System.Text;
25+
using System.Xml.Serialization;
26+
27+
using Amazon.BedrockAgent.Model;
28+
using Amazon.Runtime;
29+
using Amazon.Runtime.Internal;
30+
using Amazon.Runtime.Internal.Transform;
31+
using Amazon.Runtime.Internal.Util;
32+
using System.Text.Json;
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.BedrockAgent.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// Response Unmarshaller for S3VectorsConfiguration Object
38+
/// </summary>
39+
public class S3VectorsConfigurationUnmarshaller : IJsonUnmarshaller<S3VectorsConfiguration, JsonUnmarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="context"></param>
45+
/// <param name="reader"></param>
46+
/// <returns>The unmarshalled object</returns>
47+
public S3VectorsConfiguration Unmarshall(JsonUnmarshallerContext context, ref StreamingUtf8JsonReader reader)
48+
{
49+
S3VectorsConfiguration unmarshalledObject = new S3VectorsConfiguration();
50+
if (context.IsEmptyResponse)
51+
return null;
52+
context.Read(ref reader);
53+
if (context.CurrentTokenType == JsonTokenType.Null)
54+
return null;
55+
56+
int targetDepth = context.CurrentDepth;
57+
while (context.ReadAtDepth(targetDepth, ref reader))
58+
{
59+
if (context.TestExpression("indexArn", targetDepth))
60+
{
61+
var unmarshaller = StringUnmarshaller.Instance;
62+
unmarshalledObject.IndexArn = unmarshaller.Unmarshall(context, ref reader);
63+
continue;
64+
}
65+
if (context.TestExpression("indexName", targetDepth))
66+
{
67+
var unmarshaller = StringUnmarshaller.Instance;
68+
unmarshalledObject.IndexName = unmarshaller.Unmarshall(context, ref reader);
69+
continue;
70+
}
71+
if (context.TestExpression("vectorBucketArn", targetDepth))
72+
{
73+
var unmarshaller = StringUnmarshaller.Instance;
74+
unmarshalledObject.VectorBucketArn = unmarshaller.Unmarshall(context, ref reader);
75+
continue;
76+
}
77+
}
78+
return unmarshalledObject;
79+
}
80+
81+
82+
private static S3VectorsConfigurationUnmarshaller _instance = new S3VectorsConfigurationUnmarshaller();
83+
84+
/// <summary>
85+
/// Gets the singleton.
86+
/// </summary>
87+
public static S3VectorsConfigurationUnmarshaller Instance
88+
{
89+
get
90+
{
91+
return _instance;
92+
}
93+
}
94+
}
95+
}

sdk/src/Services/BedrockAgent/Generated/Model/Internal/MarshallTransformations/StorageConfigurationMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ public void Marshall(StorageConfiguration requestObject, JsonMarshallerContext c
123123
context.Writer.WriteEndObject();
124124
}
125125

126+
if(requestObject.IsSetS3VectorsConfiguration())
127+
{
128+
context.Writer.WritePropertyName("s3VectorsConfiguration");
129+
context.Writer.WriteStartObject();
130+
131+
var marshaller = S3VectorsConfigurationMarshaller.Instance;
132+
marshaller.Marshall(requestObject.S3VectorsConfiguration, context);
133+
134+
context.Writer.WriteEndObject();
135+
}
136+
126137
if(requestObject.IsSetType())
127138
{
128139
context.Writer.WritePropertyName("type");

sdk/src/Services/BedrockAgent/Generated/Model/Internal/MarshallTransformations/StorageConfigurationUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ public StorageConfiguration Unmarshall(JsonUnmarshallerContext context, ref Stre
9898
unmarshalledObject.RedisEnterpriseCloudConfiguration = unmarshaller.Unmarshall(context, ref reader);
9999
continue;
100100
}
101+
if (context.TestExpression("s3VectorsConfiguration", targetDepth))
102+
{
103+
var unmarshaller = S3VectorsConfigurationUnmarshaller.Instance;
104+
unmarshalledObject.S3VectorsConfiguration = unmarshaller.Unmarshall(context, ref reader);
105+
continue;
106+
}
101107
if (context.TestExpression("type", targetDepth))
102108
{
103109
var unmarshaller = StringUnmarshaller.Instance;

0 commit comments

Comments
 (0)