Find answers from the community

Home
Members
MrLavaLava
M
MrLavaLava
Offline, last seen 4 months ago
Joined September 25, 2024
Hello everyone! I'm new to LlamaIndex and have been exploring the QueryPipeline functionality. I've successfully implemented a QueryPipeline with an index, but now I'd like to extend its capabilities by fetching additional live data from an API based on the nature of the query.
For example:

If the query is "What is Tesla company?", I want to return the data from my existing index.
However, if the query is "What is the value of the TSLA ticker?", I'd like to make an API call to fetch the current price of the TSLA stock and include that in the response.

My question is: How can I integrate data fetching from an external API into the QueryPipeline based on the specific query? I want to make the API call only when the query requires real-time data that isn't available in my index.
Does anyone have any suggestions or examples of how to achieve this? Any guidance would be greatly appreciated!
Thanks in advance.
3 comments
M
L