AWS SDK GetFlowVersionで を使用する - AWS SDK コードの例

Doc AWS SDK Examples GitHub リポジトリには、他にも SDK の例があります。 AWS

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

AWS SDK GetFlowVersionで を使用する

次の例は、GetFlowVersion を使用する方法を説明しています。

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

Python
SDK for Python (Boto3)
注記

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

Amazon Bedrock フローのバージョンを取得します。

def get_flow_version(client, flow_id, flow_version): """ Gets information about a version of an Amazon Bedrock flow. Args: client: Amazon Bedrock agent boto3 client. flow_id (str): The identifier of the flow. flow_version (str): The flow version of the flow. Returns: dict: The response from the call to GetFlowVersion. """ try: logger.info("Deleting flow version for flow: %s.", flow_id) # Call GetFlowVersion operation response = client.get_flow_version( flowIdentifier=flow_id, flowVersion=flow_version ) logging.info("Successfully got flow version %s information for flow %s.", flow_version, flow_id) return response except ClientError as e: logging.exception("Client error getting flow version: %s", str(e)) raise except Exception as e: logging.exception("Unexpected error getting flow version: %s", str(e)) raise
  • API の詳細については、 AWS SDK for Python (Boto3) API リファレンスのGetFlowVersion」を参照してください。