edsl 0.1.44__tar.gz → 0.1.45__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. edsl-0.1.45/PKG-INFO +246 -0
  2. edsl-0.1.45/README.md +190 -0
  3. edsl-0.1.45/edsl/__version__.py +1 -0
  4. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/InvigilatorBase.py +3 -1
  5. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/PromptConstructor.py +62 -34
  6. edsl-0.1.45/edsl/agents/QuestionInstructionPromptBuilder.py +230 -0
  7. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/QuestionTemplateReplacementsBuilder.py +69 -16
  8. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/question_option_processor.py +15 -6
  9. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/CoopFunctionsMixin.py +3 -4
  10. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/coop.py +23 -9
  11. {edsl-0.1.44 → edsl-0.1.45}/edsl/enums.py +3 -3
  12. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/AnthropicService.py +11 -9
  13. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/AvailableModelFetcher.py +2 -0
  14. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/AwsBedrock.py +1 -2
  15. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/AzureAI.py +12 -9
  16. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/GoogleService.py +9 -4
  17. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/InferenceServicesCollection.py +2 -2
  18. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/MistralAIService.py +1 -2
  19. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/OpenAIService.py +9 -4
  20. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/PerplexityService.py +2 -1
  21. edsl-0.1.44/edsl/inference_services/GrokService.py → edsl-0.1.45/edsl/inference_services/XAIService.py +2 -2
  22. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/registry.py +2 -2
  23. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/Jobs.py +9 -0
  24. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/JobsChecks.py +10 -13
  25. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/async_interview_runner.py +3 -1
  26. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/check_survey_scenario_compatibility.py +5 -5
  27. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewExceptionEntry.py +12 -0
  28. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tasks/TaskHistory.py +1 -1
  29. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/LanguageModel.py +0 -3
  30. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/PriceManager.py +45 -5
  31. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/model.py +47 -26
  32. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionBase.py +21 -0
  33. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionBasePromptsMixin.py +103 -0
  34. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionFreeText.py +22 -5
  35. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/descriptors.py +4 -0
  36. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/question_base_gen_mixin.py +94 -29
  37. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/Dataset.py +65 -0
  38. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/DatasetExportMixin.py +299 -32
  39. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/Result.py +27 -0
  40. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/Results.py +22 -2
  41. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/ResultsGGMixin.py +7 -3
  42. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/DocumentChunker.py +2 -0
  43. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/FileStore.py +10 -0
  44. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/PdfExtractor.py +21 -1
  45. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/Scenario.py +25 -9
  46. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/ScenarioList.py +73 -3
  47. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/__init__.py +1 -0
  48. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/docx.py +5 -1
  49. edsl-0.1.45/edsl/scenarios/handlers/jpeg.py +39 -0
  50. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/Survey.py +5 -4
  51. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/SurveyFlowVisualization.py +91 -43
  52. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/exceptions_table.html +7 -8
  53. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/interview_details.html +1 -1
  54. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/interviews.html +0 -1
  55. edsl-0.1.45/edsl/templates/error_reporting/overview.html +26 -0
  56. edsl-0.1.45/edsl/templates/error_reporting/performance_plot.html +2 -0
  57. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/report.css +1 -1
  58. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/PrettyList.py +14 -0
  59. {edsl-0.1.44 → edsl-0.1.45}/pyproject.toml +2 -2
  60. edsl-0.1.44/PKG-INFO +0 -110
  61. edsl-0.1.44/README.md +0 -54
  62. edsl-0.1.44/edsl/__version__.py +0 -1
  63. edsl-0.1.44/edsl/agents/QuestionInstructionPromptBuilder.py +0 -187
  64. edsl-0.1.44/edsl/templates/error_reporting/overview.html +0 -31
  65. edsl-0.1.44/edsl/templates/error_reporting/performance_plot.html +0 -2
  66. {edsl-0.1.44 → edsl-0.1.45}/LICENSE +0 -0
  67. {edsl-0.1.44 → edsl-0.1.45}/edsl/Base.py +0 -0
  68. {edsl-0.1.44 → edsl-0.1.45}/edsl/BaseDiff.py +0 -0
  69. {edsl-0.1.44 → edsl-0.1.45}/edsl/TemplateLoader.py +0 -0
  70. {edsl-0.1.44 → edsl-0.1.45}/edsl/__init__.py +0 -0
  71. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/Agent.py +0 -0
  72. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/AgentList.py +0 -0
  73. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/Invigilator.py +0 -0
  74. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/__init__.py +0 -0
  75. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/descriptors.py +0 -0
  76. {edsl-0.1.44 → edsl-0.1.45}/edsl/agents/prompt_helpers.py +0 -0
  77. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/AutoStudy.py +0 -0
  78. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StageBase.py +0 -0
  79. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StageGenerateSurvey.py +0 -0
  80. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StageLabelQuestions.py +0 -0
  81. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StagePersona.py +0 -0
  82. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StagePersonaDimensionValueRanges.py +0 -0
  83. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StagePersonaDimensionValues.py +0 -0
  84. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StagePersonaDimensions.py +0 -0
  85. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/StageQuestions.py +0 -0
  86. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/SurveyCreatorPipeline.py +0 -0
  87. {edsl-0.1.44 → edsl-0.1.45}/edsl/auto/utilities.py +0 -0
  88. {edsl-0.1.44 → edsl-0.1.45}/edsl/base/Base.py +0 -0
  89. {edsl-0.1.44 → edsl-0.1.45}/edsl/config.py +0 -0
  90. {edsl-0.1.44 → edsl-0.1.45}/edsl/conversation/Conversation.py +0 -0
  91. {edsl-0.1.44 → edsl-0.1.45}/edsl/conversation/car_buying.py +0 -0
  92. {edsl-0.1.44 → edsl-0.1.45}/edsl/conversation/chips.py +0 -0
  93. {edsl-0.1.44 → edsl-0.1.45}/edsl/conversation/mug_negotiation.py +0 -0
  94. {edsl-0.1.44 → edsl-0.1.45}/edsl/conversation/next_speaker_utilities.py +0 -0
  95. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/ExpectedParrotKeyHandler.py +0 -0
  96. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/PriceFetcher.py +0 -0
  97. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/__init__.py +0 -0
  98. {edsl-0.1.44 → edsl-0.1.45}/edsl/coop/utils.py +0 -0
  99. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/Cache.py +0 -0
  100. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/CacheEntry.py +0 -0
  101. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/CacheHandler.py +0 -0
  102. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/RemoteCacheSync.py +0 -0
  103. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/SQLiteDict.py +0 -0
  104. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/__init__.py +0 -0
  105. {edsl-0.1.44 → edsl-0.1.45}/edsl/data/orm.py +0 -0
  106. {edsl-0.1.44 → edsl-0.1.45}/edsl/data_transfer_models.py +0 -0
  107. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/BaseException.py +0 -0
  108. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/__init__.py +0 -0
  109. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/agents.py +0 -0
  110. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/cache.py +0 -0
  111. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/configuration.py +0 -0
  112. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/coop.py +0 -0
  113. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/data.py +0 -0
  114. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/general.py +0 -0
  115. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/inference_services.py +0 -0
  116. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/jobs.py +0 -0
  117. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/language_models.py +0 -0
  118. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/prompts.py +0 -0
  119. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/questions.py +0 -0
  120. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/results.py +0 -0
  121. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/scenarios.py +0 -0
  122. {edsl-0.1.44 → edsl-0.1.45}/edsl/exceptions/surveys.py +0 -0
  123. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/AvailableModelCacheHandler.py +0 -0
  124. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/DeepInfraService.py +0 -0
  125. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/DeepSeekService.py +0 -0
  126. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/GroqService.py +0 -0
  127. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/InferenceServiceABC.py +0 -0
  128. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/OllamaService.py +0 -0
  129. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/ServiceAvailability.py +0 -0
  130. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/TestService.py +0 -0
  131. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/TogetherAIService.py +0 -0
  132. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/__init__.py +0 -0
  133. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/data_structures.py +0 -0
  134. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/models_available_cache.py +0 -0
  135. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/rate_limits_cache.py +0 -0
  136. {edsl-0.1.44 → edsl-0.1.45}/edsl/inference_services/write_available.py +0 -0
  137. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/AnswerQuestionFunctionConstructor.py +0 -0
  138. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/Answers.py +0 -0
  139. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/FetchInvigilator.py +0 -0
  140. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/InterviewTaskManager.py +0 -0
  141. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/InterviewsConstructor.py +0 -0
  142. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/JobsComponentConstructor.py +0 -0
  143. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/JobsPrompts.py +0 -0
  144. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/JobsRemoteInferenceHandler.py +0 -0
  145. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/JobsRemoteInferenceLogger.py +0 -0
  146. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/RequestTokenEstimator.py +0 -0
  147. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/__init__.py +0 -0
  148. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/buckets/BucketCollection.py +0 -0
  149. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/buckets/ModelBuckets.py +0 -0
  150. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/buckets/TokenBucket.py +0 -0
  151. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/buckets/TokenBucketAPI.py +0 -0
  152. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/buckets/TokenBucketClient.py +0 -0
  153. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/data_structures.py +0 -0
  154. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/decorators.py +0 -0
  155. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/Interview.py +0 -0
  156. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewExceptionCollection.py +0 -0
  157. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewStatistic.py +0 -0
  158. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewStatisticsCollection.py +0 -0
  159. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewStatusDictionary.py +0 -0
  160. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/InterviewStatusLog.py +0 -0
  161. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/ReportErrors.py +0 -0
  162. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/interviews/interview_status_enum.py +0 -0
  163. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/jobs_status_enums.py +0 -0
  164. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/loggers/HTMLTableJobLogger.py +0 -0
  165. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/results_exceptions_handler.py +0 -0
  166. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/runners/JobsRunnerAsyncio.py +0 -0
  167. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/runners/JobsRunnerStatus.py +0 -0
  168. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/runners/JobsRunnerStatusData.py +0 -0
  169. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tasks/QuestionTaskCreator.py +0 -0
  170. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tasks/TaskCreators.py +0 -0
  171. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tasks/TaskStatusLog.py +0 -0
  172. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tasks/task_status_enum.py +0 -0
  173. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tokens/InterviewTokenUsage.py +0 -0
  174. {edsl-0.1.44 → edsl-0.1.45}/edsl/jobs/tokens/TokenUsage.py +0 -0
  175. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/ComputeCost.py +0 -0
  176. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/ModelList.py +0 -0
  177. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/RawResponseHandler.py +0 -0
  178. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/RegisterLanguageModelsMeta.py +0 -0
  179. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/ServiceDataSources.py +0 -0
  180. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/__init__.py +0 -0
  181. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/fake_openai_call.py +0 -0
  182. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/fake_openai_service.py +0 -0
  183. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/key_management/KeyLookup.py +0 -0
  184. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/key_management/KeyLookupBuilder.py +0 -0
  185. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/key_management/KeyLookupCollection.py +0 -0
  186. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/key_management/__init__.py +0 -0
  187. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/key_management/models.py +0 -0
  188. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/repair.py +0 -0
  189. {edsl-0.1.44 → edsl-0.1.45}/edsl/language_models/utilities.py +0 -0
  190. {edsl-0.1.44 → edsl-0.1.45}/edsl/notebooks/Notebook.py +0 -0
  191. {edsl-0.1.44 → edsl-0.1.45}/edsl/notebooks/NotebookToLaTeX.py +0 -0
  192. {edsl-0.1.44 → edsl-0.1.45}/edsl/notebooks/__init__.py +0 -0
  193. {edsl-0.1.44 → edsl-0.1.45}/edsl/prompts/Prompt.py +0 -0
  194. {edsl-0.1.44 → edsl-0.1.45}/edsl/prompts/__init__.py +0 -0
  195. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/ExceptionExplainer.py +0 -0
  196. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/HTMLQuestion.py +0 -0
  197. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionBudget.py +0 -0
  198. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionCheckBox.py +0 -0
  199. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionDict.py +0 -0
  200. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionExtract.py +0 -0
  201. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionFunctional.py +0 -0
  202. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionList.py +0 -0
  203. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionMatrix.py +0 -0
  204. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionMultipleChoice.py +0 -0
  205. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionNumerical.py +0 -0
  206. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/QuestionRank.py +0 -0
  207. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/Quick.py +0 -0
  208. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/SimpleAskMixin.py +0 -0
  209. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/__init__.py +0 -0
  210. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/answer_validator_mixin.py +0 -0
  211. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/compose_questions.py +0 -0
  212. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/data_structures.py +0 -0
  213. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/decorators.py +0 -0
  214. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/derived/QuestionLikertFive.py +0 -0
  215. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/derived/QuestionLinearScale.py +0 -0
  216. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/derived/QuestionTopK.py +0 -0
  217. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/derived/QuestionYesNo.py +0 -0
  218. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/derived/__init__.py +0 -0
  219. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/loop_processor.py +0 -0
  220. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_budget.jinja +0 -0
  221. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_checkbox.jinja +0 -0
  222. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_extract.jinja +0 -0
  223. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_free_text.jinja +0 -0
  224. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_linear_scale.jinja +0 -0
  225. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_list.jinja +0 -0
  226. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_multiple_choice.jinja +0 -0
  227. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/prompt_templates/question_numerical.jinja +0 -0
  228. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/question_registry.py +0 -0
  229. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/register_questions_meta.py +0 -0
  230. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/response_validator_abc.py +0 -0
  231. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/response_validator_factory.py +0 -0
  232. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/settings.py +0 -0
  233. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/__init__.py +0 -0
  234. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/budget/__init__.py +0 -0
  235. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/budget/answering_instructions.jinja +0 -0
  236. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/budget/question_presentation.jinja +0 -0
  237. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/checkbox/__init__.py +0 -0
  238. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/checkbox/answering_instructions.jinja +0 -0
  239. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/checkbox/question_presentation.jinja +0 -0
  240. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/dict/__init__.py +0 -0
  241. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/dict/answering_instructions.jinja +0 -0
  242. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/dict/question_presentation.jinja +0 -0
  243. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/extract/__init__.py +0 -0
  244. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/extract/answering_instructions.jinja +0 -0
  245. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/extract/question_presentation.jinja +0 -0
  246. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/free_text/__init__.py +0 -0
  247. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/free_text/answering_instructions.jinja +0 -0
  248. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/free_text/question_presentation.jinja +0 -0
  249. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/likert_five/__init__.py +0 -0
  250. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/likert_five/answering_instructions.jinja +0 -0
  251. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/likert_five/question_presentation.jinja +0 -0
  252. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/linear_scale/__init__.py +0 -0
  253. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/linear_scale/answering_instructions.jinja +0 -0
  254. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/linear_scale/question_presentation.jinja +0 -0
  255. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/list/__init__.py +0 -0
  256. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/list/answering_instructions.jinja +0 -0
  257. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/list/question_presentation.jinja +0 -0
  258. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/matrix/__init__.py +0 -0
  259. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/matrix/answering_instructions.jinja +0 -0
  260. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/matrix/question_presentation.jinja +0 -0
  261. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/multiple_choice/__init__.py +0 -0
  262. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/multiple_choice/answering_instructions.jinja +0 -0
  263. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/multiple_choice/html.jinja +0 -0
  264. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/multiple_choice/question_presentation.jinja +0 -0
  265. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/numerical/__init__.py +0 -0
  266. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/numerical/answering_instructions.jinja +0 -0
  267. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/numerical/question_presentation.jinja +0 -0
  268. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/rank/__init__.py +0 -0
  269. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/rank/answering_instructions.jinja +0 -0
  270. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/rank/question_presentation.jinja +0 -0
  271. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/top_k/__init__.py +0 -0
  272. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/top_k/answering_instructions.jinja +0 -0
  273. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/top_k/question_presentation.jinja +0 -0
  274. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/yes_no/__init__.py +0 -0
  275. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/yes_no/answering_instructions.jinja +0 -0
  276. {edsl-0.1.44 → edsl-0.1.45}/edsl/questions/templates/yes_no/question_presentation.jinja +0 -0
  277. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/CSSParameterizer.py +0 -0
  278. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/DatasetTree.py +0 -0
  279. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/MarkdownToDocx.py +0 -0
  280. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/MarkdownToPDF.py +0 -0
  281. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/ResultsExportMixin.py +0 -0
  282. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/TableDisplay.py +0 -0
  283. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/TextEditor.py +0 -0
  284. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/__init__.py +0 -0
  285. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/file_exports.py +0 -0
  286. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/results_fetch_mixin.py +0 -0
  287. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/results_selector.py +0 -0
  288. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/results_tools_mixin.py +0 -0
  289. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/smart_objects.py +0 -0
  290. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/table_data_class.py +0 -0
  291. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/table_display.css +0 -0
  292. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/table_renderers.py +0 -0
  293. {edsl-0.1.44 → edsl-0.1.45}/edsl/results/tree_explore.py +0 -0
  294. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/ConstructDownloadLink.py +0 -0
  295. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/DocxScenario.py +0 -0
  296. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/ScenarioHtmlMixin.py +0 -0
  297. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/ScenarioListExportMixin.py +0 -0
  298. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/ScenarioListPdfMixin.py +0 -0
  299. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/__init__.py +0 -0
  300. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/directory_scanner.py +0 -0
  301. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/file_methods.py +0 -0
  302. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/csv.py +0 -0
  303. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/html.py +0 -0
  304. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/json.py +0 -0
  305. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/latex.py +0 -0
  306. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/md.py +0 -0
  307. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/pdf.py +0 -0
  308. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/png.py +0 -0
  309. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/pptx.py +0 -0
  310. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/py.py +0 -0
  311. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/sql.py +0 -0
  312. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/sqlite.py +0 -0
  313. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/handlers/txt.py +0 -0
  314. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/scenario_join.py +0 -0
  315. {edsl-0.1.44 → edsl-0.1.45}/edsl/scenarios/scenario_selector.py +0 -0
  316. {edsl-0.1.44 → edsl-0.1.45}/edsl/shared.py +0 -0
  317. {edsl-0.1.44 → edsl-0.1.45}/edsl/study/ObjectEntry.py +0 -0
  318. {edsl-0.1.44 → edsl-0.1.45}/edsl/study/ProofOfWork.py +0 -0
  319. {edsl-0.1.44 → edsl-0.1.45}/edsl/study/SnapShot.py +0 -0
  320. {edsl-0.1.44 → edsl-0.1.45}/edsl/study/Study.py +0 -0
  321. {edsl-0.1.44 → edsl-0.1.45}/edsl/study/__init__.py +0 -0
  322. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/ConstructDAG.py +0 -0
  323. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/DAG.py +0 -0
  324. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/EditSurvey.py +0 -0
  325. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/InstructionHandler.py +0 -0
  326. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/Memory.py +0 -0
  327. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/MemoryManagement.py +0 -0
  328. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/MemoryPlan.py +0 -0
  329. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/Rule.py +0 -0
  330. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/RuleCollection.py +0 -0
  331. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/RuleManager.py +0 -0
  332. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/Simulator.py +0 -0
  333. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/SurveyCSS.py +0 -0
  334. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/SurveyExportMixin.py +0 -0
  335. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/SurveyQualtricsImport.py +0 -0
  336. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/SurveyToApp.py +0 -0
  337. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/__init__.py +0 -0
  338. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/base.py +0 -0
  339. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/descriptors.py +0 -0
  340. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/instructions/ChangeInstruction.py +0 -0
  341. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/instructions/Instruction.py +0 -0
  342. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/instructions/InstructionCollection.py +0 -0
  343. {edsl-0.1.44 → edsl-0.1.45}/edsl/surveys/instructions/__init__.py +0 -0
  344. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/base.html +0 -0
  345. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/exceptions_by_model.html +0 -0
  346. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/exceptions_by_question_name.html +0 -0
  347. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/exceptions_by_type.html +0 -0
  348. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/report.html +0 -0
  349. {edsl-0.1.44 → edsl-0.1.45}/edsl/templates/error_reporting/report.js +0 -0
  350. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/__init__.py +0 -0
  351. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/clusters.py +0 -0
  352. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/embeddings.py +0 -0
  353. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/embeddings_plotting.py +0 -0
  354. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/plotting.py +0 -0
  355. {edsl-0.1.44 → edsl-0.1.45}/edsl/tools/summarize.py +0 -0
  356. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/SystemInfo.py +0 -0
  357. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/__init__.py +0 -0
  358. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/ast_utilities.py +0 -0
  359. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/data/Registry.py +0 -0
  360. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/data/__init__.py +0 -0
  361. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/data/scooter_results.json +0 -0
  362. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/decorators.py +0 -0
  363. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/gcp_bucket/__init__.py +0 -0
  364. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/gcp_bucket/cloud_storage.py +0 -0
  365. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/interface.py +0 -0
  366. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/is_notebook.py +0 -0
  367. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/is_valid_variable_name.py +0 -0
  368. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/naming_utilities.py +0 -0
  369. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/remove_edsl_version.py +0 -0
  370. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/repair_functions.py +0 -0
  371. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/restricted_python.py +0 -0
  372. {edsl-0.1.44 → edsl-0.1.45}/edsl/utilities/utilities.py +0 -0
