Skip to main content
When creating a human survey or preview (e.g. survey.humanize() or survey.preview()), you can pass a humanize schema to control styling and optionality per question. The schema is validated against your survey before use.

Fields

dict
Map of question name (string) -> HumanizeQuestionSchema.
dict
Optional survey-level options (e.g. custom CSS).

HumanizeQuestionSchema (per question)

Each questions[question_name] value is a HumanizeQuestionSchema object.
boolean
default:false
Whether the question is optional. Default is false when omitted.Supported question types: free_text, budget, checkbox, checkbox_with_other, file_upload, interview, likert_five, linear_scale, list, matrix, multiple_choice, multiple_choice_with_other, numerical, rank, top_k, yes_no.Note: optional currently has no effect for interview and rank.
dict
Display format. Varies by question type:
  • MC-style (likert_five, linear_scale, multiple_choice, yes_no): "radio" (list of radio buttons) or "dropdown" (single <select>). Default is "radio". Use {"type": "radio"} or {"type": "dropdown"}.
  • Numerical (numerical): "input" (number input field) or "slider" (range slider). Default is "input". Use {"type": "input"} or {"type": "slider", "min": 0, "max": 100, "step": 1}. For slider, min must be less than max, step must be positive and not exceed (max - min).
Other question types do not support format.
dict
Multiple choice only (multiple_choice). Optional custom validation rules.
array
default:[]
Checkbox only (checkbox, checkbox_with_other). Options that stand alone: checking one clears every other selection — including any other exclusive option, and for checkbox_with_other the respondent’s “other” entries — and selecting anything else clears it. Use for options like "None of the above" or "Prefer not to say".Each entry must be the exact text of an option in the question’s question_options — matching is literal, so surrounding whitespace is not trimmed for you. Entries must be non-empty and unique. Because an exclusive option is an ordinary member of the option list, the submitted answer looks like any other selection. Defaults to an empty list, meaning no option is exclusive.
string
default:"text"
Interview only (interview). Controls the input mode offered to respondents.
  • "text" — text-based interview (default).
  • "voice" — voice-based interview.
  • "both" — respondent can choose between text and voice.
dict
Interview only (interview). The intro screen shown to the respondent before the interview begins. The intro screen is always shown; this field customizes its text. Omit or set to null to use the default text ("This will be a conversation with an AI agent.").
dict
Interview only (interview). Optional configuration for voice-mode interviews. Ignored when interview_mode is "text".
dict
Interview only (interview). Optional configuration for text-mode interviews. Ignored when interview_mode is "voice".
dict
Optional comment input shown with the question. Submitted comment text appears in survey results under comment.{question_name}_comment.Supported question types: free_text, budget, checkbox, checkbox_with_other, likert_five, linear_scale, list, matrix, multiple_choice, multiple_choice_with_other, numerical, rank, top_k, yes_no.
dict
Optional indicator shown after the respondent clicks Next, while the following question runs. Omit or set to null for no indicator.Supported question types: free_text, budget, checkbox, checkbox_with_other, file_upload, likert_five, linear_scale, list, matrix, multiple_choice, multiple_choice_with_other, numerical, rank, top_k, yes_no.Note: not supported for compute (runs locally and auto-advances, so it is never the question a respondent submits) or interview.

Example

Validation

If the schema is invalid, Expected Parrot raises HumanizeSchemaValidationError. Common causes:
  • A key in questions is not a question name in the survey, or is an instruction.
  • A question’s type is not supported for humanize schema (e.g. demand, dropdown).
  • A question’s entry has the wrong shape for its type (e.g. wrong field types or extra fields that aren’t allowed).
  • Top-level structure is invalid (e.g. questions not a dict, or an entry not a dict).
You can also pass the schema to survey.preview(humanize_schema=...) to get a preview URL. Ensure your humanize schema matches the parameters above for each question type in your survey.