Utilizzo di GetFlowVersion con un SDK AWS
L’esempio di codice seguente mostra come utilizzare GetFlowVersion.
Gli esempi di operazioni sono estratti di codice da programmi più grandi e devono essere eseguiti nel contesto. È possibile visualizzare questa operazione nel contesto nel seguente esempio di codice:
- Python
-
- SDK per Python (Boto3)
-
Ottenere una versione di un flusso 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
Per un elenco completo delle guide per gli sviluppatori di SDK AWS ed esempi di codice, consulta la sezione Utilizzo di Amazon Bedrock con un AWS SDK. Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell'SDK.