edsl-0.1.45/PKG-INFO ADDED
@@ -0,0 +1,246 @@
1
+ Metadata-Version: 2.1
2
+ Name: edsl
3
+ Version: 0.1.45
4
+ Summary: Create and analyze LLM-based surveys
5
+ Home-page: https://www.expectedparrot.com/
6
+ License: MIT
7
+ Keywords: LLM,social science,surveys,user research
8
+ Author: John Horton
9
+ Author-email: info@expectedparrot.com
10
+ Requires-Python: >=3.9.1,<3.13
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
18
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
19
+ Requires-Dist: aiohttp (>=3.9.1,<4.0.0)
20
+ Requires-Dist: anthropic (>=0.45.0,<0.46.0)
21
+ Requires-Dist: azure-ai-inference (>=1.0.0b3,<2.0.0)
22
+ Requires-Dist: black[jupyter] (>=24.4.2,<25.0.0)
23
+ Requires-Dist: boto3 (>=1.34.161,<2.0.0)
24
+ Requires-Dist: google-generativeai (>=0.8.2,<0.9.0)
25
+ Requires-Dist: groq (>=0.9.0,<0.10.0)
26
+ Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
27
+ Requires-Dist: json-repair (>=0.28.4,<0.29.0)
28
+ Requires-Dist: jupyter (>=1.0.0,<2.0.0)
29
+ Requires-Dist: markdown2 (>=2.4.11,<3.0.0)
30
+ Requires-Dist: matplotlib (>=3.8,<3.9)
31
+ Requires-Dist: mistralai (>=1.0.2,<2.0.0)
32
+ Requires-Dist: nest-asyncio (>=1.5.9,<2.0.0)
33
+ Requires-Dist: numpy (>=1.22,<2.0)
34
+ Requires-Dist: openai (>=1.4.0,<2.0.0)
35
+ Requires-Dist: openpyxl (>=3.1.5,<4.0.0)
36
+ Requires-Dist: pandas (>=2.1.4,<3.0.0)
37
+ Requires-Dist: platformdirs (>=4.3.6,<5.0.0)
38
+ Requires-Dist: pydot (>=2.0.0,<3.0.0)
39
+ Requires-Dist: pygments (>=2.17.2,<3.0.0)
40
+ Requires-Dist: pypdf2 (>=3.0.1,<4.0.0)
41
+ Requires-Dist: pyreadstat (>=1.2.7,<2.0.0)
42
+ Requires-Dist: python-docx (>=1.1.0,<2.0.0)
43
+ Requires-Dist: python-dotenv (>=1.0.0,<2.0.0)
44
+ Requires-Dist: python-pptx (>=1.0.2,<2.0.0)
45
+ Requires-Dist: restrictedpython (>=7.1,<8.0)
46
+ Requires-Dist: rich (>=13.7.0,<14.0.0)
47
+ Requires-Dist: setuptools (<72.0)
48
+ Requires-Dist: simpleeval (>=0.9.13,<0.10.0)
49
+ Requires-Dist: sqlalchemy (>=2.0.23,<3.0.0)
50
+ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
51
+ Requires-Dist: tenacity (>=8.2.3,<9.0.0)
52
+ Requires-Dist: urllib3 (>=1.25.4,<1.27)
53
+ Project-URL: Documentation, https://docs.expectedparrot.com
54
+ Description-Content-Type: text/markdown
55
+
56
+ # Expected Parrot Domain-Specific Language (EDSL)
57
+
58
+ The Expected Parrot Domain-Specific Language (EDSL) package makes it easy to conduct computational social science and market research with AI. Use it to design surveys and experiments, collect responses from humans and large language models, and perform data labeling and many other research tasks. Results are formatted as specified datasets and come with built-in methods for analyzing, visualizing and sharing.
59
+
60
+ <p align="right">
61
+ <img src="https://github.com/expectedparrot/edsl/blob/main/static/logo.png?raw=true" alt="edsl.png" width="100"/>
62
+ </p>
63
+
64
+ ## Features
65
+
66
+ **Declarative design**:
67
+ Specified <a href="https://docs.expectedparrot.con/en/latest/questions.html" target="_blank" rel="noopener noreferrer">question types</a> ensure consistent results without requiring a JSON schema (<a href="https://www.expectedparrot.com/content/2a848a0e-f9de-46bc-98d0-a13b9a1caf11" target="_blank" rel="noopener noreferrer">view at Coop</a>):
68
+
69
+ ```python
70
+ from edsl import QuestionMultipleChoice
71
+
72
+ q = QuestionMultipleChoice(
73
+ question_name = "example",
74
+ question_text = "How do you feel today?",
75
+ question_options = ["Bad", "OK", "Good"]
76
+ )
77
+
78
+ results = q.run()
79
+
80
+ results.select("example")
81
+ ```
82
+
83
+ > | answer.example |
84
+ > |-----------------|
85
+ > | Good |
86
+
87
+ <br>
88
+
89
+ **Parameterized prompts**:
90
+ Easily parameterize and control prompts with "<a href="https://docs.expectedparrot.com/en/latest/scenarios.html" target="_blank" rel="noopener noreferrer">scenarios</a>" of data automatically imported from many sources (CSV, PDF, PNG, etc.)(<a href="https://www.expectedparrot.com/content/7bb9ec2e-827b-4867-ac02-33163df1a1d1" target="_blank" rel="noopener noreferrer">view at Coop</a>):
91
+
92
+ ```python
93
+ from edsl import ScenarioList, QuestionLinearScale
94
+
95
+ q = QuestionLinearScale(
96
+ question_name = "example",
97
+ question_text = "How much do you enjoy {{ activity }}?",
98
+ question_options = [1,2,3,4,5,],
99
+ option_labels = {1:"Not at all", 5:"Very much"}
100
+ )
101
+
102
+ sl = ScenarioList.from_list("activity", ["coding", "sleeping"])
103
+
104
+ results = q.by(sl).run()
105
+
106
+ results.select("activity", "example")
107
+ ```
108
+
109
+ > | scenario.activity | answer.example |
110
+ > |--------------------|-----------------|
111
+ > | Coding | 5 |
112
+ > | Sleeping | 5 |
113
+
114
+ <br>
115
+
116
+ **Design AI agent personas to answer questions**:
117
+ Construct agents with relevant traits to provide diverse responses to your surveys (<a href="https://www.expectedparrot.com/content/b639a2d7-4ae6-48fe-8b9e-58350fab93de" target="_blank" rel="noopener noreferrer">view at Coop</a>)
118
+
119
+ ```python
120
+ from edsl import Agent, AgentList, QuestionList
121
+
122
+ al = AgentList(Agent(traits = {"persona":p}) for p in ["botanist", "detective"])
123
+
124
+ q = QuestionList(
125
+ question_name = "example",
126
+ question_text = "What are your favorite colors?",
127
+ max_list_items = 3
128
+ )
129
+
130
+ results = q.by(al).run()
131
+
132
+ results.select("persona", "example")
133
+ ```
134
+
135
+ > | agent.persona | answer.example |
136
+ > |----------------|---------------------------------------------|
137
+ > | botanist | ['Green', 'Earthy Brown', 'Sunset Orange'] |
138
+ > | detective | ['Gray', 'Black', 'Navy Blye'] |
139
+
140
+ <br>
141
+
142
+ **Simplified access to LLMs**:
143
+ Choose whether to use your own keys for LLMs, or access all <a href="https://www.expectedparrot.com/getting-started/coop-pricing" target="_blank" rel="noopener noreferrer">available models</a> with an Expected Parrot API key. Run surveys with many models at once and compare responses at a convenient inferface (<a href="https://www.expectedparrot.com/content/044465f0-b87f-430d-a3b9-4fd3b8560299" target="_blank" rel="noopener noreferrer">view at Coop</a>)
144
+
145
+ ```python
146
+ from edsl import Model, ModelList, QuestionFreeText
147
+
148
+ ml = ModelList(Model(m) for m in ["gpt-4o", "gemini-1.5-flash"])
149
+
150
+ q = QuestionFreeText(
151
+ question_name = "example",
152
+ question_text = "What is your top tip for using LLMs to answer surveys?"
153
+ )
154
+
155
+ results = q.by(ml).run()
156
+
157
+ results.select("model", "example")
158
+ ```
159
+
160
+ > | model.model | answer.example |
161
+ > |--------------------|-------------------------------------------------------------------------------------------------|
162
+ > | gpt-4o | When using large language models (LLMs) to answer surveys, my top tip is to ensure that the ... |
163
+ > | gemini-1.5-flash | My top tip for using LLMs to answer surveys is to **treat the LLM as a sophisticated brainst... |
164
+
165
+ <br>
166
+
167
+ **Piping & skip-logic**:
168
+ Build rich data labeling flows with features for piping answers and adding survey logic such as skip and stop rules (<a href="https://www.expectedparrot.com/content/b8afe09d-49bf-4c05-b753-d7b0ae782eb3" target="_blank" rel="noopener noreferrer">view at Coop</a>):
169
+
170
+ ```python
171
+ from edsl import QuestionMultipleChoice, QuestionFreeText, Survey
172
+
173
+ q1 = QuestionMultipleChoice(
174
+ question_name = "color",
175
+ question_text = "What is your favorite primary color?",
176
+ question_options = ["red", "yellow", "blue"]
177
+ )
178
+
179
+ q2 = QuestionFreeText(
180
+ question_name = "flower",
181
+ question_text = "Name a flower that is {{ color.answer }}."
182
+ )
183
+
184
+ survey = Survey(questions = [q1, q2])
185
+
186
+ results = survey.run()
187
+
188
+ results.select("color", "flower")
189
+ ```
190
+
191
+ > | answer.color | answer.flower |
192
+ > |---------------|-----------------------------------------------------------------------------------|
193
+ > | blue | A commonly known blue flower is the bluebell. Another example is the cornflower. |
194
+
195
+ <br>
196
+
197
+ **Caching**:
198
+ API calls to LLMs are cached automatically, allowing you to retrieve responses to questions that have already been run and reproduce experiments at no cost. Learn more about how the <a href="https://docs.expectedparrot.com/en/latest/remote_caching.html" target="_blank" rel="noopener noreferrer">universal remote cache</a> works.
199
+
200
+ **Flexibility**:
201
+ Choose whether to run surveys on your own computer or at the Expected Parrot server.
202
+
203
+ **Tools for collaboration**:
204
+ Easily share workflows and projects privately or publicly at Coop: an integrated platform for AI-based research. Your account comes with free credits for running surveys, and lets you securely share keys, track expenses and usage for your team.
205
+
206
+ **Built-in tools for analyis**:
207
+ Analyze results as specified datasets from your account or workspace. Easily import data to use with your surveys and export results.
208
+
209
+ ## Getting started
210
+
211
+ 1. Run `pip install edsl` to install the package.
212
+
213
+ 2. <a href="https://www.expectedparrot.com/login" target="_blank" rel="noopener noreferrer">Create an account</a> to run surveys at the Expected Parrot server and access a <a href="https://docs.expectedparrot.com/en/latest/remote_caching.html" target="_blank" rel="noopener noreferrer">universal remote cache</a> of stored responses for reproducing results.
214
+
215
+ 3. Choose whether to use your own keys for language models or get an Expected Parrot key to access all available models at once. Securely <a href="https://docs.expectedparrot.com/en/latest/api_keys.html" target="_blank" rel="noopener noreferrer">manage keys</a>, share expenses and track usage for your team from your account.
216
+
217
+ 4. Run the <a href="https://docs.expectedparrot.com/en/latest/starter_tutorial.html" target="_blank" rel="noopener noreferrer">starter tutorial</a> and explore other demo notebooks.
218
+
219
+ 5. Share workflows and survey results at <a href="https://www.expectedparrot.com/content/explore" target="_blank" rel="noopener noreferrer">Coop</a>
220
+
221
+ 6. Join our <a href="https://discord.com/invite/mxAYkjfy9m" target="_blank" rel="noopener noreferrer">Discord</a> for updates and discussions! Request new features!
222
+
223
+ ## Code & Docs
224
+ - <a href="https://pypi.org/project/edsl/" target="_blank" rel="noopener noreferrer">PyPI</a>
225
+ - <a href="https://github.com/expectedparrot/edsl" target="_blank" rel="noopener noreferrer">GitHub</a>
226
+ - <a href="https://docs.expectedparrot.com" target="_blank" rel="noopener noreferrer">Documentation</a>
227
+
228
+ ## Requirements
229
+ - Python 3.9 - 3.12
230
+ - API keys for language models. You can use your own keys or an Expected Parrot key that provides access to all available models.
231
+ See instructions on <a href="https://docs.expectedparrot.com/en/latest/api_keys.html" target="_blank" rel="noopener noreferrer">managing keys</a> and <a href="https://www.expectedparrot.com/getting-started/coop-pricing" target="_blank" rel="noopener noreferrer">model pricing and performance</a> information.
232
+
233
+ ## Coop
234
+ An integrated platform for running experiments, sharing workflows and launching hybrid human/AI surveys.
235
+ - <a href="https://www.expectedparrot.com/login" target="_blank" rel="noopener noreferrer">Login / Signup</a>
236
+ - <a href="https://www.expectedparrot.com/content/explore" target="_blank" rel="noopener noreferrer">Explore</a>
237
+
238
+ ## Community
239
+ - <a href="https://discord.com/invite/mxAYkjfy9m" target="_blank" rel="noopener noreferrer">Discord</a>
240
+ - <a href="https://x.com/ExpectedParrot" target="_blank" rel="noopener noreferrer">Twitter</a>
241
+ - <a href="https://www.linkedin.com/company/expectedparrot/" target="_blank" rel="noopener noreferrer">LinkedIn</a>
242
+ - <a href="https://blog.expectedparrot.com" target="_blank" rel="noopener noreferrer">Blog</a>
243
+
244
+ ## Contact
245
+ - <a href="mailto:info@expectedparrot.com" target="_blank" rel="noopener noreferrer">Email</a>.
246
+
edsl-0.1.45/README.md ADDED
@@ -0,0 +1,190 @@
1
+ # Expected Parrot Domain-Specific Language (EDSL)
2
+
3
+ The Expected Parrot Domain-Specific Language (EDSL) package makes it easy to conduct computational social science and market research with AI. Use it to design surveys and experiments, collect responses from humans and large language models, and perform data labeling and many other research tasks. Results are formatted as specified datasets and come with built-in methods for analyzing, visualizing and sharing.
4
+
5
+ <p align="right">
6
+ <img src="https://github.com/expectedparrot/edsl/blob/main/static/logo.png?raw=true" alt="edsl.png" width="100"/>
7
+ </p>
8
+
9
+ ## Features
10
+
11
+ **Declarative design**:
12
+ Specified <a href="https://docs.expectedparrot.con/en/latest/questions.html" target="_blank" rel="noopener noreferrer">question types</a> ensure consistent results without requiring a JSON schema (<a href="https://www.expectedparrot.com/content/2a848a0e-f9de-46bc-98d0-a13b9a1caf11" target="_blank" rel="noopener noreferrer">view at Coop</a>):
13
+
14
+ ```python
15
+ from edsl import QuestionMultipleChoice
16
+
17
+ q = QuestionMultipleChoice(
18
+ question_name = "example",
19
+ question_text = "How do you feel today?",
20
+ question_options = ["Bad", "OK", "Good"]
21
+ )
22
+
23
+ results = q.run()
24
+
25
+ results.select("example")
26
+ ```
27
+
28
+ > | answer.example |
29
+ > |-----------------|
30
+ > | Good |
31
+
32
+ <br>
33
+
34
+ **Parameterized prompts**:
35
+ Easily parameterize and control prompts with "<a href="https://docs.expectedparrot.com/en/latest/scenarios.html" target="_blank" rel="noopener noreferrer">scenarios</a>" of data automatically imported from many sources (CSV, PDF, PNG, etc.)(<a href="https://www.expectedparrot.com/content/7bb9ec2e-827b-4867-ac02-33163df1a1d1" target="_blank" rel="noopener noreferrer">view at Coop</a>):
36
+
37
+ ```python
38
+ from edsl import ScenarioList, QuestionLinearScale
39
+
40
+ q = QuestionLinearScale(
41
+ question_name = "example",
42
+ question_text = "How much do you enjoy {{ activity }}?",
43
+ question_options = [1,2,3,4,5,],
44
+ option_labels = {1:"Not at all", 5:"Very much"}
45
+ )
46
+
47
+ sl = ScenarioList.from_list("activity", ["coding", "sleeping"])
48
+
49
+ results = q.by(sl).run()
50
+
51
+ results.select("activity", "example")
52
+ ```
53
+
54
+ > | scenario.activity | answer.example |
55
+ > |--------------------|-----------------|
56
+ > | Coding | 5 |
57
+ > | Sleeping | 5 |
58
+
59
+ <br>
60
+
61
+ **Design AI agent personas to answer questions**:
62
+ Construct agents with relevant traits to provide diverse responses to your surveys (<a href="https://www.expectedparrot.com/content/b639a2d7-4ae6-48fe-8b9e-58350fab93de" target="_blank" rel="noopener noreferrer">view at Coop</a>)
63
+
64
+ ```python
65
+ from edsl import Agent, AgentList, QuestionList
66
+
67
+ al = AgentList(Agent(traits = {"persona":p}) for p in ["botanist", "detective"])
68
+
69
+ q = QuestionList(
70
+ question_name = "example",
71
+ question_text = "What are your favorite colors?",
72
+ max_list_items = 3
73
+ )
74
+
75
+ results = q.by(al).run()
76
+
77
+ results.select("persona", "example")
78
+ ```
79
+
80
+ > | agent.persona | answer.example |
81
+ > |----------------|---------------------------------------------|
82
+ > | botanist | ['Green', 'Earthy Brown', 'Sunset Orange'] |
83
+ > | detective | ['Gray', 'Black', 'Navy Blye'] |
84
+
85
+ <br>
86
+
87
+ **Simplified access to LLMs**:
88
+ Choose whether to use your own keys for LLMs, or access all <a href="https://www.expectedparrot.com/getting-started/coop-pricing" target="_blank" rel="noopener noreferrer">available models</a> with an Expected Parrot API key. Run surveys with many models at once and compare responses at a convenient inferface (<a href="https://www.expectedparrot.com/content/044465f0-b87f-430d-a3b9-4fd3b8560299" target="_blank" rel="noopener noreferrer">view at Coop</a>)
89
+
90
+ ```python
91
+ from edsl import Model, ModelList, QuestionFreeText
92
+
93
+ ml = ModelList(Model(m) for m in ["gpt-4o", "gemini-1.5-flash"])
94
+
95
+ q = QuestionFreeText(
96
+ question_name = "example",
97
+ question_text = "What is your top tip for using LLMs to answer surveys?"
98
+ )
99
+
100
+ results = q.by(ml).run()
101
+
102
+ results.select("model", "example")
103
+ ```
104
+
105
+ > | model.model | answer.example |
106
+ > |--------------------|-------------------------------------------------------------------------------------------------|
107
+ > | gpt-4o | When using large language models (LLMs) to answer surveys, my top tip is to ensure that the ... |
108
+ > | gemini-1.5-flash | My top tip for using LLMs to answer surveys is to **treat the LLM as a sophisticated brainst... |
109
+
110
+ <br>
111
+
112
+ **Piping & skip-logic**:
113
+ Build rich data labeling flows with features for piping answers and adding survey logic such as skip and stop rules (<a href="https://www.expectedparrot.com/content/b8afe09d-49bf-4c05-b753-d7b0ae782eb3" target="_blank" rel="noopener noreferrer">view at Coop</a>):
114
+
115
+ ```python
116
+ from edsl import QuestionMultipleChoice, QuestionFreeText, Survey
117
+
118
+ q1 = QuestionMultipleChoice(
119
+ question_name = "color",
120
+ question_text = "What is your favorite primary color?",
121
+ question_options = ["red", "yellow", "blue"]
122
+ )
123
+
124
+ q2 = QuestionFreeText(
125
+ question_name = "flower",
126
+ question_text = "Name a flower that is {{ color.answer }}."
127
+ )
128
+
129
+ survey = Survey(questions = [q1, q2])
130
+
131
+ results = survey.run()
132
+
133
+ results.select("color", "flower")
134
+ ```
135
+
136
+ > | answer.color | answer.flower |
137
+ > |---------------|-----------------------------------------------------------------------------------|
138
+ > | blue | A commonly known blue flower is the bluebell. Another example is the cornflower. |
139
+
140
+ <br>
141
+
142
+ **Caching**:
143
+ API calls to LLMs are cached automatically, allowing you to retrieve responses to questions that have already been run and reproduce experiments at no cost. Learn more about how the <a href="https://docs.expectedparrot.com/en/latest/remote_caching.html" target="_blank" rel="noopener noreferrer">universal remote cache</a> works.
144
+
145
+ **Flexibility**:
146
+ Choose whether to run surveys on your own computer or at the Expected Parrot server.
147
+
148
+ **Tools for collaboration**:
149
+ Easily share workflows and projects privately or publicly at Coop: an integrated platform for AI-based research. Your account comes with free credits for running surveys, and lets you securely share keys, track expenses and usage for your team.
150
+
151
+ **Built-in tools for analyis**:
152
+ Analyze results as specified datasets from your account or workspace. Easily import data to use with your surveys and export results.
153
+
154
+ ## Getting started
155
+
156
+ 1. Run `pip install edsl` to install the package.
157
+
158
+ 2. <a href="https://www.expectedparrot.com/login" target="_blank" rel="noopener noreferrer">Create an account</a> to run surveys at the Expected Parrot server and access a <a href="https://docs.expectedparrot.com/en/latest/remote_caching.html" target="_blank" rel="noopener noreferrer">universal remote cache</a> of stored responses for reproducing results.
159
+
160
+ 3. Choose whether to use your own keys for language models or get an Expected Parrot key to access all available models at once. Securely <a href="https://docs.expectedparrot.com/en/latest/api_keys.html" target="_blank" rel="noopener noreferrer">manage keys</a>, share expenses and track usage for your team from your account.
161
+
162
+ 4. Run the <a href="https://docs.expectedparrot.com/en/latest/starter_tutorial.html" target="_blank" rel="noopener noreferrer">starter tutorial</a> and explore other demo notebooks.
163
+
164
+ 5. Share workflows and survey results at <a href="https://www.expectedparrot.com/content/explore" target="_blank" rel="noopener noreferrer">Coop</a>
165
+
166
+ 6. Join our <a href="https://discord.com/invite/mxAYkjfy9m" target="_blank" rel="noopener noreferrer">Discord</a> for updates and discussions! Request new features!
167
+
168
+ ## Code & Docs
169
+ - <a href="https://pypi.org/project/edsl/" target="_blank" rel="noopener noreferrer">PyPI</a>
170
+ - <a href="https://github.com/expectedparrot/edsl" target="_blank" rel="noopener noreferrer">GitHub</a>
171
+ - <a href="https://docs.expectedparrot.com" target="_blank" rel="noopener noreferrer">Documentation</a>
172
+
173
+ ## Requirements
174
+ - Python 3.9 - 3.12
175
+ - API keys for language models. You can use your own keys or an Expected Parrot key that provides access to all available models.
176
+ See instructions on <a href="https://docs.expectedparrot.com/en/latest/api_keys.html" target="_blank" rel="noopener noreferrer">managing keys</a> and <a href="https://www.expectedparrot.com/getting-started/coop-pricing" target="_blank" rel="noopener noreferrer">model pricing and performance</a> information.
177
+
178
+ ## Coop
179
+ An integrated platform for running experiments, sharing workflows and launching hybrid human/AI surveys.
180
+ - <a href="https://www.expectedparrot.com/login" target="_blank" rel="noopener noreferrer">Login / Signup</a>
181
+ - <a href="https://www.expectedparrot.com/content/explore" target="_blank" rel="noopener noreferrer">Explore</a>
182
+
183
+ ## Community
184
+ - <a href="https://discord.com/invite/mxAYkjfy9m" target="_blank" rel="noopener noreferrer">Discord</a>
185
+ - <a href="https://x.com/ExpectedParrot" target="_blank" rel="noopener noreferrer">Twitter</a>
186
+ - <a href="https://www.linkedin.com/company/expectedparrot/" target="_blank" rel="noopener noreferrer">LinkedIn</a>
187
+ - <a href="https://blog.expectedparrot.com" target="_blank" rel="noopener noreferrer">Blog</a>
188
+
189
+ ## Contact
190
+ - <a href="mailto:info@expectedparrot.com" target="_blank" rel="noopener noreferrer">Email</a>.
@@ -0,0 +1 @@
1
+ __version__ = "0.1.45"
@@ -74,7 +74,7 @@ class InvigilatorBase(ABC):
74
74
  @property
