Skip to main content
Before running the code below please see instructions on getting started using EDSL.

Overview

Using a dataset of mock customer service tickets as an example, we demonstrate how to:
1
Import data into EDSL as scenarios
2
Create questions about the data
3
Design an AI agent to answer the questions
4
Select a language model to generate responses
5
Analyze results as a formatted dataset
This workflow can be visualized as follows:
general_survey.png

Selecting data for review

First we identify some data for review. Data can be created in EDSL or imported from other sources (CSV, PDF, PNG, MP4, DOC, tables, lists, dicts, etc.). For purposes of demonstration we import a set of hypothetical customer tickets for a transportation app:

Constructing questions about the data

Next we create some questions about the data. EDSL provides a variety of question types that we can choose from based on the form of the response that we want to get back from the model (multiple choice, free text, checkbox, linear scale, etc.). Learn more about question types.
Note:Note that we use a {{ placeholder }} in each question text in order to parameterize the questions with the individual ticket contents in the next step:

Building a survey

We combine the questions into a survey in order to administer them together: from edsl import Survey survey = Survey( questions=[ q_issues, q_primary_issue, q_accident, q_sentiment, q_refund, q_priority, ] ) Survey questions are administered asynchronously by default. Learn more about adding conditional logic and memory to your survey. Here we inspect them:

Designing AI agents

A key feature of EDSL is the ability to create personas for AI agents that the language models are prompted to use in generating responses to the questions. This is done by passing a dictionary of traits to Agent objects:

Selecting language models

EDSL allows us to select the language models to use in generating results. See the model pricing page <>__ for pricing and performance information for available models. Here we select gpt-4o (if no model is specified, the default model is used – run Model() to verify the current default model):

Adding data to the questions

We add the contents of each ticket into each question as an independent “scenario” for review. This allows us to create versions of the questions for each job post and deliver them to the model all at once:

Running the survey

We run the survey by adding the scenarios, agent and model with the by() method and then calling the run() method:
This generates a formatted dataset of Results that includes information about all the components, including the prompts and responses. We can see a list of all the components:

Analyzing results

EDSL comes with built-in methods for analyzing results. Here we filter, sort, select and print components in a table:
We can apply some lables to our table:
EDSL also comes with methods for accessing results as a dataframe or SQL table:
We can also access results as a SQL table:
To export results to a CSV file:

Posting content to Expected Parrot

We can post any EDSL objects to Expected Parrot, and share them publicly, privately or unlisted (by default). The above results were automatically posted to Expected Parrot; we can also post them manually:
To post this notebook:
To update an object at Expected Parrot: