AWS SDK で UpdateFlow を使用する
次の例は、UpdateFlow を使用する方法を説明しています。
- Python
-
- SDK for Python (Boto3)
-
注記
GitHub には、その他のリソースもあります。AWS コード例リポジトリ
で全く同じ例を見つけて、設定と実行の方法を確認してください。 Amazon Bedrock Flow を更新します。
def update_flow(client, flow_id, flow_name, flow_description, role_arn, flow_def): """ Updates an Amazon Bedrock flow. Args: client: bedrock agent boto3 client. flow_id (str): The ID for the flow that you want to update. flow_name (str): The name for the flow. role_arn (str): The ARN for the IAM role that use flow uses. flow_def (json): The JSON definition of the flow that you want to create. Returns: dict: Flow information if successful. """ try: logger.info("Updating flow: %s.", flow_id) response = client.update_flow( flowIdentifier=flow_id, name=flow_name, description=flow_description, executionRoleArn=role_arn, definition=flow_def ) logger.info("Successfully updated flow: %s. ID: %s", flow_name, {response['id']}) return response except ClientError as e: logger.exception("Client error updating flow: %s", {str(e)}) raise except Exception as e: logger.exception("Unexepcted error updating flow: %s", {str(e)}) raise-
API の詳細については、「AWS SDK for Python (Boto3) API リファレンス」の「UpdateFlow」を参照してください。
-
AWS SDK デベロッパーガイドとコード例の詳細なリストについては、「AWS SDK での Amazon Bedrock の使用」を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。
PrepareFlow
UpdateFlowAlias