Class: AWSCDK::Bedrock::FoundationModel

Inherits:
Jsii::Object
  • Object
show all
Includes:
IModel
Defined in:
bedrock/foundation_model.rb

Overview

A Bedrock base foundation model.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ FoundationModel

Returns a new instance of FoundationModel.

Raises:

  • (NoMethodError)


11
12
13
# File 'bedrock/foundation_model.rb', line 11

def initialize(*args)
  raise NoMethodError, "aws-cdk-lib.aws_bedrock.FoundationModel does not have a visible constructor; use the provided factory methods"
end

Class Method Details

.from_foundation_model_id(scope, _id, foundation_model_id) ⇒ AWSCDK::Bedrock::FoundationModel

Construct a Bedrock base foundation model given the model identifier.

Parameters:

  • scope (Constructs::Construct)

    The parent construct.

  • _id (String)

    The name of the model construct.

  • foundation_model_id (AWSCDK::Bedrock::FoundationModelIdentifier)

    The model identifier such as 'amazon.titan-text-express-v1'.

Returns:

  • (AWSCDK::Bedrock::FoundationModel)

    A Bedrock base foundation model.

See Also:



29
30
31
32
33
34
# File 'bedrock/foundation_model.rb', line 29

def self.from_foundation_model_id(scope, _id, foundation_model_id)
  Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope")
  Jsii::Type.check_type(_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "_id")
  Jsii::Type.check_type(foundation_model_id, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5Gb3VuZGF0aW9uTW9kZWxJZGVudGlmaWVyIn0=")), "foundationModelId")
  Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_bedrock.FoundationModel", "fromFoundationModelId", [scope, _id, foundation_model_id])
end

.jsii_overridable_methodsObject



15
16
17
18
19
20
# File 'bedrock/foundation_model.rb', line 15

def self.jsii_overridable_methods
  {
    :model_arn => { kind: :property, name: "modelArn", is_optional: false },
    :model_id => { kind: :property, name: "modelId", is_optional: false },
  }
end

Instance Method Details

#model_arnString

The foundation model ARN.

Returns:

  • (String)


39
40
41
# File 'bedrock/foundation_model.rb', line 39

def model_arn()
  jsii_get_property("modelArn")
end

#model_idString

The foundation model ID.

Examples:

"amazon.titan-text-express-v1"

Returns:

  • (String)


48
49
50
# File 'bedrock/foundation_model.rb', line 48

def model_id()
  jsii_get_property("modelId")
end