Skip to contents

Converts a list of survey responses into a formatted string suitable for LLM prompts.

Usage

format_survey_responses(survey_responses)

Arguments

survey_responses

A named list where keys are survey questions and values are the participant's answers.

Value

A character string with survey responses formatted for clarity. Returns "No survey responses provided." if the input is empty.

Examples

format_survey_responses(list(
  "What is your main concern about AI?" = "Job displacement.",
  "How often do you use product X?" = "Daily."
))
#> [1] "The participant provided the following responses to a pre-session questionnaire:\n Question: What is your main concern about AI?\n  Answer: Job displacement.\n\nQuestion: How often do you use product X?\n  Answer: Daily."