When creating a human survey or preview (e.g.Documentation Index
Fetch the complete documentation index at: https://docs.expectedparrot.com/llms.txt
Use this file to discover all available pages before exploring further.
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
Map of question name (string) ->
HumanizeQuestionSchema.Optional survey-level options (e.g. custom CSS).
HumanizeQuestionSchema (per question)
Eachquestions[question_name] value is a HumanizeQuestionSchema object.
Whether the question is optional. Default is
false when omitted.Supported question types: free_text, budget, checkbox, 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.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,minmust be less thanmax,stepmust be positive and not exceed(max - min).
format.Multiple choice only (
multiple_choice). Optional custom validation rules.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.
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, likert_five, linear_scale, list, matrix, multiple_choice, multiple_choice_with_other, numerical, rank, top_k, yes_no.Example
Validation
If the schema is invalid, Expected Parrot raisesHumanizeSchemaValidationError. Common causes:
- A key in
questionsis 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.
questionsnot a dict, or an entry not a dict).
survey.preview(humanize_schema=...) to get a preview URL.
Ensure your humanize schema matches the parameters above for each question type in your survey.