expectedparrot / edsl

Design, conduct and analyze results of AI-powered surveys and experiments. Simulate social science and market research with large numbers of AI agents and LLMs.
https://docs.expectedparrot.com
MIT License
187 stars 19 forks source link

Dynamic options bug #829

Closed johnjosephhorton closed 3 months ago

johnjosephhorton commented 3 months ago
from edsl import QuestionMultipleChoice, Scenario, ScenarioList

q = QuestionMultipleChoice(
question_text = """
Jules wants to purchase a Royale with cheese from Vincent. 
Vincent is willing to offer this tasty burger for ${{ wta }}. 
The most Jules is willing to pay for the tasty burger is ${{ wtp }} 
(after all, his girlfriend is a vegetarian, so he doesn’t get many opportunities 
for tasty burgers).

How large are the potential gains from trade if Jules and Vincent agree to make this 
trade? 
In other words, what is the sum of producer and consumer surplus if the trade happens?
Think carefully.
""", 
    question_options = "{{surplus_options}}", 
    question_name = "q1")

scenario = ScenarioList([Scenario({'wtp':8, 'wta':3, 'surplus_options': ["$3", "$4", "$5"]})])
results = q.by(scenario).run()
results.select('answer.*', "comment.q1_comment").print(format = "rich")
Screenshot 2024-08-01 at 9 41 38 AM
rbyh commented 3 months ago

The problem is that it is looking for literal "{{question_options}}" It will not take "{{surplus_options}}"

rbyh commented 3 months ago

image