Skip to main content
EDSL is an open-source library for simulating surveys, experiments and other research with AI agents and large language models. Before running the code below, please ensure that you have installed the EDSL library and either activated remote inference from your Expected Parrot account or stored API keys for the language models that you want to use with EDSL. Please also see our documentation page for tips and tutorials on getting started using EDSL.

Selecting language models

A list of current available models can be viewed here. To see a list of service providers:
To inspect the default model:
LanguageModel Here we select several models to compare their responses for the survey that we create in the steps below:

Generating content

EDSL comes with a variety of standard survey question types, such as multiple choice, free text, etc. These can be selected based on the desired format of the response. See details about all types here. We can use QuestionFreeText to prompt the models to generate some content for our experiment:
We generate a response to the question by adding the models to use with the by method and then calling the run method. This generates a Results object with a Result for each response to the question:
To see a list of all components of results:
We can inspect components of the results individually:

Conducting a review

Next we create a question to have a model evaluating a response that we use as an input to the new question:

Parameterizing questions

We use Scenario objects to add each response to the new question. EDSL comes with many methods for creating scenarios from different data sources (PDFs, CSVs, docs, images, lists, etc.), as well as Results objects:
ScenarioList scenarios: 3; keys: [‘drafting_model’, ‘poem’]; Finally, we conduct the evaluation by having each model score each haiku that was generated (without information about whether the model itself was the source):

Posting to Expected Parrot

Expected Parrot is a platform for creating, storing and sharing LLM-based research. It is fully integrated with EDSL and accessible from your workspace or Expected Parrot account page. Learn more about creating an account and the platform. Here we post this notebook: