diff --git a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java index 788c47a14..33fb8b0f4 100644 --- a/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java +++ b/spring-ai-core/src/main/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisor.java @@ -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. diff --git a/spring-ai-core/src/test/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisorTests.java b/spring-ai-core/src/test/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisorTests.java index 768513307..ec6d5bd1e 100644 --- a/spring-ai-core/src/test/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisorTests.java +++ b/spring-ai-core/src/test/java/org/springframework/ai/chat/client/advisor/QuestionAnswerAdvisorTests.java @@ -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.