Skip to main content
A question defines what is asked and the expected answer format. Choose the format before writing the prompt so responses can be compared and analyzed consistently. For data labeling, a question’s answer becomes a label: “What topic does this passage discuss?” can return a category, while “Extract the dates and organizations” can return named fields. Put the passages or documents in scenarios to reuse the same questions across your material. Label data with survey questions shows how to use an existing codebook or develop labels through exploratory questions first.

Choose a question type

These are common choices. The type details below explain their parameters and include examples. Use ep schema list and ep schema show --question_type TYPE to inspect required parameters.

Construct questions

The example asks for three complementary measures of a message: a clarity category, an explanation, and a numerical score. It constructs the questions and survey without generating answers. A scenario supplies the message text when the survey runs.
The answers will be a category, a string, and a number from 0 to 10. Validation checks response structure and configured constraints; it does not establish whether an answer is true or a classification is correct. Invalid model answers can lead to retries or interview errors, which should be inspected with the results.

Names, inputs, and instructions

Use unique question_name values within a survey; a question named clarity produces the column answer.clarity. The name identifies the variable in your analysis, while question_text contains the wording to answer. Put varying source material in Scenarios, respondent traits in Agents, and answer dependencies in Surveys. Use question_text for the research question and answering_instructions for how to answer it. Inspect the generated Prompts before changing formatting instructions supplied by the question type.

Run a question

Questions can run individually or as part of a survey. Follow the Run your first survey tutorial for an executable local example and model setup.

Common methods

For example, inspect a multiple-choice question’s definition:

Preview and vary a question

Use render() to substitute known values without calling a model. It returns a new question:
question.copy() makes an independent copy. For questions with a fixed list of options, question.draw(random_seed=42) returns a copy with shuffled options; pin_options=["Other"] keeps those options in their original positions. question.option_permutations() returns every ordering as separately named questions, so its size grows factorially with the number of options. Use question.add_question(other_question) to build a Survey, or question.to_jobs() to prepare a job directly. question.run(...) is a one-question shortcut for execution; await question.run_async(...) is available in asynchronous Python. Both accept run options described under Jobs.

Question type details

Most types share question_name and question_text. The table lists additional parameters for common response formats. Constructing these questions makes no model calls. For option-based types that support use_code, setting it to True asks for option indices; setting it to False asks for option values. The examples below use values explicitly where needed.
checkbox records a selection; rank preserves the requested ordering. Use top_k when you need a fixed selection count without ranking.
The rating must be one of the configured scale values. The measurement can be any number within its bounds.
Supply feedback through a Scenario when running these questions. Use dict when you need to declare value types explicitly. Neither format establishes the factual accuracy of an extracted value.
The response contains one configured rating per item. Use separate questions if the items need different scales or survey logic.

Additional types

EDSL also includes specialized types for Other responses (multiple_choice_with_other, checkbox_with_other), long choice lists (dropdown), structured validation (pydantic), and formats such as markdown and url. Inspect an example and its fields before adapting it:
For a machine-readable schema, use ep schema show --question_type multiple_choice_with_other. Choose a specialized type for the behavior you need: For example, define a structured answer and a deterministic calculation:
Construction makes no model calls. coding requires model execution to generate an answer; double_score computes its answer from a scenario’s score when run. Validate specialized workflows with representative inputs before using them in a study.