Skip to content

Commit 57af49e

Browse files
committed
Fix for out of date Titan models.
1 parent 6b5cea3 commit 57af49e

12 files changed

Lines changed: 12 additions & 28 deletions

File tree

.doc_gen/metadata/bedrock-runtime_metadata.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,19 +1484,3 @@ bedrock-runtime_Scenario_GenerateVideos_NovaReel:
14841484
services:
14851485
bedrock-runtime: {StartAsyncInvoke, GetAsyncInvoke}
14861486

1487-
bedrock-runtime_InvokeModel_TitanText:
1488-
title: Invoke Amazon Titan Text models on &BR; using the Invoke Model API
1489-
title_abbrev: "InvokeModel"
1490-
synopsis: send a text message to Amazon Titan Text, using the Invoke Model API.
1491-
category: Amazon Titan Text
1492-
languages:
1493-
Python:
1494-
versions:
1495-
- sdk_version: 3
1496-
github: python/example_code/bedrock-runtime
1497-
excerpts:
1498-
- description: Use the Invoke Model API to send a text message.
1499-
snippet_tags:
1500-
- python.example_code.bedrock-runtime.InvokeModel_TitanText
1501-
services:
1502-
bedrock-runtime: {InvokeModel}

dotnetv3/Bedrock-runtime/Actions/InvokeModelAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ public static async Task<string> InvokeTitanTextG1Async(string prompt)
405405
/// </remarks>
406406
public static async Task<string?> InvokeTitanImageGeneratorG1Async(string prompt, int seed)
407407
{
408-
string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v1";
408+
string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v2:0";
409409

410410
AmazonBedrockRuntimeClient client = new(RegionEndpoint.USEast1);
411411

dotnetv4/Bedrock-runtime/Actions/InvokeModelAsync.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public static async Task<string> InvokeTitanTextG1Async(string prompt)
461461
/// </remarks>
462462
public static async Task<string?> InvokeTitanImageGeneratorG1Async(string prompt, int seed)
463463
{
464-
string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v1";
464+
string titanImageGeneratorG1ModelId = "amazon.titan-image-generator-v2:0";
465465

466466
AmazonBedrockRuntimeClient client = new(RegionEndpoint.USEast1);
467467

gov2/bedrock-runtime/actions/invoke_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ type TitanImageResponse struct {
106106
// Invokes the Titan Image model to create an image using the input provided
107107
// in the request body.
108108
func (wrapper InvokeModelWrapper) InvokeTitanImage(ctx context.Context, prompt string, seed int64) (string, error) {
109-
modelId := "amazon.titan-image-generator-v1"
109+
modelId := "amazon.titan-image-generator-v2:0"
110110

111111
body, err := json.Marshal(TitanImageRequest{
112112
TaskType: "TEXT_IMAGE",

gov2/bedrock-runtime/actions/invoke_model_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
const CLAUDE_MODEL_ID = "anthropic.claude-v2"
21-
const TITAN_IMAGE_MODEL_ID = "amazon.titan-image-generator-v1"
21+
const TITAN_IMAGE_MODEL_ID = "amazon.titan-image-generator-v2:0"
2222

2323
const prompt = "A test prompt"
2424

gov2/bedrock-runtime/scenarios/scenario_invoke_models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (scenario InvokeModelsScenario) InvokeTitanImage(ctx context.Context, promp
112112
if err != nil {
113113
panic(err)
114114
}
115-
imagePath := saveImage(base64ImageData, "amazon.titan-image-generator-v1")
115+
imagePath := saveImage(base64ImageData, "amazon.titan-image-generator-v2")
116116
fmt.Printf("The generated image has been saved to %s\n", imagePath)
117117
}
118118

gov2/bedrock-runtime/stubs/invoke_model_stubs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func StubInvokeModel(params StubInvokeModelParams) testtools.Stub {
4747
// OperationName: "InvokeModel",
4848
// Input: &bedrockruntime.InvokeModelInput{
4949
// Body: requestBytes,
50-
// ModelId: aws.String("amazon.titan-image-generator-v1"),
50+
// ModelId: aws.String("amazon.titan-image-generator-v2:0"),
5151
// ContentType: aws.String("application/json"),
5252
// },
5353
// Output: &bedrockruntime.InvokeModelOutput{

javav2/example_code/bedrock-runtime/src/main/java/com/example/bedrockruntime/models/amazonTitanImage/InvokeModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public static String invokeModel() {
3030
.region(Region.US_EAST_1)
3131
.build();
3232

33-
// Set the model ID, e.g., Titan Image G1.
34-
var modelId = "amazon.titan-image-generator-v1";
33+
// Set the model ID, e.g., Titan Image G2.
34+
var modelId = "amazon.titan-image-generator-v2:0";
3535

3636
// The InvokeModel API uses the model's native payload.
3737
// Learn more about the available inference parameters and response fields at:

php/example_code/bedrock-runtime/BedrockRuntimeService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function invokeTitanImage(string $prompt, int $seed)
109109

110110
$base64_image_data = "";
111111
try {
112-
$modelId = 'amazon.titan-image-generator-v1';
112+
$modelId = 'amazon.titan-image-generator-v2:0';
113113
$request = json_encode([
114114
'taskType' => 'TEXT_IMAGE',
115115
'textToImageParams' => [

php/example_code/bedrock-runtime/GettingStartedWithBedrockRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function runExample()
3737
echo "\n\nAmazon Titan Image Generation:\n";
3838
$titanSeed = rand(0, 2147483647);
3939
$base64 = $bedrockRuntimeService->invokeTitanImage($image_prompt, $titanSeed);
40-
$image_path = $this->saveImage($base64, 'amazon.titan-image-generator-v1');
40+
$image_path = $this->saveImage($base64, 'amazon.titan-image-generator-v2');
4141
echo "The generated image has been saved to $image_path";
4242
}
4343

0 commit comments

Comments
 (0)