File tree Expand file tree Collapse file tree
KernelMemory.Extensions.FunctionalTests/QueryPipeline
KernelMemory.Extensions/QueryPipeline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,17 @@ public void Can_continue_conversation_with_unanswered_question()
6868 Assert . False ( question . Answered ) ;
6969 }
7070
71+ [ Fact ]
72+ public void Original_question_is_saved_when_rewriting_question ( )
73+ {
74+ var sut = GenerateSut ( "What is water" ) ;
75+
76+ sut . RewriteQuestion ( "What is the color of the sky" ) ;
77+
78+ Assert . Equal ( "What is water" , sut . OriginalQuestion ) ;
79+ Assert . Equal ( "What is the color of the sky" , sut . Question ) ;
80+ }
81+
7182 [ Fact ]
7283 public void Can_add_saved_conversation_to_userQuestion ( )
7384 {
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ internal void AddReRanker(IReRanker reRanker)
3333
3434 public string Question { get ; private set ; }
3535
36+ /// <summary>
37+ /// if the question was rewritten, this stores the original question made by the user.
38+ /// </summary>
39+ public string OriginalQuestion { get ; private set ; }
40+
3641 /// <summary>
3742 /// Optional list of filter to perform the query.
3843 /// </summary>
@@ -193,6 +198,7 @@ public void SetConversation(Conversation conversation)
193198
194199 public void RewriteQuestion ( string newQuestion )
195200 {
201+ OriginalQuestion = Question ;
196202 Question = newQuestion ;
197203 }
198204
You can’t perform that action at this time.
0 commit comments