BedrockInvokeModelInputProps

class aws_cdk.aws_stepfunctions_tasks.BedrockInvokeModelInputProps(*, s3_input_uri=None, s3_location=None)

Bases: object

Location to retrieve the input data, prior to calling Bedrock InvokeModel.

Parameters:
  • s3_input_uri (Optional[str]) – The source location where the API response is written. This field can be used to specify s3 URI in the form of token Default: - The API response body is returned in the result.

  • s3_location (Union[Location, Dict[str, Any], None]) – S3 object to retrieve the input data from. If the S3 location is not set, then the Body must be set. Default: - Input data is retrieved from the body field

See:

https://docs.aws.amazon.com/step-functions/latest/dg/connect-bedrock.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=tasks.BedrockInvokeModelInputProps(s3_input_uri=sfn.JsonPath.string_at("$.prompt")),
    output=tasks.BedrockInvokeModelOutputProps(s3_output_uri=sfn.JsonPath.string_at("$.prompt"))
)

Attributes

s3_input_uri

The source location where the API response is written.

This field can be used to specify s3 URI in the form of token

Default:
  • The API response body is returned in the result.

s3_location

S3 object to retrieve the input data from.

If the S3 location is not set, then the Body must be set.

Default:
  • Input data is retrieved from the body field