Allowing Follow-up Questions Without Unnecessary Merging #767
Unanswered
sf-ayushisri
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed that users are unable to ask follow-up questions independently after an initial question. Although the demo in the documentation supports this behaviour, the actual implementation does not.
Upon reviewing the code base, I found that the API endpoint
generate_rewritten_question
is responsible for combining the previous and current questions only if the current question is dependent on the first one. However, this is not functioning as expected. Even when the second question is fully independent and can be answered on its own, it still gets combined with the first question.Changes Made
To address this, I modified the prompt inside generate_rewritten_question from:
Your goal is to combine a sequence of questions into a singular question if they are related. If the second question does not relate to the first question and is fully self-contained, return the second question. Return just the new combined question with no additional explanations. The question should theoretically be answerable with a single SQL statement.
to:
Your goal is to see if the second question is fully self-contained and can be answered independently. If yes, return the second question. If not, combine the first and second questions into a singular question if they are related and return just the new combined question.
then to:
Your goal is to determine whether the second question is fully self-contained and can be answered independently. Follow these steps:
If the second question is fully self-contained and does not rely on information from the first question, return the second question exactly as it is, without any modifications.
Despite these changes, the issue persists—sometimes the two questions are still combined unnecessarily.
Help Needed
I'm looking for suggestions on how to refine the prompt further or adjust the way the API is being used. My client explicitly wants users to be able to ask follow-up questions freely. Any insights on improving this behaviour would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions