How to invoke an API call to fetch data based on the query asked to a RAG model?

Hi!

I am trying to build a RAG which has to get data from an API call. The API that is invoked to fetch the data depends on the query asked by the user to the model.

Is there any way to implement the above using llama index?