FoundationModel

class aws_cdk.aws_bedrock.FoundationModel(*args: Any, **kwargs)

Bases: object

A Bedrock base foundation model.

See:

https://docs.aws.amazon.com/bedrock/latest/userguide/models-supported.html

ExampleMetadata:

infused

Example:

import aws_cdk.aws_bedrock as bedrock


model = bedrock.FoundationModel.from_foundation_model_id(self, "Model", bedrock.FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1)

task = tasks.BedrockInvokeModel(self, "Prompt Model",
    model=model,
    input_path=sfn.JsonPath.string_at("$.prompt"),
    output_path=sfn.JsonPath.string_at("$.prompt")
)

Attributes

model_arn

The foundation model ARN.

model_id

The foundation model ID.

Example:

"amazon.titan-text-express-v1"

Static Methods

classmethod from_foundation_model_id(scope, _id, foundation_model_id)

Construct a Bedrock base foundation model given the model identifier.

Parameters:
  • scope (Construct) – The parent construct.

  • _id (str) – The name of the model construct.

  • foundation_model_id (FoundationModelIdentifier) – The model identifier such as ‘amazon.titan-text-express-v1’.

Return type:

FoundationModel

Returns:

A Bedrock base foundation model.

See:

https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids-arns.html