Skip to content

Commit d26b96d

Browse files
authored
chore(model): add support for titan premier (#435)
chore(model): add support for titan premier
1 parent 7fce037 commit d26b96d

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

apidocs/classes/bedrock.BedrockFoundationModel.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ can instantiate a `BedrockFoundationModel` object, e.g: `new BedrockFoundationMo
2121
- [supportsAgents](bedrock.BedrockFoundationModel.md#supportsagents)
2222
- [supportsKnowledgeBase](bedrock.BedrockFoundationModel.md#supportsknowledgebase)
2323
- [vectorDimensions](bedrock.BedrockFoundationModel.md#vectordimensions)
24+
- [AMAZON\_TITAN\_PREMIER\_V1\_0](bedrock.BedrockFoundationModel.md#amazon_titan_premier_v1_0)
2425
- [AMAZON\_TITAN\_TEXT\_EXPRESS\_V1](bedrock.BedrockFoundationModel.md#amazon_titan_text_express_v1)
2526
- [ANTHROPIC\_CLAUDE\_HAIKU\_V1\_0](bedrock.BedrockFoundationModel.md#anthropic_claude_haiku_v1_0)
2627
- [ANTHROPIC\_CLAUDE\_INSTANT\_V1\_2](bedrock.BedrockFoundationModel.md#anthropic_claude_instant_v1_2)
@@ -79,6 +80,12 @@ ___
7980

8081
___
8182

83+
### AMAZON\_TITAN\_PREMIER\_V1\_0
84+
85+
`Static` `Readonly` **AMAZON\_TITAN\_PREMIER\_V1\_0**: [`BedrockFoundationModel`](bedrock.BedrockFoundationModel.md)
86+
87+
___
88+
8289
### AMAZON\_TITAN\_TEXT\_EXPRESS\_V1
8390

8491
`Static` `Readonly` **AMAZON\_TITAN\_TEXT\_EXPRESS\_V1**: [`BedrockFoundationModel`](bedrock.BedrockFoundationModel.md)

lambda/aws-qa-appsync-opensearch/question_answering/src/adapters/bedrock/titan.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ def get_prompt(self):
7575
# Register the adapter
7676
registry.register(r"^Bedrock.amazon.titan-t*", BedrockTitanAdapter)
7777
registry.register(r"^Bedrock.amazon.titan-e*", BedrockTitanAdapter)
78+
registry.register(r"^Bedrock.amazon.titan-p*", BedrockTitanAdapter)

lambda/aws-qa-appsync-opensearch/question_answering/src/llms/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class BedrockModel(StrEnum):
2121
AMAZON_TITAN_EMBED_IMAGE_V1 = 'amazon.titan-embed-image-v1',
2222
AMAZON_TITAN_EMBED_TEXT_V1 = 'amazon.titan-embed-text-v1',
2323
AMAZON_TITAN_IMAGE_GENERATOR_V1 = 'amazon.titan-image-generator-v1',
24+
AMAZON_TITAN_TEXT_PREMIER_V1 = 'amazon.titan-text-premier-v1:0'
2425

2526
MAX_TOKENS_MAP = {
2627
Provider.BEDROCK+'.'+BedrockModel.ANTHROPIC_CLAUDE_V2_1 : 200000,
@@ -33,6 +34,7 @@ class BedrockModel(StrEnum):
3334
Provider.BEDROCK+'.'+BedrockModel.AMAZON_TITAN_EMBED_TEXT_V1: 8000,
3435
Provider.BEDROCK+'.'+BedrockModel.AMAZON_TITAN_EMBED_IMAGE_V1: 128,
3536
Provider.BEDROCK+'.'+BedrockModel.AMAZON_TITAN_IMAGE_GENERATOR_V1: 77,
37+
Provider.BEDROCK+'.'+BedrockModel.AMAZON_TITAN_TEXT_PREMIER_V1: 32000,
3638
}
3739

3840

src/cdk-lib/bedrock/models.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ export class BedrockFoundationModel {
6565
'anthropic.claude-3-haiku-20240307-v1:0',
6666
{ supportsAgents: true },
6767
);
68+
public static readonly AMAZON_TITAN_PREMIER_V1_0 = new BedrockFoundationModel(
69+
'amazon.titan-text-premier-v1:0',
70+
{ supportsAgents: true },
71+
);
6872

6973
public static readonly TITAN_EMBED_TEXT_V1 = new BedrockFoundationModel(
7074
'amazon.titan-embed-text-v1',
@@ -98,4 +102,4 @@ export class BedrockFoundationModel {
98102
const region = cdk.Stack.of(construct).region;
99103
return `arn:aws:bedrock:${region}::foundation-model/${this.modelId}`;
100104
}
101-
}
105+
}

0 commit comments

Comments
 (0)