本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
Amazon Bedrock 是如何 EventBridge 运作的
Amazon EventBridge 是一个无服务器事件总线,用于接收来自 AWS 服务、SaaS 合作伙伴和客户应用程序的状态变更事件。它根据您创建的规则或模式处理事件,并将这些事件路由到您选择的一个或多个目标,例如 Amazon Simple Queue Service 和 Amazon 简单通知服务。 AWS Lambda您可以根据事件的内容配置下游工作流程。
在学习如何使用 Amazon f EventBridge or Amazon Bedrock 之前,请查看亚马逊 EventBridge 用户指南中的以下页面。
每当你提交的工作状态发生变化 EventBridge 时,Amazon Bedrock 都会通过亚马逊发布你的活动。在每种情况下,都会创建一个新事件并将其发送到 Amazon EventBridge,然后亚马逊会将该事件发送到您的默认事件总线。该事件显示哪个作业的状态已更改以及该作业的当前状态。
在事件中,Amazon Bedrock 事件由source
存在aws.bedrock
的价值来识别。Amazon Bedrock 中的活动包括以下内容:detail-type
选择一个选项卡,查看在 Amazon Bedrock 中提交的作业的示例事件。
- Model Customization Job State Change
-
以下JSON对象显示了模型自定义任务状态发生变化时的示例事件:
{
"version": "0",
"id": "UUID",
"detail-type": "Model Customization Job State Change",
"source": "aws.bedrock",
"account": "123456789012",
"time": "2023-08-11T12:34:56Z",
"region": "us-east-1",
"resources": ["arn:aws:bedrock:us-east-1:123456789012:model-customization-job/abcdefghwxyz"],
"detail": {
"version": "0.0",
"jobName": "abcd-wxyz",
"jobArn": "arn:aws:bedrock:us-east-1:123456789012:model-customization-job/abcdefghwxyz",
"outputModelName": "dummy-output-model-name",
"outputModelArn": "arn:aws:bedrock:us-east-1:123456789012:dummy-output-model-name",
"roleArn": "arn:aws:iam::123456789012:role/JobExecutionRole",
"jobStatus": "Failed",
"failureMessage": "Failure Message here.",
"creationTime": "2023-08-11T10:11:12Z",
"lastModifiedTime": "2023-08-11T12:34:56Z",
"endTime": "2023-08-11T12:34:56Z",
"baseModelArn": "arn:aws:bedrock:us-east-1:123456789012:base-model-name",
"hyperParameters": {
"batchSize": "1",
"epochCount": "5",
"learningRate": "0.05",
"learningRateWarmupSteps": "10"
},
"trainingDataConfig": {
"s3Uri": "s3://bucket/key"
},
"validationDataConfig": {
"s3Uri": "s3://bucket/key"
},
"outputDataConfig": {
"s3Uri": "s3://bucket/key"
}
}
}
要了解细节对象中特定于模型自定义的字段,请参阅GetModelCustomizationJob。
- Batch Inference Job State Change
-
以下JSON对象显示了模型自定义任务状态发生变化时的示例事件:
{
"version": "0",
"id": "a1b2c3d4",
"detail-type": "Batch Inference Job State Change",
"source": "aws.bedrock",
"account": "123456789012",
"time": "Wed Aug 28 22:58:30 UTC 2024",
"region": "us-east-1",
"resources": ["arn:aws:bedrock:us-east-1:123456789012:model-invocation-job/abcdefghwxyz"],
"detail": {
"version": "0.0",
"accountId": "123456789012",
"batchJobName": "dummy-batch-job-name",
"batchJobArn": "arn:aws:bedrock:us-east-1:123456789012:model-invocation-job/abcdefghwxyz",
"batchModelId": "arn:aws:bedrock:us-east-1::foundation-model/anthropic.claude-3-sonnet-20240229-v1:0",
"status": "Completed",
"failureMessage": "",
"creationTime": "Aug 28, 2024, 10:47:53 PM"
}
}
要了解详细信息对象中特定于批量推理的字段,请参阅GetModelInvocationJob。