Improve context formatting in QuestionAnswerAdvisor
- Add line breaks and clarify context boundaries in user text advice. This improve the performance of a Llama3.x - Update corresponding test to reflect new formatting
This commit is contained in:
@@ -52,10 +52,13 @@ import reactor.core.scheduler.Schedulers;
|
||||
public class QuestionAnswerAdvisor implements CallAroundAdvisor, StreamAroundAdvisor {
|
||||
|
||||
private static final String DEFAULT_USER_TEXT_ADVISE = """
|
||||
Context information is below.
|
||||
|
||||
Context information is below, surrounded by ---------------------
|
||||
|
||||
---------------------
|
||||
{question_answer_context}
|
||||
---------------------
|
||||
|
||||
Given the context and provided history information and not prior knowledge,
|
||||
reply to the user comment. If the answer is not in the context, inform
|
||||
the user that you can't answer the question.
|
||||
|
||||
@@ -97,11 +97,13 @@ public class QuestionAnswerAdvisorTests {
|
||||
|
||||
assertThat(userMessage.getContent()).isEqualToIgnoringWhitespace("""
|
||||
Please answer my question XYZ
|
||||
Context information is below.
|
||||
Context information is below, surrounded by ---------------------
|
||||
|
||||
---------------------
|
||||
doc1
|
||||
doc2
|
||||
---------------------
|
||||
|
||||
Given the context and provided history information and not prior knowledge,
|
||||
reply to the user comment. If the answer is not in the context, inform
|
||||
the user that you can't answer the question.
|
||||
|
||||
Reference in New Issue
Block a user