Class FoundationModel
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.bedrock.FoundationModel
- All Implemented Interfaces:
IModel,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:33.756Z")
@Stability(Stable)
public class FoundationModel
extends software.amazon.jsii.JsiiObject
implements IModel
A Bedrock base foundation model.
Example:
import software.amazon.awscdk.services.bedrock.*;
FoundationModel model = FoundationModel.fromFoundationModelId(this, "Model", FoundationModelIdentifier.AMAZON_TITAN_TEXT_G1_EXPRESS_V1);
BedrockInvokeModel task = BedrockInvokeModel.Builder.create(this, "Prompt Model")
.model(model)
.body(TaskInput.fromObject(Map.of(
"inputText", "Generate a list of five first names.",
"textGenerationConfig", Map.of(
"maxTokenCount", 100,
"temperature", 1))))
.resultSelector(Map.of(
"names", JsonPath.stringAt("$.Body.results[0].outputText")))
.build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.IModel
IModel.Jsii$Default, IModel.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFoundationModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedFoundationModel(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic FoundationModelfromFoundationModelId(software.constructs.Construct scope, String _id, FoundationModelIdentifier foundationModelId) Construct a Bedrock base foundation model given the model identifier.The foundation model ARN.The foundation model ID.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
FoundationModel
protected FoundationModel(software.amazon.jsii.JsiiObjectRef objRef) -
FoundationModel
protected FoundationModel(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromFoundationModelId
@Stability(Stable) @NotNull public static FoundationModel fromFoundationModelId(@NotNull software.constructs.Construct scope, @NotNull String _id, @NotNull FoundationModelIdentifier foundationModelId) Construct a Bedrock base foundation model given the model identifier.- Parameters:
scope- The parent construct. This parameter is required._id- The name of the model construct. This parameter is required.foundationModelId- The model identifier such as 'amazon.titan-text-express-v1'. This parameter is required.- Returns:
- A Bedrock base foundation model.
- See Also:
-
getModelArn
The foundation model ARN.- Specified by:
getModelArnin interfaceIModel- See Also:
-
getModelId
The foundation model ID.Example:
"amazon.titan-text-express-v1";
-