{{ placeholders }} for the components of the first question that we want to include. The placeholders must include the question_name of the piped question and the name of the component (e.g., answer or comment):
show_prompts() method on the survey. We can see that the multiple choice question automatically includes answering instructions for the question type, and an instruction for the model to add a comment about its response which will be stored as a separate component in results (we will see this when the question is run). (The instruction to add a comment is automatically added to all question types other than free text and can be omitted by passing include_comment=False).
In the second question, we can see that the components of the first question text, answer and comment will be inserted. Note that there is no system prompt displayed in the prompts because we have not added any agents:
Inspecting completed prompts in results
Here we run the survey and inspect results, which also include the prompts that were used with the piped components:
To inspect the user prompts, which now include the piped components:
Compare to memory rules
EDSL provides a variety of rules for automatically adding the context of one or more specified questions and answers to other questions in a survey. See the docs page for examples of all of these methods. Here we create a different version of the second question (omitting piped components and context) and add a memory of the first question after combining them in a survey. Then we show how this impacts the prompts tha are generated:
We can see that the following context has been added to the second question: “Before the question you are now answering, you already answered the following question(s): Question: What is your favorite season? Answer: None”
Note:Note that this context does not include the comment field!
Note:Note that full memory can results in long question contexts when a survey consists of many questions. Before using a memory rule, we commend investigating impacts to the accuracy of responses by testing examples, and whether memory is needed for any particular question.
