Hey guys, I am extremely a beginner so forgive me for my naive questions. Also, if this is not the right place to ask, please correct me.
I am trying to develop a Text-to-SQL RAG for my database. I have pretty much followed the example on the LlamaIndex Documentation page here:
https://docs.llamaindex.ai/en/stable/examples/pipeline/query_pipeline_sql/As seen in the example, there are a bunch of modules, including a
sql_retriever
module and a
response_synthesis_prompt
module, which has a string defined as the following:
"Given an input question, synthesize a response from the query results.\n"
"Query: {query_str}\n"
"SQL: {sql_query}\n"
"SQL Response: {context_str}\n"
"Response: "
In this case,
{context_str}
is fed by the
sql_retriever
module. However, this context string is always in the format of
one node object.
So let's say my prompt is "How many entries are in the table?". It goes through the whole query pipeline. But then the
{context_str}
generated by the
sql_retriever
module ends up being of a node object defined as something like:
['Node ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\nText: [(3000,)]\nScore: None\n']
And then so the response synthesis module interprets that as only one entry, instead of 3,000 (as you can see in the node object).
My code is basically exactly what it looks like on the documentation. I feel like there is an obvious solution to this but Idk what it is since I am a pure beginner. Can anyone help? thanks.