75
75
  def prompt_constructor(self) -> PromptConstructor:
76
76
  """Return the prompt constructor."""
77
- return PromptConstructor(self, prompt_plan=self.prompt_plan)
77
+ return PromptConstructor.from_invigilator(self, prompt_plan=self.prompt_plan)
78
78
 
79
79
  def to_dict(self, include_cache=False) -> Dict[str, Any]:
80
80
  attributes = [
@@ -87,6 +87,7 @@ class InvigilatorBase(ABC):
87
87
  "iteration",
88
88
  "additional_prompt_data",
89
89
  "survey",
90
+ "raw_model_response",
90
91
  ]
91
92
  if include_cache:
92
93
  attributes.append("cache")
@@ -135,6 +136,7 @@ class InvigilatorBase(ABC):
135
136
  d["additional_prompt_data"] = data["additional_prompt_data"]
136
137
 
137
138
  d = cls(**d)
139
+ d.raw_model_response = data.get("raw_model_response")
138
140
  return d
139
141
 
140
142
  def __repr__(self) -> str:
@@ -71,24 +71,49 @@ class PromptConstructor:
71
71
  - The question instructions - "You are being asked the following question: Do you like school? The options are 0: yes 1: no Return a valid JSON formatted like this, selecting only the number of the option: {"answer": <put answer code here>, "comment": "<put explanation here>"} Only 1 option may be selected."
