AWS SDK で CreateFlowVersion を使用する - AWS SDK コードサンプル

AWS Doc SDK Examples GitHub リポジトリには、他にも用意されている AWS SDK サンプルがあります。

AWS SDK で CreateFlowVersion を使用する

次のコード例は、CreateFlowVersion を使用する方法を示しています。

アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。

Python
SDK for Python (Boto3)
注記

GitHub には、その他のリソースもあります。AWS コード例リポジトリで完全な例を見つけて、設定と実行の方法を確認してください。

Amazon Bedrock フローのバージョンを作成します。

def create_flow_version(client, flow_id, description): """ Creates a version of an Amazon Bedrock flow. Args: client: Amazon Bedrock agent boto3 client. flow_id (str): The identifier of the flow. description (str) : A description for the flow. Returns: str: The version for the flow. """ try: logger.info("Creating flow version for flow: %s.", flow_id) # Call CreateFlowVersion operation response = client.create_flow_version( flowIdentifier=flow_id, description=description ) logging.info("Successfully created flow version %s for flow %s.", response['version'], flow_id) return response['version'] except ClientError as e: logging.exception("Client error creating flow: %s", str(e)) raise except Exception as e: logging.exception("Unexpected error creating flow : %s", str(e)) raise
  • API の詳細については、「AWS SDK for Python (Boto3) API リファレンス」の「CreateFlowVersion」を参照してください。