Usar UpdateFlow com um SDK da AWS - Amazon Bedrock

Usar UpdateFlow com um SDK da AWS

O código de exemplo a seguir mostra como usar UpdateFlow.

Python
SDK para Python (Boto3).
nota

Há mais no GitHub. Encontre o exemplo completo e saiba como configurar e executar no AWSCode Examples Repository.

Atualizar um fluxo do Amazon Bedrock.

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
  • Para ver detalhes da API, consulte UpdateFlow na Referência da API AWS SDK para Python (Boto3).

Para ver uma lista completa dos guias de desenvolvedor e exemplos de código do SDK da AWS, consulte Usar o Amazon Bedrock com um SDK da AWS. Este tópico também inclui informações sobre como começar e detalhes sobre versões anteriores do SDK.