Skip to content

Commit 5baf4a5

Browse files
You can now reference images and documents stored in Amazon S3 when using InvokeModel and Converse APIs with Amazon Nova Lite and Nova Pro. This enables direct integration of S3-stored multimedia assets in your model requests without manual downloading or base64 encoding.
1 parent 3f98e8c commit 5baf4a5

File tree

11 files changed

+98
-8
lines changed

11 files changed

+98
-8
lines changed

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.api.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,8 @@
659659
"DocumentSource":{
660660
"type":"structure",
661661
"members":{
662-
"bytes":{"shape":"DocumentSourceBytesBlob"}
662+
"bytes":{"shape":"DocumentSourceBytesBlob"},
663+
"s3Location":{"shape":"S3Location"}
663664
},
664665
"union":true
665666
},
@@ -1335,7 +1336,8 @@
13351336
"ImageSource":{
13361337
"type":"structure",
13371338
"members":{
1338-
"bytes":{"shape":"ImageSourceBytesBlob"}
1339+
"bytes":{"shape":"ImageSourceBytesBlob"},
1340+
"s3Location":{"shape":"S3Location"}
13391341
},
13401342
"union":true
13411343
},

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.docs.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,9 +1248,11 @@
12481248
}
12491249
},
12501250
"S3Location": {
1251-
"base": "<p>A storage location in an S3 bucket.</p>",
1251+
"base": "<p>A storage location in an Amazon S3 bucket.</p>",
12521252
"refs": {
1253-
"VideoSource$s3Location": "<p>The location of a video object in an S3 bucket.</p>"
1253+
"DocumentSource$s3Location": "<p>The location of a document object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>",
1254+
"ImageSource$s3Location": "<p>The location of an image object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>",
1255+
"VideoSource$s3Location": "<p>The location of a video object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>"
12541256
}
12551257
},
12561258
"S3Uri": {

generator/ServiceModels/bedrock-runtime/bedrock-runtime-2023-09-30.normal.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,10 @@
987987
"bytes":{
988988
"shape":"DocumentSourceBytesBlob",
989989
"documentation":"<p>The raw bytes for the document. If you use an Amazon Web Services SDK, you don't need to encode the bytes in base64.</p>"
990+
},
991+
"s3Location":{
992+
"shape":"S3Location",
993+
"documentation":"<p>The location of a document object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>"
990994
}
991995
},
992996
"documentation":"<p>Contains the content of a document.</p>",
@@ -1987,6 +1991,10 @@
19871991
"bytes":{
19881992
"shape":"ImageSourceBytesBlob",
19891993
"documentation":"<p>The raw image bytes for the image. If you use an AWS SDK, you don't need to encode the image bytes in base64.</p>"
1994+
},
1995+
"s3Location":{
1996+
"shape":"S3Location",
1997+
"documentation":"<p>The location of an image object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>"
19901998
}
19911999
},
19922000
"documentation":"<p>The source for an image.</p>",
@@ -2726,7 +2734,7 @@
27262734
"documentation":"<p>If the bucket belongs to another AWS account, specify that account's ID.</p>"
27272735
}
27282736
},
2729-
"documentation":"<p>A storage location in an S3 bucket.</p>"
2737+
"documentation":"<p>A storage location in an Amazon S3 bucket.</p>"
27302738
},
27312739
"S3Uri":{
27322740
"type":"string",
@@ -3248,7 +3256,7 @@
32483256
},
32493257
"s3Location":{
32503258
"shape":"S3Location",
3251-
"documentation":"<p>The location of a video object in an S3 bucket.</p>"
3259+
"documentation":"<p>The location of a video object in an Amazon S3 bucket. To see which models support S3 uploads, see <a href=\"https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html\">Supported models and features for Converse</a>.</p>"
32523260
}
32533261
},
32543262
"documentation":"<p>A video source. You can upload a smaller video as a base64-encoded string as long as the encoded file is less than 25MB. You can also transfer videos up to 1GB in size from an S3 bucket.</p>",

sdk/src/Services/BedrockRuntime/Generated/Model/DocumentSource.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace Amazon.BedrockRuntime.Model
3535
public partial class DocumentSource
3636
{
3737
private MemoryStream _bytes;
38+
private S3Location _s3Location;
3839

3940
/// <summary>
4041
/// Gets and sets the property Bytes.
@@ -56,5 +57,25 @@ internal bool IsSetBytes()
5657
return this._bytes != null;
5758
}
5859