72
72
  - The memory prompt - "Before the question you are now answering, you already answered the following question(s): Question: Do you like school? Answer: Prior answer"
73
73
  """
74
+ @classmethod
75
+ def from_invigilator(
76
+ cls,
77
+ invigilator: "InvigilatorBase",
78
+ prompt_plan: Optional["PromptPlan"] = None
79
+ ) -> "PromptConstructor":
80
+ return cls(
81
+ agent=invigilator.agent,
82
+ question=invigilator.question,
83
+ scenario=invigilator.scenario,
84
+ survey=invigilator.survey,
85
+ model=invigilator.model,
86
+ current_answers=invigilator.current_answers,
87
+ memory_plan=invigilator.memory_plan,
88
+ prompt_plan=prompt_plan
89
+ )
74
90
 
75
91
  def __init__(
76
- self, invigilator: "InvigilatorBase", prompt_plan: Optional["PromptPlan"] = None
92
+ self,
93
+ agent: "Agent",
94
+ question: "QuestionBase",
95
+ scenario: "Scenario",
96
+ survey: "Survey",
97
+ model: "LanguageModel",
98
+ current_answers: dict,
99
+ memory_plan: "MemoryPlan",
100
+ prompt_plan: Optional["PromptPlan"] = None
77
101
  ):
78
- self.invigilator = invigilator
102
+ self.agent = agent
103
+ self.question = question
104
+ self.scenario = scenario
105
+ self.survey = survey
106
+ self.model = model
107
+ self.current_answers = current_answers
108
+ self.memory_plan = memory_plan
79
109
  self.prompt_plan = prompt_plan or PromptPlan()
80
110
 
81
- self.agent = invigilator.agent
82
- self.question = invigilator.question
83
- self.scenario = invigilator.scenario
84
- self.survey = invigilator.survey
85
- self.model = invigilator.model
86
- self.current_answers = invigilator.current_answers
87
- self.memory_plan = invigilator.memory_plan
88
-
89
- def get_question_options(self, question_data):
111
+ def get_question_options(self, question_data: dict) -> list[str]:
90
112
  """Get the question options."""
91
- return QuestionOptionProcessor(self).get_question_options(question_data)
113
+ return (QuestionOptionProcessor
114
+ .from_prompt_constructor(self)
115
+ .get_question_options(question_data)
116
+ )
92
117
 
93
118
  @cached_property
94
119
  def agent_instructions_prompt(self) -> Prompt:
@@ -198,9 +223,10 @@ class PromptConstructor:
198
223
  @cached_property
199
224
  def question_file_keys(self) -> list:
200
225
  """Extracts the file keys from the question text.
