Find answers from the community

Updated 3 months ago

Passing output

Hi everyone. I am sure this is a very basic question but I haven't really found a good resource for solving my problem.

I have a bunch of structured data that I am currently able to query and perform well using GPTPandasIndex. However, what I would like to do is to build a text-based interface on top of this whose results in turn can be fed into some other part of the pipeline. Think about the following situation: Suppose my structured data is a massive inventory of objects. The user inputs a query such as Select 100 objects with the property that size of object is greater than 100mm . Once I have the output of this query, I want to run a python program on this output to perform some other operations. This could be something like. adding the output to a queue, and then using some other analysis on it.

So while I get the first part: getting the output from the query (I am currently using eval in python so open to better ideas), I want to be able to connect the query to other external python programs.
L
b
3 comments
It sounds like the index/queries are working well right? Where is the issue with sending the data to other programs?

You could run the index as a sort of REST API server to easily connect it to other programs.
Thanks for the rapid response. I think I should have been clearer. I want the user to provide some context for the external program within the query.

So you are right, currently the query engine works and then I have hooked it to the external program. But suppose the user entered something like Select 100 objects with the property that size of object is greater than 100 mm. Optimize for lowest cost

So the first part of the query is being handled. The second part actually sits in an external program. Moreover there is no column called cost in the structured data that I give as input.

Does this make more sense ?
Yea as you mentioned, I think a langchain agent with llama index as a custom tool is the way to go here. I'm not sure how else to accomplish this πŸ€”
Add a reply
Sign up and join the conversation on Discord