- Newest
- Most votes
- Most comments
Hello.
The "invoke_flow" API is included in "bedrock-agent-runtime" instead of "bedrock-runtime".
So, please try changing the boto3 client creation method as follows.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agent-runtime.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agent-runtime/client/invoke_flow.html
import boto3
client = boto3.client('bedrock-agent-runtime')
The InvokeFlow operation is not currently supported in the boto3 SDK for Amazon Bedrock. This is not an issue with your setup or account restrictions, but rather a limitation of the current AWS CLI and SDK implementation for Bedrock.
The AWS CLI does not support streaming operations in Amazon Bedrock, including InvokeFlow. This limitation extends to the boto3 SDK, which is why you're not seeing the invoke_flow method in the available operations for the bedrock-runtime client.
At present, there is no official timeline provided for the inclusion of InvokeFlow in boto3. Amazon Bedrock is a relatively new service, and it's possible that support for InvokeFlow may be added in future updates to the SDK.
As for alternatives or workarounds, since InvokeFlow is part of the Amazon Bedrock API, you might consider using direct HTTP requests to the API endpoint if you need to use this operation in your application. This would involve manually constructing and sending HTTP requests to the appropriate Bedrock endpoint, handling authentication, and parsing the responses.
However, it's important to note that InvokeFlow is designed for streaming responses, which can be complex to handle without SDK support. If your use case allows, you might want to explore if other available methods in the boto3 SDK for Bedrock (such as invoke_model or invoke_model_with_response_stream) can meet your requirements until InvokeFlow is officially supported.
For the most up-to-date information on SDK support and potential workarounds, it would be advisable to check the official AWS documentation regularly or reach out to AWS Support for specific guidance on your use case.
Sources
InvokeFlow - Amazon Bedrock
Community | AWS BedRock - Boto3 Demo - LLAMA2 Model
Community | AWS BedRock - Boto3 Demo - Cohere Model
answered 2 years ago
Relevant content
asked 2 years ago

Simple fix. Thank you!