Interface BedrockInvokeModelProps
- All Superinterfaces:
AssignableStateOptions,software.amazon.jsii.JsiiSerializable,JsonataCommonOptions,JsonPathCommonOptions,StateBaseProps,TaskStateBaseOptions,TaskStateBaseProps
- All Known Implementing Classes:
BedrockInvokeModelProps.Jsii$Proxy
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();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBedrockInvokeModelPropsstatic final classAn implementation forBedrockInvokeModelProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default StringThe desired MIME type of the inference body in the response.default TaskInputgetBody()The input data for the Bedrock model invocation.default StringDeprecated.This property does not require configuration because the only acceptable value is 'application/json'.default GuardrailThe guardrail is applied to the invocation.default BedrockInvokeModelInputPropsgetInput()The source location to retrieve the input data from.getModel()The Bedrock model that the task will invoke.default BedrockInvokeModelOutputPropsThe destination location where the API response is written.default BooleanSpecifies whether to enable or disable the Bedrock trace.Methods inherited from interface software.amazon.awscdk.services.stepfunctions.AssignableStateOptions
getAssignMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJsonMethods inherited from interface software.amazon.awscdk.services.stepfunctions.JsonataCommonOptions
getOutputsMethods inherited from interface software.amazon.awscdk.services.stepfunctions.JsonPathCommonOptions
getInputPath, getOutputPathMethods inherited from interface software.amazon.awscdk.services.stepfunctions.StateBaseProps
getComment, getQueryLanguage, getStateNameMethods inherited from interface software.amazon.awscdk.services.stepfunctions.TaskStateBaseOptions
getCredentials, getHeartbeat, getHeartbeatTimeout, getIntegrationPattern, getTaskTimeout, getTimeoutMethods inherited from interface software.amazon.awscdk.services.stepfunctions.TaskStateBaseProps
getResultPath, getResultSelector
-
Method Details
-
getModel
The Bedrock model that the task will invoke.- See Also:
-
getAccept
The desired MIME type of the inference body in the response.Default: 'application/json'
- See Also:
-
getBody
The input data for the Bedrock model invocation.The inference parameters contained in the body depend on the Bedrock model being used.
The body must be in the format specified in the
contentTypefield. For example, if the content type isapplication/json, the body must be JSON formatted.The body must be up to 256 KB in size. For input data that exceeds 256 KB, use
inputinstead to retrieve the input data from S3.You must specify either the
bodyor theinputfield, but not both.Default: - Input data is retrieved from the location specified in the `input` field
- See Also:
-
getContentType
Deprecated.This property does not require configuration because the only acceptable value is 'application/json'.(deprecated) The MIME type of the input data in the request.Default: 'application/json'
- See Also:
-
getGuardrail
The guardrail is applied to the invocation.Default: - No guardrail is applied to the invocation.
-
getInput
The source location to retrieve the input data from.Default: - Input data is retrieved from the `body` field
-
getOutput
The destination location where the API response is written.If you specify this field, the API response body is replaced with a reference to the output location.
Default: - The API response body is returned in the result.
-
getTraceEnabled
Specifies whether to enable or disable the Bedrock trace.Default: - Trace is not enabled for the invocation.
-
builder
- Returns:
- a
BedrockInvokeModelProps.BuilderofBedrockInvokeModelProps
-