invoke_flow
async
¶
invoke_flow(
flow_identifier: FlowIdentifier,
flow_alias_identifier: FlowAliasIdentifier,
inputs: FlowInputs,
*,
config_overrides: Optional[AsyncBedrockAgentRuntimeClientConfig] = None,
enable_trace: Optional[bool] = None,
model_performance_configuration: Optional[ModelPerformanceConfiguration] = None,
execution_id: Optional[FlowExecutionId] = None,
) -> AsyncGenerator[InvokeFlowResponse]
Invokes an alias of a flow to run the inputs that you specify and return the output of each node as a stream. If there's an error, the error is returned. For more information, see Test a flow in Amazon Bedrock in the Amazon Bedrock User Guide.
The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeFlow.
Parameters:
-
flow_identifier(FlowIdentifier) –The unique identifier of the flow.
-
flow_alias_identifier(FlowAliasIdentifier) –The unique identifier of the flow alias.
-
inputs(FlowInputs) –A list of objects, each containing information about an input into the flow.
-
enable_trace(Optional[bool], default:None) –Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see Track each step in your prompt flow by viewing its trace in Amazon Bedrock.
-
model_performance_configuration(Optional[ModelPerformanceConfiguration], default:None) –Model performance settings for the request.
-
execution_id(Optional[FlowExecutionId], default:None) –The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.
Raises:
-
AccessDeniedException–The request is denied because of missing access permissions. Check your permissions and retry your request.
-
BadGatewayException–There was an issue with a dependency due to a server issue. Retry your request.
-
ConflictException–There was a conflict performing an operation. Resolve the conflict and retry your request.
-
DependencyFailedException–There was an issue with a dependency. Check the resource configurations and retry the request.
-
InternalServerException–An internal server error occurred. Retry your request.
-
ResourceNotFoundException–The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
-
ServiceQuotaExceededException–The number of requests exceeds the service quota. Resubmit your request later.
-
ThrottlingException–The number of requests exceeds the limit. Resubmit your request later.
-
ValidationException–Input validation failed. Check your request parameters and retry the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agent_runtime/_services/async_bedrock_agent_runtime.py
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 | |