-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow setting query transformers in BaseRAGQuestionAnswerer #174
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
base: main
Are you sure you want to change the base?
Conversation
|
I liked the changes in the previous PR better
|
|
Okay i Will do it |
|
Status of Changes:
|
|
@Ch-Abhinav-Chowdary You're still using the rewritten prompt both for retrieval and answering. Please change this so that the new prompt is used only for retrieval. Also, the test you've written doesn't pass.
Do you have more details what wasn't working for you? I tried that in a clean environment and managed to build Pathway based purely on this repository |
|
Okay i will work on it |
Summary
Added a new optional parameter query_transformer_prompt: pw.UDF | None to BaseRAGQuestionAnswerer (and AdaptiveRAGQuestionAnswerer) to enable query rewriting/normalization before retrieval and prompt construction.
What changed
BaseRAGQuestionAnswerer.init: accepts and stores query_transformer_prompt.
BaseRAGQuestionAnswerer.answer_query: if provided, applies query_transformer_prompt to prompt before calling retriever and before generating the RAG prompt.
AdaptiveRAGQuestionAnswerer.init: accepts and forwards query_transformer_prompt.
Updated docstrings to document the new parameter.
Why
Enables custom query transformers (rewrite/expand/normalize) without changing server schemas or external request formats.