Skip to content

InvokeBlueprintOptimizationAsync

Source: src/AWS/BedrockDataAutomation/InvokeBlueprintOptimizationAsync.ts

Runtime binding for the InvokeBlueprintOptimizationAsync operation (IAM action bedrock:InvokeBlueprintOptimizationAsync on the blueprint ARN + the account’s data automation profiles) — start an asynchronous job that tunes the bound blueprint’s schema against labeled samples (asset + ground-truth pairs in S3) from a deployed Function.

The samples and output location are read/written with the caller’s S3 permissions. Poll the returned invocation with the GetBlueprintOptimizationStatus binding. Provide the implementation with Effect.provide(AWS.BedrockDataAutomation.InvokeBlueprintOptimizationAsyncHttp).

// deploy time — bind the blueprint
const optimize =
yield* AWS.BedrockDataAutomation.InvokeBlueprintOptimizationAsync(blueprint);
// runtime — start the optimization job
const { invocationArn } = yield* optimize({
samples: [
{
assetS3Object: { s3Uri: `s3://${bucket}/samples/invoice-1.pdf` },
groundTruthS3Object: { s3Uri: `s3://${bucket}/samples/invoice-1.json` },
},
],
outputConfiguration: {
s3Object: { s3Uri: `s3://${bucket}/optimization-results/` },
},
dataAutomationProfileArn: profileArn,
});