226
+
201
227
  It checks if the variables in the question text are in the scenario file keys.
202
228
  """
203
- return QuestionTemplateReplacementsBuilder(self).question_file_keys()
229
+ return QuestionTemplateReplacementsBuilder.from_prompt_constructor(self).question_file_keys()
204
230
 
205
231
  @cached_property
206
232
  def question_instructions_prompt(self) -> Prompt:
@@ -219,7 +245,7 @@ class PromptConstructor:
219
245
  QuestionInstructionPromptBuilder,
220
246
  )
221
247
 
222
- return QuestionInstructionPromptBuilder(self).build()
248
+ return QuestionInstructionPromptBuilder.from_prompt_constructor(self).build()
223
249
 
224
250
  @cached_property
225
251
  def prior_question_memory_prompt(self) -> Prompt:
@@ -287,30 +313,32 @@ class PromptConstructor:
287
313
  arranged = self.prompt_plan.arrange_components(**components)
288
314
 
289
315
  if parallel == "process":
290
- ctx = get_context('fork')
291
- with ctx.Pool() as pool:
292
- results = pool.map(_process_prompt, [
293
- (arranged["user_prompt"], {}),
294
- (arranged["system_prompt"], {})
295
- ])
296
- prompts = {
297
- "user_prompt": results[0],
298
- "system_prompt": results[1]
299
- }
316
+ pass
317
+ # ctx = get_context('fork')
318
+ # with ctx.Pool() as pool:
319
+ # results = pool.map(_process_prompt, [
320
+ # (arranged["user_prompt"], {}),
321
+ # (arranged["system_prompt"], {})
322
+ # ])
323
+ # prompts = {
324
+ # "user_prompt": results[0],
325
+ # "system_prompt": results[1]
326
+ # }
300
327
 
301
328
  elif parallel == "thread":
302
- with ThreadPoolExecutor() as executor:
303
- user_prompt_list = arranged["user_prompt"]
304
- system_prompt_list = arranged["system_prompt"]
329
+ pass
330
+ # with ThreadPoolExecutor() as executor:
331
+ # user_prompt_list = arranged["user_prompt"]
332
+ # system_prompt_list = arranged["system_prompt"]
305
333
 
306
- # Process both prompt lists in parallel
307
- rendered_user = executor.submit(_process_prompt, (user_prompt_list, {}))
308
- rendered_system = executor.submit(_process_prompt, (system_prompt_list, {}))
334
+ # # Process both prompt lists in parallel
335
+ # rendered_user = executor.submit(_process_prompt, (user_prompt_list, {}))
336
+ # rendered_system = executor.submit(_process_prompt, (system_prompt_list, {}))
309
337
 
310
- prompts = {
311
- "user_prompt": rendered_user.result(),
312
- "system_prompt": rendered_system.result()
313
- }
338
+ # prompts = {
339
+ # "user_prompt": rendered_user.result(),
340
+ # "system_prompt": rendered_system.result()
341
+ # }
314
342
 
315
343
  else: # sequential processing
316
344
  prompts = self.prompt_plan.get_prompts(**components)