Find answers from the community

Updated 8 months ago

Hello everyone! I'm new to LlamaIndex

At a glance
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.
M
L
3 comments
Sounds like you need an agent with tools
Thanks for answering back @Logan M

I'm thinking of using ReactAgent for this. (let me know if there's a better agent for this usecase?)

2 question though, using of agent will slow down the response times right? Any ideas to speed it up? and would I be able to stream the reply from agent?
Add a reply
Sign up and join the conversation on Discord