-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: How to create a querypipeline to chat with text docs and sql tables. #13775
Comments
Basically add some kind of router to route between the paths. Query pipelines support conditional links |
Thanks @logan-markewich. I am new to LlamaIndex, and still have lots of confusion, just try to learn from the examples and real problems. I combined the two examples together as the basic queryPipeline like this:
2nd example for text RAG:
I add a 3rd querypipeline just use the llm:
Then I add the router as:
It returns the error:
|
Any solution for this issue? I meet it as well. How to define a free_req_input_key for QueryPipeline modules? |
@JonOnEarth prompt_str = "{query}"
prompt_tmpl = PromptTemplate(prompt_str)
p = QueryPipeline(verbose=True)
p.add_modules(
{
"input": prompt_tmpl,
"retriever": retriever,
"summarizer": summarizer,
}
)
p.add_link("input", "retriever")
p.add_link("input", "summarizer", dest_key="query_str")
p.add_link("retriever", "summarizer", dest_key="nodes") You can try using this code. |
@lazyFrogLOL Thanks for the solution. |
Question Validation
Question
I have followed these two advanced examples [1, 2] to successfully chat with SQL tables, and text docs separately.
How can I stitch them together? chat with multiple SQL tables and text docs at the same time.
The process should be to choose the correct docs based on the query, and then chat with the chosen doc or table. If it's the table, then need the
text-to-sql
component as well.Besides, if I ask irrelevant queries with these documents, how can just use the LLM's reply instead of always searching the documents?
The text was updated successfully, but these errors were encountered: