Skip to content

Commit fd81120

Browse files
Add support for S3 Vectors as a vector store.
1 parent a940629 commit fd81120

File tree

11 files changed

+417
-2
lines changed

11 files changed

+417
-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,77 @@
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+
using ThirdParty.Json.LitJson;
32+
33+
#pragma warning disable CS0612,CS0618
34+
namespace Amazon.BedrockAgent.Model.Internal.MarshallTransformations
35+
{
36+
/// <summary>
37+
/// S3VectorsConfiguration Marshaller
38+
/// </summary>
39+
public class S3VectorsConfigurationMarshaller : IRequestMarshaller<S3VectorsConfiguration, JsonMarshallerContext>
40+
{
41+
/// <summary>
42+
/// Unmarshaller the response from the service to the response class.
43+
/// </summary>
44+
/// <param name="requestObject"></param>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
public void Marshall(S3VectorsConfiguration requestObject, JsonMarshallerContext context)
48+
{
49+
if(requestObject == null)
50+
return;
51+
if(requestObject.IsSetIndexArn())
52+
{
53+
context.Writer.WritePropertyName("indexArn");
54+
context.Writer.Write(requestObject.IndexArn);
55+
}
56+
57+
if(requestObject.IsSetIndexName())
58+
{
59+
context.Writer.WritePropertyName("indexName");
60+
context.Writer.Write(requestObject.IndexName);
61+
}
62+
63+
if(requestObject.IsSetVectorBucketArn())
64+
{
65+
context.Writer.WritePropertyName("vectorBucketArn");
66+
context.Writer.Write(requestObject.VectorBucketArn);
67+
}
68+
69+
}
70+
71+
/// <summary>
72+
/// Singleton Marshaller.
73+
/// </summary>
74+
public readonly static S3VectorsConfigurationMarshaller Instance = new S3VectorsConfigurationMarshaller();
75+
76+
}
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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 ThirdParty.Json.LitJson;
33+
34+
#pragma warning disable CS0612,CS0618
35+
namespace Amazon.BedrockAgent.Model.Internal.MarshallTransformations
36+
{
37+
/// <summary>
38+
/// Response Unmarshaller for S3VectorsConfiguration Object
39+
/// </summary>
40+
public class S3VectorsConfigurationUnmarshaller : IUnmarshaller<S3VectorsConfiguration, XmlUnmarshallerContext>, IUnmarshaller<S3VectorsConfiguration, JsonUnmarshallerContext>
41+
{
42+
/// <summary>
43+
/// Unmarshaller the response from the service to the response class.
44+
/// </summary>
45+
/// <param name="context"></param>
46+
/// <returns></returns>
47+
S3VectorsConfiguration IUnmarshaller<S3VectorsConfiguration, XmlUnmarshallerContext>.Unmarshall(XmlUnmarshallerContext context)
48+
{
49+
throw new NotImplementedException();
50+
}
51+
52+
/// <summary>
53+
/// Unmarshaller the response from the service to the response class.
54+
/// </summary>
55+
/// <param name="context"></param>
56+
/// <returns>The unmarshalled object</returns>
57+
public S3VectorsConfiguration Unmarshall(JsonUnmarshallerContext context)
58+
{
59+
S3VectorsConfiguration unmarshalledObject = new S3VectorsConfiguration();
60+
if (context.IsEmptyResponse)
61+
return null;
62+
context.Read();
63+
if (context.CurrentTokenType == JsonToken.Null)
64+
return null;
65+
66+
int targetDepth = context.CurrentDepth;
67+
while (context.ReadAtDepth(targetDepth))
68+
{
69+
if (context.TestExpression("indexArn", targetDepth))
70+
{
71+
var unmarshaller = StringUnmarshaller.Instance;
72+
unmarshalledObject.IndexArn = unmarshaller.Unmarshall(context);
73+
continue;
74+
}
75+
if (context.TestExpression("indexName", targetDepth))
76+
{
77+
var unmarshaller = StringUnmarshaller.Instance;
78+
unmarshalledObject.IndexName = unmarshaller.Unmarshall(context);
79+
continue;
80+
}
81+
if (context.TestExpression("vectorBucketArn", targetDepth))
82+
{
83+
var unmarshaller = StringUnmarshaller.Instance;
84+
unmarshalledObject.VectorBucketArn = unmarshaller.Unmarshall(context);
85+
continue;
86+
}
87+
}
88+
return unmarshalledObject;
89+
}
90+
91+
92+
private static S3VectorsConfigurationUnmarshaller _instance = new S3VectorsConfigurationUnmarshaller();
93+
94+
/// <summary>
95+
/// Gets the singleton.
96+
/// </summary>
97+
public static S3VectorsConfigurationUnmarshaller Instance
98+
{
99+
get
100+
{
101+
return _instance;
102+
}
103+
}
104+
}
105+
}

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

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

128+
if(requestObject.IsSetS3VectorsConfiguration())
129+
{
130+
context.Writer.WritePropertyName("s3VectorsConfiguration");
131+
context.Writer.WriteObjectStart();
132+
133+
var marshaller = S3VectorsConfigurationMarshaller.Instance;
134+
marshaller.Marshall(requestObject.S3VectorsConfiguration, context);
135+
136+
context.Writer.WriteObjectEnd();
137+
}
138+
128139
if(requestObject.IsSetType())
129140
{
130141
context.Writer.WritePropertyName("type");

0 commit comments

Comments
 (0)