Skip to contents

Converts a list of demographic information into a formatted string suitable for LLM prompts.

Usage

format_demographics(demographics)

Arguments

demographics

A named list where keys are demographic attributes (e.g., "age", "occupation") and values are the corresponding characteristics.

Value

A character string with demographics formatted as "key1: value1; key2: value2; ...". Returns "No specific demographics provided." if the input is empty or uninformative.

Examples

format_demographics(list(age = 30, occupation = "Engineer"))
#> [1] "age: 30; occupation: Engineer"