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
174 stars 18 forks source link

Using edsl for code generation - error (and add documentation) #425

Open johnjosephhorton opened 5 months ago

johnjosephhorton commented 5 months ago
Screenshot 2024-05-04 at 10 12 04 AM
rbyh commented 4 months ago

This does not work when the question text has """text across lines in triple-quotes"""

Code to reproduce issue:

from edsl.questions import QuestionFreeText
from edsl import Survey

q = QuestionFreeText(
    question_name = "weather",
    question_text = """Draft a paragraph
    about the weather."""
)

survey = Survey([q])

generated_code = survey.code("example.py")
image
rbyh commented 4 months ago

@zer0dss I think you worked on a similar issue where """ """ tripe quotes created a problem?

zer0dss commented 4 months ago

@rbyh Yes, I think we had a similar issue on xdsl. I have to check it.