To confirm, you're looking to understand how to invoke a Bedrock agent.
Take a look at this article on the AWS KB that provides some sample code in the comment.
Unlike with conversation AI's like AWS Lex, these LLM's take much longer to respond.
So you cannot expect a synchronous response like you would get from Lex.
Instead, you need to wait for the response to come through in chunks before putting them together to get the final, completed response.