60+
/// <summary>
61+
/// Gets and sets the property S3Location.
62+
/// <para>
63+
/// The location of a document object in an Amazon S3 bucket. To see which models support
64+
/// S3 uploads, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html">Supported
65+
/// models and features for Converse</a>.
66+
/// </para>
67+
/// </summary>
68+
public S3Location S3Location
69+
{
70+
get { return this._s3Location; }
71+
set { this._s3Location = value; }
72+
}
73+
74+
// Check to see if S3Location property is set
75+
internal bool IsSetS3Location()
76+
{
77+
return this._s3Location != null;
78+
}
79+
5980
}
6081
}

sdk/src/Services/BedrockRuntime/Generated/Model/ImageSource.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace Amazon.BedrockRuntime.Model
3535
public partial class ImageSource
3636
{
3737
private MemoryStream _bytes;
38+
private S3Location _s3Location;
3839

3940
/// <summary>
4041
/// Gets and sets the property Bytes.
@@ -56,5 +57,25 @@ internal bool IsSetBytes()
5657
return this._bytes != null;
5758
}
5859

60+
/// <summary>
61+
/// Gets and sets the property S3Location.
62+
/// <para>
63+
/// The location of an image object in an Amazon S3 bucket. To see which models support
64+
/// S3 uploads, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference-supported-models-features.html">Supported
65+
/// models and features for Converse</a>.
66+
/// </para>
67+
/// </summary>
68+
public S3Location S3Location
69+
{
70+
get { return this._s3Location; }
71+
set { this._s3Location = value; }
72+
}
73+
74+
// Check to see if S3Location property is set
75+
internal bool IsSetS3Location()
76+
{
77+
return this._s3Location != null;
78+
}
79+
5980
}
6081
}

sdk/src/Services/BedrockRuntime/Generated/Model/Internal/MarshallTransformations/DocumentSourceMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ public void Marshall(DocumentSource requestObject, JsonMarshallerContext context
5454
context.Writer.Write(StringUtils.FromMemoryStream(requestObject.Bytes));
5555
}
5656

57+
if(requestObject.IsSetS3Location())
58+
{
59+
context.Writer.WritePropertyName("s3Location");
60+
context.Writer.WriteObjectStart();
61+
62+
var marshaller = S3LocationMarshaller.Instance;
63+
marshaller.Marshall(requestObject.S3Location, context);
64+
65+
context.Writer.WriteObjectEnd();
66+
}
67+
5768
}
5869

5970
/// <summary>

sdk/src/Services/BedrockRuntime/Generated/Model/Internal/MarshallTransformations/DocumentSourceUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ public DocumentSource Unmarshall(JsonUnmarshallerContext context)
7272
unmarshalledObject.Bytes = unmarshaller.Unmarshall(context);
7373
continue;
7474
}
75+
if (context.TestExpression("s3Location", targetDepth))
76+
{
77+
var unmarshaller = S3LocationUnmarshaller.Instance;
78+
unmarshalledObject.S3Location = unmarshaller.Unmarshall(context);
79+
continue;
80+
}
7581
}
7682
return unmarshalledObject;
7783
}

sdk/src/Services/BedrockRuntime/Generated/Model/Internal/MarshallTransformations/ImageSourceMarshaller.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ public void Marshall(ImageSource requestObject, JsonMarshallerContext context)
5454
context.Writer.Write(StringUtils.FromMemoryStream(requestObject.Bytes));
5555
}
5656

57+
if(requestObject.IsSetS3Location())
58+
{
59+
context.Writer.WritePropertyName("s3Location");
60+
context.Writer.WriteObjectStart();
61+
62+
var marshaller = S3LocationMarshaller.Instance;
63+
marshaller.Marshall(requestObject.S3Location, context);
64+
65+
context.Writer.WriteObjectEnd();
66+
}
67+
5768
}
5869

5970
/// <summary>

sdk/src/Services/BedrockRuntime/Generated/Model/Internal/MarshallTransformations/ImageSourceUnmarshaller.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ public ImageSource Unmarshall(JsonUnmarshallerContext context)
7272
unmarshalledObject.Bytes = unmarshaller.Unmarshall(context);
7373
continue;
7474
}
75+
if (context.TestExpression("s3Location", targetDepth))
76+
{
77+
var unmarshaller = S3LocationUnmarshaller.Instance;
78+
unmarshalledObject.S3Location = unmarshaller.Unmarshall(context);
79+
continue;
80+
}
7581
}
7682
return unmarshalledObject;
7783
}

sdk/src/Services/BedrockRuntime/Generated/Model/S3Location.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
namespace Amazon.BedrockRuntime.Model
3131
{
3232
/// <summary>
33-
/// A storage location in an S3 bucket.
33+
/// A storage location in an Amazon S3 bucket.
3434
/// </summary>
3535
public partial class S3Location
3636
{

0 commit comments

Comments
 (0)