AWS SDK で ListFlows を使用する - Amazon Bedrock

AWS SDK で ListFlows を使用する

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

Python
SDK for Python (Boto3)
注記

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

Amazon Bedrock フローの一覧を表示します。

def list_flows(client): """ Lists versions of an Amazon Bedrock flow. Args: client: Amazon Bedrock agent boto3 client. flow_id (str): The identifier of the flow. Returns: Nothing. """ try: finished = False logger.info("Listing flows:") response = client.list_flows(maxResults=10) while finished is False: for flow in response['flowSummaries']: print(f"ID: {flow['id']}") print(f"Name: {flow['name']}") print( f"Description: {flow.get('description', 'No description')}") print(f"Latest version: {flow['version']}") print(f"Status: {flow['status']}\n") if 'nextToken' in response: next_token = response['nextToken'] response = client.list_flows(maxResults=10, nextToken=next_token) else: finished = True logging.info("Successfully listed flows.") except ClientError as e: logging.exception("Client error listing flow versions: %s", str(e)) raise except Exception as e: logging.exception("Unexpected error listing flow versions: %s", str(e)) raise
  • API の詳細については、「AWS SDK for Python (Boto3) API リファレンス」の「ListFlows」を参照してください。

AWS SDK デベロッパーガイドとコード例の詳細なリストについては、「AWS SDK での Amazon Bedrock の使用」を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。