edsl 0.1.46__py3-none-any.whl → 0.1.47__py3-none-any.whl
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.
- edsl/Base.py +86 -19
- edsl/__version__.py +1 -1
- edsl/coop/coop.py +134 -53
- edsl/data/Cache.py +2 -0
- edsl/data/CacheEntry.py +10 -2
- edsl/inference_services/PerplexityService.py +9 -5
- edsl/jobs/Jobs.py +20 -0
- edsl/jobs/JobsComponentConstructor.py +2 -1
- edsl/language_models/LanguageModel.py +6 -6
- edsl/questions/QuestionBase.py +5 -0
- edsl/questions/question_registry.py +6 -7
- edsl/results/DatasetExportMixin.py +99 -2
- edsl/results/Results.py +59 -0
- edsl/scenarios/FileStore.py +112 -7
- edsl/scenarios/ScenarioList.py +130 -0
- edsl/study/Study.py +2 -2
- edsl/surveys/Survey.py +15 -20
- {edsl-0.1.46.dist-info → edsl-0.1.47.dist-info}/METADATA +3 -2
- {edsl-0.1.46.dist-info → edsl-0.1.47.dist-info}/RECORD +21 -33
- edsl/auto/AutoStudy.py +0 -130
- edsl/auto/StageBase.py +0 -243
- edsl/auto/StageGenerateSurvey.py +0 -178
- edsl/auto/StageLabelQuestions.py +0 -125
- edsl/auto/StagePersona.py +0 -61
- edsl/auto/StagePersonaDimensionValueRanges.py +0 -88
- edsl/auto/StagePersonaDimensionValues.py +0 -74
- edsl/auto/StagePersonaDimensions.py +0 -69
- edsl/auto/StageQuestions.py +0 -74
- edsl/auto/SurveyCreatorPipeline.py +0 -21
- edsl/auto/utilities.py +0 -218
- edsl/base/Base.py +0 -279
- {edsl-0.1.46.dist-info → edsl-0.1.47.dist-info}/LICENSE +0 -0
- {edsl-0.1.46.dist-info → edsl-0.1.47.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: edsl
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.47
|
4
4
|
Summary: Create and analyze LLM-based surveys
|
5
5
|
Home-page: https://www.expectedparrot.com/
|
6
6
|
License: MIT
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
17
17
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
19
|
+
Provides-Extra: screenshots
|
19
20
|
Requires-Dist: aiohttp (>=3.9.1,<4.0.0)
|
20
21
|
Requires-Dist: anthropic (>=0.45.0,<0.46.0)
|
21
22
|
Requires-Dist: azure-ai-inference (>=1.0.0b3,<2.0.0)
|
@@ -239,7 +240,7 @@ An integrated platform for running experiments, sharing workflows and launching
|
|
239
240
|
- <a href="https://discord.com/invite/mxAYkjfy9m" target="_blank" rel="noopener noreferrer">Discord</a>
|
240
241
|
- <a href="https://x.com/ExpectedParrot" target="_blank" rel="noopener noreferrer">Twitter</a>
|
241
242
|
- <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
|
+
- <a href="https://blog.expectedparrot.com" target="_blank" rel="noopener noreferrer">Blog</a>.
|
243
244
|
|
244
245
|
## Contact
|
245
246
|
- <a href="mailto:info@expectedparrot.com" target="_blank" rel="noopener noreferrer">Email</a>
|
@@ -1,8 +1,8 @@
|
|
1
|
-
edsl/Base.py,sha256=
|
1
|
+
edsl/Base.py,sha256=6FfnzsUtqSaRyzxL5WXh5mAZT1KgQaT3lrYWiJKqUNc,15252
|
2
2
|
edsl/BaseDiff.py,sha256=92BirXj2u3TEGHJWni9TBsvZjvq8wpb4wDL2vxX9Lb0,8253
|
3
3
|
edsl/TemplateLoader.py,sha256=sDBlSMt7EfOduM7w3h6v03gvh_Rzn9hVrlS-iLSQdZA,849
|
4
4
|
edsl/__init__.py,sha256=iB5q_P2pXDV6Wb5oHKsFDhi_rJXID0aaqio1I98dwXA,1936
|
5
|
-
edsl/__version__.py,sha256=
|
5
|
+
edsl/__version__.py,sha256=BqdH88p7_x5NtwJCtqUPLKt1fAJF1mVKUoKH7vlX5dQ,23
|
6
6
|
edsl/agents/Agent.py,sha256=lF7GD_bCvRLP4hrtm3w451AUfuJln5jZHGYBH84CMVE,40741
|
7
7
|
edsl/agents/AgentList.py,sha256=iRfQfyUYtaJbJ3sRubPqPKRr77nKQgzhFEeZ0wcAEk0,18955
|
8
8
|
edsl/agents/Invigilator.py,sha256=SObe7PC08XoWNpOubZMFlVKPN8nfZplYBwY9LXJou8c,12084
|
@@ -14,18 +14,6 @@ edsl/agents/__init__.py,sha256=a3H1lxDwu9HR8fwh79C5DgxPSFv_bE2rzQ6y1D8Ba5c,80
|
|
14
14
|
edsl/agents/descriptors.py,sha256=JxM_ckzhDmfZT1igSUdCxgyQcCK0o9MhU5jbLIned9g,3189
|
15
15
|
edsl/agents/prompt_helpers.py,sha256=JkVRPrLQ1egPqbBKcgR22c6WYnTU4QjzZG5HwxDEHjs,5076
|
16
16
|
edsl/agents/question_option_processor.py,sha256=ozh6XqW8z_eaXRauncYifOvEgsmb29F4FMapxhW3hCY,6715
|
17
|
-
edsl/auto/AutoStudy.py,sha256=XniD-g7jg19vbD5CWqq0QAiMsIz2CboKAAIluDODqzo,4326
|
18
|
-
edsl/auto/StageBase.py,sha256=7ZjV0T-8FQBL-r5LeAozNQY_0RJ_GySdX48ToM7-dLc,8254
|
19
|
-
edsl/auto/StageGenerateSurvey.py,sha256=_lC1-hhFjqd6md1-RE9uEOPtZp7dZHxJn0ERpszSfow,7394
|
20
|
-
edsl/auto/StageLabelQuestions.py,sha256=8uHrDi6t-o_NgumfguiCENsNU3rmYF4nmanTMEtbkYI,4663
|
21
|
-
edsl/auto/StagePersona.py,sha256=1oqHedJGmT1E0F5F-5uq36SudkP7d4FHDd8mbmb5hOw,1886
|
22
|
-
edsl/auto/StagePersonaDimensionValueRanges.py,sha256=z_fJJK4vydId13IVQnI92RUoDQkl6Tr9XxUOMNrKyYI,2933
|
23
|
-
edsl/auto/StagePersonaDimensionValues.py,sha256=o6xUVkYLa1wooY5mDmy1j8bGQbK4EzUZ-Zqi7Lfv1hI,2313
|
24
|
-
edsl/auto/StagePersonaDimensions.py,sha256=9tjZJGA1ytTgMlTspRrYKRXj0QYvkWx9Yg5Comf_x8k,2069
|
25
|
-
edsl/auto/StageQuestions.py,sha256=f2h0z-1slFDxdriM9Wxb9BiGLmQLL-VTHu3MK0XEIig,2209
|
26
|
-
edsl/auto/SurveyCreatorPipeline.py,sha256=b1rvJ1u_snPzdXIotfv_Zq3LV7OQVpIicudiFpny-S4,660
|
27
|
-
edsl/auto/utilities.py,sha256=Wfl0VYxnarhFB2NrJYwmswG_JwJ2AyqOPpS3smVoEFU,7402
|
28
|
-
edsl/base/Base.py,sha256=dTXYSNcmNbkUVe6cv5kskJOmY1bbTRgQw0OGdtH_Dck,8534
|
29
17
|
edsl/config.py,sha256=iL5r-JAFGN7-05p3NX4FKICEBb_gOG7CWmVd1C_ZkhQ,6951
|
30
18
|
edsl/conversation/Conversation.py,sha256=GDGEq_2_ni1hEUM__2x2MBoaw4GZ1Nl5RqyvLiA5wzs,9589
|
31
19
|
edsl/conversation/car_buying.py,sha256=SmRd-_L62AmiZJK5UgJV3_tYTsVPTpEYQWb81ygN9Xo,1964
|
@@ -36,10 +24,10 @@ edsl/coop/CoopFunctionsMixin.py,sha256=5Vm8fFTRSg9dFnNBxYqZpeUABSZa2Ttzaal6zB13F
|
|
36
24
|
edsl/coop/ExpectedParrotKeyHandler.py,sha256=1lriainznM1FfQ7GEvTiI1EW8uNi8Sms3Vt5UDxso3U,4456
|
37
25
|
edsl/coop/PriceFetcher.py,sha256=J5EaM-bPqnd2B0ZBVVqXJ-UQK-D4SdjmddYepnN7jz4,1777
|
38
26
|
edsl/coop/__init__.py,sha256=4iZCwJSzJVyjBYk8ggGxY2kZjq9dXVT1jhyPDNyew4I,115
|
39
|
-
edsl/coop/coop.py,sha256=
|
27
|
+
edsl/coop/coop.py,sha256=zdTezq4OGIp8U9U48F_rxd4fafp79c2ePK9ceOsPjUo,49650
|
40
28
|
edsl/coop/utils.py,sha256=SBV76sk5_2rhP3RKGkJsOkrx9Qr-jD0puqYhVR_MgSY,3900
|
41
|
-
edsl/data/Cache.py,sha256=
|
42
|
-
edsl/data/CacheEntry.py,sha256=
|
29
|
+
edsl/data/Cache.py,sha256=b6n5e7VwHMRRevPKe1g9PHXLDS9DA9OAD07ht6SOS8s,18561
|
30
|
+
edsl/data/CacheEntry.py,sha256=pfau_At962iylwwoMOzwHqmSiIb56dibZHXKUHCZ9FU,7753
|
43
31
|
edsl/data/CacheHandler.py,sha256=wy2AdKkk_pmwP71htdmLV9UzXM4AuHm5pn1qscJlX9s,5150
|
44
32
|
edsl/data/RemoteCacheSync.py,sha256=kGVQYShpuhouF10PhdLlJ1ZO6H3aJtKihl7QAcc_rpY,6124
|
45
33
|
edsl/data/SQLiteDict.py,sha256=V5Nfnxctgh4Iblqcw1KmbnkjtfmWrrombROSQ3mvg6A,8979
|
@@ -77,7 +65,7 @@ edsl/inference_services/InferenceServicesCollection.py,sha256=i0eaf5K6zGbPfpuFhz
|
|
77
65
|
edsl/inference_services/MistralAIService.py,sha256=GHKZXtB4npdSpUvLqLc-OBJaihJpmky67NWBH_ql8xk,3763
|
78
66
|
edsl/inference_services/OllamaService.py,sha256=oro9CRl8IUE2Ro-zE69Cr4Zaf6Gdw29XW5CFU-46E0k,498
|
79
67
|
edsl/inference_services/OpenAIService.py,sha256=O5eavTstXPnMHHMcOS9kmMHHEO_CkUJ5o_bgumiNxbI,8470
|
80
|
-
edsl/inference_services/PerplexityService.py,sha256=
|
68
|
+
edsl/inference_services/PerplexityService.py,sha256=TPClKR3nlkg8LipNCcZWLTqk4Fh9VHs_F08BLpd9VRo,5787
|
81
69
|
edsl/inference_services/ServiceAvailability.py,sha256=z2GaZ7Qt2qILcRTVl1X7zZVlPFOP3THntB5WSgbbesQ,4741
|
82
70
|
edsl/inference_services/TestService.py,sha256=sLme9cgQsR0Nzdew3GyDpdfTeEEByxeak4YiodSZKvI,2986
|
83
71
|
edsl/inference_services/TogetherAIService.py,sha256=fe349fdJQw-9OHz5mDGa5qxdC9Nccz0MtkisNIZjBkI,6360
|
@@ -93,9 +81,9 @@ edsl/jobs/Answers.py,sha256=lZpbGAqYqMQw7MUsmpivqMZkHjHHOmCY32s9Km284pQ,1445
|
|
93
81
|
edsl/jobs/FetchInvigilator.py,sha256=83tbrqY_1qK0biNF1x51N0sFx49FFmuOi3o5HmFuCIY,1785
|
94
82
|
edsl/jobs/InterviewTaskManager.py,sha256=I1GShC2CrBFnGOcWn3q2YUU0SJbesmeLrrM2_nkuhZo,3748
|
95
83
|
edsl/jobs/InterviewsConstructor.py,sha256=MyRgygmi4318PgERjhhZZXlNUju2lB1CBu8LJJjYNSs,1853
|
96
|
-
edsl/jobs/Jobs.py,sha256=
|
84
|
+
edsl/jobs/Jobs.py,sha256=1hWygFykW9jlPDFJSwJfLA3jjtYph3tW9BrCj6zdpM4,32105
|
97
85
|
edsl/jobs/JobsChecks.py,sha256=2KT_Bs41SR0-0ryYC99VrE9j7V2ICxf9nPe21YHp67o,5265
|
98
|
-
edsl/jobs/JobsComponentConstructor.py,sha256=
|
86
|
+
edsl/jobs/JobsComponentConstructor.py,sha256=Bzg0_5Plw1DlwT6RSgUfJheCF8AIFhim7eByBryL-XA,7034
|
99
87
|
edsl/jobs/JobsPrompts.py,sha256=NuHtCXskGHLX1Y6SbBTFlfbGxwPvX3m2esjoUsl-hpQ,13179
|
100
88
|
edsl/jobs/JobsRemoteInferenceHandler.py,sha256=RyDjUm4FZvVRxk3rFciNcfqQnuk4f1mCj_KNg7iZy_k,11495
|
101
89
|
edsl/jobs/JobsRemoteInferenceLogger.py,sha256=rUaImMQWVZO24i8cXBeDpd4rMu3fUSbolfqBNbrG1ms,9265
|
@@ -133,7 +121,7 @@ edsl/jobs/tasks/task_status_enum.py,sha256=FLmfSgHSbB921UyC-mvKpBLg5HLRf_NbHKXF4
|
|
133
121
|
edsl/jobs/tokens/InterviewTokenUsage.py,sha256=u_6-IHpGFwZ6qMEXr24-jyLVUSSp4dSs_4iAZsBv7O4,1100
|
134
122
|
edsl/jobs/tokens/TokenUsage.py,sha256=odj2-wDNEbHl9noyFAQ0DSKV0D9cv3aDOpmXufKZ8O4,1323
|
135
123
|
edsl/language_models/ComputeCost.py,sha256=SLP_tQiZwMonlIVAsOseWpN4Gd3zVirSxN2WJsO5kzs,2310
|
136
|
-
edsl/language_models/LanguageModel.py,sha256=
|
124
|
+
edsl/language_models/LanguageModel.py,sha256=rnnIwbCzX2BZm6vQPmDfbjMdPgfY6FQx_CXEK3Pv0SE,22078
|
137
125
|
edsl/language_models/ModelList.py,sha256=n8OWnPBeKT66XsXvbG5xWqvrs7MHBiuuFWp82gVQD0o,4731
|
138
126
|
edsl/language_models/PriceManager.py,sha256=Atl2715WOl9u4cU1a_S_Ycrejc787T8_mi_o-DENCeQ,5757
|
139
127
|
edsl/language_models/RawResponseHandler.py,sha256=4ekXsNlDUOb_cfzmfJLS-KIjQXjf6xGgGdDgloqANxI,3904
|
@@ -157,7 +145,7 @@ edsl/prompts/Prompt.py,sha256=gSpMneHIlfOr1_rxWKiMdFMC98w458dg0KEFQDJmLAA,14081
|
|
157
145
|
edsl/prompts/__init__.py,sha256=wrtkH7JW72U93_pnmTvqQx_NoadH5OPRNfrZ5AaD7Co,87
|
158
146
|
edsl/questions/ExceptionExplainer.py,sha256=BgM80FRPJjS_TrY6XaVmlT666MzY9DEagviGQj9-WEQ,2868
|
159
147
|
edsl/questions/HTMLQuestion.py,sha256=mRzVpfFLZ2RYBSDbLHeXTyAXbUHorpiwhNf-nuUSC5M,3431
|
160
|
-
edsl/questions/QuestionBase.py,sha256=
|
148
|
+
edsl/questions/QuestionBase.py,sha256=plUPstwR4G50LnQ8n3m_W8mw7EdvZQel6Z1RqaGug1Q,19496
|
161
149
|
edsl/questions/QuestionBasePromptsMixin.py,sha256=7Pboia46duzxwKcyO0CXcP3PxtAwD3inv_IFfmm3Oy4,11740
|
162
150
|
edsl/questions/QuestionBudget.py,sha256=fBxDRfPJ3HctSCNTzqGLPuRCACySb3NHugXCNE7pXH8,8133
|
163
151
|
edsl/questions/QuestionCheckBox.py,sha256=ho_tyr3a6gHcA2kWlfz0dSW_-2yd6ifdC3niPPPQJAY,12847
|
@@ -193,7 +181,7 @@ edsl/questions/prompt_templates/question_list.jinja,sha256=MAkNv88E79jXK9TxKdnf5
|
|
193
181
|
edsl/questions/prompt_templates/question_multiple_choice.jinja,sha256=sSyAhnexZF6oWqHL-45r7o69vrFcCbbYXLZ3zu7q76U,761
|
194
182
|
edsl/questions/prompt_templates/question_numerical.jinja,sha256=c20sp3HfFonfaRwwmnF7HjAEugU15QlgpNAIkNHasl0,1218
|
195
183
|
edsl/questions/question_base_gen_mixin.py,sha256=6cW1Pw8ErAPErWB5iBoWrXIAWj0gRBnfjA_hfeyYefQ,10028
|
196
|
-
edsl/questions/question_registry.py,sha256=
|
184
|
+
edsl/questions/question_registry.py,sha256=S3gJ5k8XAq_IP2DrfVv7HTyLj5LhAsjVqNLXU0tJa7Q,6239
|
197
185
|
edsl/questions/register_questions_meta.py,sha256=2h_9iZt3cjr_7JRmveTqbmEBBCvjtefMDfhM7Pgd_zg,2598
|
198
186
|
edsl/questions/response_validator_abc.py,sha256=410DIb8Z5uF_xu1lG32OF6X7aoOtL6gG3UIMY83kfeo,6838
|
199
187
|
edsl/questions/response_validator_factory.py,sha256=IzRHHcr2CjWFLgCHXHojwWa5Erc6E8pilTLys1M-5zE,1301
|
@@ -244,12 +232,12 @@ edsl/questions/templates/yes_no/answering_instructions.jinja,sha256=UAcssfcYeW8z
|
|
244
232
|
edsl/questions/templates/yes_no/question_presentation.jinja,sha256=hoEVj4GQD3EYnR2AStXkMFOJeqISNoEVzBd8-cx2yWg,273
|
245
233
|
edsl/results/CSSParameterizer.py,sha256=vI3VTgTihJeCYGfmGp7fOhTitHZ17jrDGbq46Sa2rd8,3677
|
246
234
|
edsl/results/Dataset.py,sha256=81Wf7NAlXfOht4cVFFTLo3lMpTqsPtBq7txLBtJESHw,22495
|
247
|
-
edsl/results/DatasetExportMixin.py,sha256=
|
235
|
+
edsl/results/DatasetExportMixin.py,sha256=6g_mmnqFUz-RbUzGnOHkOCM2htAggnSA0dcoJQ_l5Hk,37739
|
248
236
|
edsl/results/DatasetTree.py,sha256=nvNCF9psLcQ65qsxze7qkrhLn-U-N8OJ327Nf-sFskQ,10178
|
249
237
|
edsl/results/MarkdownToDocx.py,sha256=e8kdDPoqS6Zvd8OTldP9AXbjtmr8BZnro7f0-g1ENi4,4123
|
250
238
|
edsl/results/MarkdownToPDF.py,sha256=RgQ8V86AD_h0HlohUiTWcbL8zOpI8xFC4FK-aOh26HE,3608
|
251
239
|
edsl/results/Result.py,sha256=Rg3SeD2v30zI92jQb25WGgcnyPGcTUXVE5wzeKkLvuQ,22611
|
252
|
-
edsl/results/Results.py,sha256=
|
240
|
+
edsl/results/Results.py,sha256=8HUq_jppThd9ymg2AXr4ggaW_VbhVUHJUoAT9lwxRS0,51654
|
253
241
|
edsl/results/ResultsExportMixin.py,sha256=v9N4pUMrycmKIDzdWn1grmx7F8lxIPAOjfV6OScYSwc,1379
|
254
242
|
edsl/results/ResultsGGMixin.py,sha256=h42-fmicXgGDi71y2kgPSPAS9wTjYYS5_VQELBcp-cM,6625
|
255
243
|
edsl/results/TableDisplay.py,sha256=xGJcotgUqWrmCkQLeD9YIwLrNv7su4VDce3EnllfrLQ,3725
|
@@ -267,11 +255,11 @@ edsl/results/tree_explore.py,sha256=hQjiO4E71rIOPDgEHgK8T8ukxqoNdgX_tvyiDlG4_9U,
|
|
267
255
|
edsl/scenarios/ConstructDownloadLink.py,sha256=DGfF6hoCUovpTQ_GWiEndc--fXe9St6UdiaPhj7ZJZw,3529
|
268
256
|
edsl/scenarios/DocumentChunker.py,sha256=ox8YhNybeg8Ukn6QuRYM8dsAmtTg5iwTAJSUWEkLnh4,3675
|
269
257
|
edsl/scenarios/DocxScenario.py,sha256=ul3nkX826m_T6LFptswqtnH5czP_yxMlLWgbTmFIZI4,482
|
270
|
-
edsl/scenarios/FileStore.py,sha256=
|
258
|
+
edsl/scenarios/FileStore.py,sha256=OKmDIUV7DW-Upjerj0aArqgCNtNOJyU_dItURAb7vjw,21716
|
271
259
|
edsl/scenarios/PdfExtractor.py,sha256=0L3-TizSWglaxT1OBZBEbZoCeMknt8zFhDKzN-TikOI,1922
|
272
260
|
edsl/scenarios/Scenario.py,sha256=01Fv49eVKhXENCrbghDzajmUxYNdoMqE9FV0MMK5beI,19784
|
273
261
|
edsl/scenarios/ScenarioHtmlMixin.py,sha256=5H8MnPPWqlGZ0_Ojv1WjkFaNNRrr-JpCRwlABDBfPXs,2111
|
274
|
-
edsl/scenarios/ScenarioList.py,sha256=
|
262
|
+
edsl/scenarios/ScenarioList.py,sha256=fjTcMwP5J7eL_spjekKUD3admT6lP4svG5vJZWulzVk,70194
|
275
263
|
edsl/scenarios/ScenarioListExportMixin.py,sha256=eghBPIi4CmvkPbHV2hpFyE08jtOzuHiKAlt4JC9D81w,1475
|
276
264
|
edsl/scenarios/ScenarioListPdfMixin.py,sha256=6sGXgDYo7e5lv7sB685iq5DS7KSbXNav-k6y6MRYNLM,7725
|
277
265
|
edsl/scenarios/__init__.py,sha256=CQXwTNTIG9jg_pLkDPZgapUFY0_LwZFVQ8HaYvof0Nc,145
|
@@ -298,7 +286,7 @@ edsl/shared.py,sha256=lgLa-mCk2flIhxXarXLtfXZjXG_6XHhC2A3O8yRTjXc,20
|
|
298
286
|
edsl/study/ObjectEntry.py,sha256=Jtg8V_63BXKKMAOMBqhuHFBjuNqFdkHen8gS2LAWc8Q,5811
|
299
287
|
edsl/study/ProofOfWork.py,sha256=FaqYtLgeiTEQXWKukPgPUTWMcIN5t1FR7h7Re8QEtgc,3433
|
300
288
|
edsl/study/SnapShot.py,sha256=2p9-eP6F9-AfbN_3LL_ZBN5ve4jiQLBzP8XZ3rk3gCI,2701
|
301
|
-
edsl/study/Study.py,sha256=
|
289
|
+
edsl/study/Study.py,sha256=Sc9KOOOTrTSLw6qzq_j7TmHZNG_a55tX46EwWMEwtJA,18016
|
302
290
|
edsl/study/__init__.py,sha256=YAvPLTPG3hK_eN9Ar3d1_d-E3laXpSya879A25-JAxU,170
|
303
291
|
edsl/surveys/ConstructDAG.py,sha256=2t5IstNAtVt6jnvFblgtuspXZQU8_JG5hLAwCFdO56w,3269
|
304
292
|
edsl/surveys/DAG.py,sha256=dnIbrfJ_lQ3QEKjpyuo1I6b0kcnW2KMMyPir0A6J4XM,4235
|
@@ -311,7 +299,7 @@ edsl/surveys/Rule.py,sha256=Hou5_sSpvIfBdZNQk8tHFf-q4JT0wrV_kPMGbmLBfgA,12403
|
|
311
299
|
edsl/surveys/RuleCollection.py,sha256=UC300EOPhjrMc-88eWt5kKBg1pVvKzzwgda2hjHW_sk,14790
|
312
300
|
edsl/surveys/RuleManager.py,sha256=8k1XfTWaJbgjLLJsryBxVSiZ2_YuJPqE750jZEEtVwI,6216
|
313
301
|
edsl/surveys/Simulator.py,sha256=I4_vHNnwe43SAbw7CK1xa45tahAKHfNRbRxGTRXdHuA,2586
|
314
|
-
edsl/surveys/Survey.py,sha256=
|
302
|
+
edsl/surveys/Survey.py,sha256=Te319t8L4FLTdUvg1eKQwBBA3791_HXtGcO2FL-455A,48438
|
315
303
|
edsl/surveys/SurveyCSS.py,sha256=fIdiLuXTUq6KuoXXAU_LTHTTe6RchnCmZpj3j7qnt5Y,8796
|
316
304
|
edsl/surveys/SurveyExportMixin.py,sha256=Kvkd2ku2Kemsn2Nw-Yt8GTnGFcUqfEiKznmisAeO7ck,8339
|
317
305
|
edsl/surveys/SurveyFlowVisualization.py,sha256=Dbkgo-6PBwZ-l2Ok-6dl79CP1JNrqcm04Z4y5ZgKJ-o,8858
|
@@ -360,7 +348,7 @@ edsl/utilities/remove_edsl_version.py,sha256=3n2RoXvZ4pH3k-_lc7B-vkeUyHXHX6vKHQS
|
|
360
348
|
edsl/utilities/repair_functions.py,sha256=tftmklAqam6LOQQu_-9U44N-llycffhW8LfO63vBmNw,929
|
361
349
|
edsl/utilities/restricted_python.py,sha256=5-_zUhrNbos7pLhDl9nr8d24auRlquR6w-vKkmNjPiA,2060
|
362
350
|
edsl/utilities/utilities.py,sha256=FbI9QYGD4eaHrwZ6ePx51jjpatZqwSPHJhimx-h6HyA,12660
|
363
|
-
edsl-0.1.
|
364
|
-
edsl-0.1.
|
365
|
-
edsl-0.1.
|
366
|
-
edsl-0.1.
|
351
|
+
edsl-0.1.47.dist-info/LICENSE,sha256=_qszBDs8KHShVYcYzdMz3HNMtH-fKN_p5zjoVAVumFc,1111
|
352
|
+
edsl-0.1.47.dist-info/METADATA,sha256=vgqfrEJtQ03QZ85Fu4pi3PsM0pKMkycGavcpK6m5TSQ,11724
|
353
|
+
edsl-0.1.47.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
354
|
+
edsl-0.1.47.dist-info/RECORD,,
|
edsl/auto/AutoStudy.py
DELETED
@@ -1,130 +0,0 @@
|
|
1
|
-
from typing import Optional, TYPE_CHECKING
|
2
|
-
|
3
|
-
from edsl import Model
|
4
|
-
from edsl.auto.StageQuestions import StageQuestions
|
5
|
-
from edsl.auto.StagePersona import StagePersona
|
6
|
-
from edsl.auto.StagePersonaDimensions import StagePersonaDimensions
|
7
|
-
from edsl.auto.StagePersonaDimensionValues import StagePersonaDimensionValues
|
8
|
-
from edsl.auto.StagePersonaDimensionValueRanges import (
|
9
|
-
StagePersonaDimensionValueRanges,
|
10
|
-
)
|
11
|
-
from edsl.auto.StageLabelQuestions import StageLabelQuestions
|
12
|
-
from edsl.auto.StageGenerateSurvey import StageGenerateSurvey
|
13
|
-
|
14
|
-
from edsl.auto.utilities import agent_generator, create_agents, gen_pipeline
|
15
|
-
|
16
|
-
if TYPE_CHECKING:
|
17
|
-
from edsl.surveys.Survey import Survey
|
18
|
-
from edsl.agents.AgentList import AgentList
|
19
|
-
|
20
|
-
|
21
|
-
class AutoStudy:
|
22
|
-
def __init__(
|
23
|
-
self,
|
24
|
-
overall_question: str,
|
25
|
-
population: str,
|
26
|
-
model: Optional["Model"] = None,
|
27
|
-
survey: Optional["Survey"] = None,
|
28
|
-
agent_list: Optional["AgentList"] = None,
|
29
|
-
default_num_agents: int = 11,
|
30
|
-
):
|
31
|
-
"""AutoStudy class for generating surveys and agents."""
|
32
|
-
|
33
|
-
self.overall_question = overall_question
|
34
|
-
self.population = population
|
35
|
-
self._survey = survey
|
36
|
-
self._agent_list = agent_list
|
37
|
-
self._agent_list_generator = None
|
38
|
-
self._persona_mapping = None
|
39
|
-
self._results = None
|
40
|
-
self.default_num_agents = default_num_agents
|
41
|
-
self.model = model or Model()
|
42
|
-
|
43
|
-
def to_dict(self):
|
44
|
-
return {
|
45
|
-
"overall_question": self.overall_question,
|
46
|
-
"population": self.population,
|
47
|
-
"survey": self.survey.to_dict(),
|
48
|
-
"persona_mapping": self.persona_mapping.to_dict(),
|
49
|
-
"results": self.results.to_dict(),
|
50
|
-
}
|
51
|
-
|
52
|
-
@property
|
53
|
-
def survey(self):
|
54
|
-
if self._survey is None:
|
55
|
-
self._survey = self._create_survey()
|
56
|
-
return self._survey
|
57
|
-
|
58
|
-
@property
|
59
|
-
def persona_mapping(self):
|
60
|
-
if self._persona_mapping is None:
|
61
|
-
self._persona_mapping = self._create_persona_mapping()
|
62
|
-
return self._persona_mapping
|
63
|
-
|
64
|
-
@property
|
65
|
-
def agent_list_generator(self):
|
66
|
-
if self._agent_list_generator is None:
|
67
|
-
self._agent_list_generator = self._create_agent_list_generator()
|
68
|
-
return self._agent_list_generator
|
69
|
-
|
70
|
-
@property
|
71
|
-
def results(self):
|
72
|
-
if self._results is None:
|
73
|
-
self._results = self._create_results()
|
74
|
-
return self._results
|
75
|
-
|
76
|
-
def _create_survey(self):
|
77
|
-
survey_pipline_stages = [
|
78
|
-
StageQuestions,
|
79
|
-
StageLabelQuestions,
|
80
|
-
StageGenerateSurvey,
|
81
|
-
]
|
82
|
-
survey_pipeline = gen_pipeline(survey_pipline_stages)
|
83
|
-
return survey_pipeline.process(
|
84
|
-
data=survey_pipeline.input(
|
85
|
-
overall_question=self.overall_question, population=self.population
|
86
|
-
)
|
87
|
-
).survey
|
88
|
-
|
89
|
-
def _create_persona_mapping(self):
|
90
|
-
persona_pipeline_stages = [
|
91
|
-
StageQuestions,
|
92
|
-
StagePersona,
|
93
|
-
StagePersonaDimensions,
|
94
|
-
StagePersonaDimensionValues,
|
95
|
-
StagePersonaDimensionValueRanges,
|
96
|
-
]
|
97
|
-
|
98
|
-
persona_pipeline = gen_pipeline(persona_pipeline_stages)
|
99
|
-
sample_agent_results = persona_pipeline.process(
|
100
|
-
persona_pipeline.input(
|
101
|
-
overall_question=overall_question, population=self.population
|
102
|
-
)
|
103
|
-
)
|
104
|
-
return sample_agent_results
|
105
|
-
|
106
|
-
def _create_agent_list_generator(self):
|
107
|
-
return agent_generator(
|
108
|
-
persona=self.persona_mapping.persona,
|
109
|
-
dimension_dict=self.persona_mapping.mapping,
|
110
|
-
)
|
111
|
-
|
112
|
-
def agent_list(self, num_agents):
|
113
|
-
return create_agents(
|
114
|
-
agent_generator=self.agent_list_generator,
|
115
|
-
survey=self.survey,
|
116
|
-
num_agents=num_agents,
|
117
|
-
)
|
118
|
-
|
119
|
-
def _create_results(self, num_agents=None):
|
120
|
-
if num_agents is None:
|
121
|
-
num_agents = self.default_num_agents
|
122
|
-
agent_list = self.agent_list(num_agents)
|
123
|
-
return self.survey.by(agent_list).by(self.model).run()
|
124
|
-
|
125
|
-
|
126
|
-
if __name__ == "__main__":
|
127
|
-
overall_question = "I have an open source Python library for working with LLMs. What are some ways we can market this to others?"
|
128
|
-
auto_study = AutoStudy(overall_question, population="US Adults")
|
129
|
-
|
130
|
-
results = auto_study.results
|
edsl/auto/StageBase.py
DELETED
@@ -1,243 +0,0 @@
|
|
1
|
-
from abc import ABC, abstractmethod
|
2
|
-
import json
|
3
|
-
from typing import Dict, List, Any, TypeVar, Generator, Dict, Callable
|
4
|
-
from dataclasses import dataclass, field, KW_ONLY, fields, asdict
|
5
|
-
import textwrap
|
6
|
-
|
7
|
-
|
8
|
-
class ExceptionPipesDoNotFit(Exception):
|
9
|
-
pass
|
10
|
-
|
11
|
-
|
12
|
-
class StageProcessingClosure:
|
13
|
-
def __init__(self, stage_func: Callable, reduction_func=lambda x: x):
|
14
|
-
self.data = []
|
15
|
-
self.stage_func = stage_func
|
16
|
-
# reduction function is applied to self.data when complete
|
17
|
-
# it might just return the list, or it might do something more complicated such as
|
18
|
-
# reduce the list to a dictionary
|
19
|
-
self.reduction_func = reduction_func
|
20
|
-
|
21
|
-
def func(self, obj: "FlowDataBase") -> None:
|
22
|
-
"Function to apply to each stage"
|
23
|
-
self.data.append(self.stage_func(obj))
|
24
|
-
|
25
|
-
def __call__(self):
|
26
|
-
return self.reduction_func(self.data)
|
27
|
-
|
28
|
-
|
29
|
-
@dataclass
|
30
|
-
class FlowDataBase:
|
31
|
-
"""Base class for dataclasses that are passed between stages."""
|
32
|
-
|
33
|
-
_: KW_ONLY
|
34
|
-
# previous_stage: Dict = field(default_factory=dict)
|
35
|
-
previous_stage: Any = None
|
36
|
-
sent_to_stage_name: str = field(default_factory=str)
|
37
|
-
came_from_stage_name: str = field(default_factory=str)
|
38
|
-
|
39
|
-
def to_dict(self):
|
40
|
-
return asdict(self)
|
41
|
-
|
42
|
-
@classmethod
|
43
|
-
def from_dict(cls, data: dict):
|
44
|
-
return cls(**data)
|
45
|
-
|
46
|
-
def __getitem__(self, key):
|
47
|
-
"""Allows dictionary-style getting."""
|
48
|
-
return getattr(self, key)
|
49
|
-
|
50
|
-
def __setitem__(self, key, value):
|
51
|
-
"""Allows dictionary-style setting."""
|
52
|
-
return setattr(self, key, value)
|
53
|
-
|
54
|
-
def current_values(self):
|
55
|
-
"""Returns a dictionary of the current values of the dataclass"""
|
56
|
-
to_exclude = ["sent_to_stage_name", "came_from_stage_name", "previous_stage"]
|
57
|
-
d = asdict(self)
|
58
|
-
[d.pop(key) for key in to_exclude]
|
59
|
-
return d
|
60
|
-
|
61
|
-
def stage_input_output(self):
|
62
|
-
return {
|
63
|
-
"came_from": self.came_from_stage_name,
|
64
|
-
"sent_to": self.sent_to_stage_name,
|
65
|
-
}
|
66
|
-
|
67
|
-
def _align_values_with_padding(
|
68
|
-
self, stages
|
69
|
-
) -> Generator[Dict[str, str], None, None]:
|
70
|
-
"Pads out the the names of the stages so they are aligned when printing"
|
71
|
-
|
72
|
-
def longest_value(stage):
|
73
|
-
return max([len(v) for v in stage.values()])
|
74
|
-
|
75
|
-
max_length = max([longest_value(stage) for stage in stages])
|
76
|
-
for stage in stages:
|
77
|
-
new_stage = {k: v.ljust(max_length) for k, v in stage.items()}
|
78
|
-
yield new_stage
|
79
|
-
|
80
|
-
def _reduce(self, stage_processor: StageProcessingClosure) -> Dict[str, dict]:
|
81
|
-
"""Applies some function defined in stage_processor to each stage in the chain, working from back to front
|
82
|
-
|
83
|
-
The stage_processor will record the results of the function applied to each stage in
|
84
|
-
an instance of the StageProcessingClosure class.
|
85
|
-
The results can be accessed by calling the StageProcessingClosure instance.
|
86
|
-
This somewhat convoluted approach is necessary because the stages are connected in a chain and
|
87
|
-
we want a way to access the results of the function applied to each stage in the chain without
|
88
|
-
writing the while-loop over and over again.
|
89
|
-
"""
|
90
|
-
stage_processor.func(self)
|
91
|
-
current_pipe = self
|
92
|
-
while True:
|
93
|
-
if current_pipe.previous_stage is None:
|
94
|
-
break
|
95
|
-
else:
|
96
|
-
current_pipe = current_pipe.previous_stage
|
97
|
-
stage_processor.func(
|
98
|
-
current_pipe
|
99
|
-
) # the result is getting stored in stage_processor.data
|
100
|
-
|
101
|
-
def combined_results(self) -> Dict[str, dict]:
|
102
|
-
stage_processor = StageProcessingClosure(
|
103
|
-
stage_func=lambda obj: obj.current_values(),
|
104
|
-
reduction_func=lambda x: {k: v for d in x for k, v in d.items()},
|
105
|
-
)
|
106
|
-
self._reduce(stage_processor)
|
107
|
-
return stage_processor()
|
108
|
-
|
109
|
-
def flow_history(self):
|
110
|
-
stage_processor = StageProcessingClosure(
|
111
|
-
stage_func=lambda obj: obj.stage_input_output()
|
112
|
-
)
|
113
|
-
self._reduce(stage_processor)
|
114
|
-
return stage_processor()
|
115
|
-
|
116
|
-
def visualize_flow(self) -> str:
|
117
|
-
"""Visualize the flow of data through the chain"""
|
118
|
-
stages = self.flow_history()
|
119
|
-
new_stages = list(self._align_values_with_padding(stages))
|
120
|
-
new_stages.reverse()
|
121
|
-
return tuple(new_stages)
|
122
|
-
|
123
|
-
|
124
|
-
class StageBase(ABC):
|
125
|
-
input: FlowDataBase = NotImplemented
|
126
|
-
output: FlowDataBase = NotImplemented
|
127
|
-
|
128
|
-
def __init__(self, **kwargs):
|
129
|
-
for key, value in kwargs.items():
|
130
|
-
setattr(self, key, value)
|
131
|
-
|
132
|
-
if hasattr(self, "next_stage"):
|
133
|
-
self._validate_connection(self.next_stage)
|
134
|
-
else:
|
135
|
-
self.next_stage = None
|
136
|
-
|
137
|
-
@classmethod
|
138
|
-
def function_parameters(self):
|
139
|
-
return fields(self.input)
|
140
|
-
|
141
|
-
@classmethod
|
142
|
-
def func(cls, **kwargs):
|
143
|
-
"This provides a shortcut for running a stage by passing keyword arguments to the input function."
|
144
|
-
input_data = cls.input(**kwargs)
|
145
|
-
return cls().process(input_data)
|
146
|
-
|
147
|
-
@abstractmethod
|
148
|
-
def handle_data(self, data):
|
149
|
-
"This implements how the stage actually handles the passed in data"
|
150
|
-
raise NotImplementedError
|
151
|
-
|
152
|
-
def _validate_connection(self, stage):
|
153
|
-
"Checks that the outputs of the first stage match the inputs of the second stage"
|
154
|
-
if not self.output == stage.input:
|
155
|
-
raise ExceptionPipesDoNotFit(
|
156
|
-
textwrap.dedent(
|
157
|
-
f"""\
|
158
|
-
Stage \"{self.__class__.__name__}\" cannot be connected to stage \"{stage.__class__.__name__}\".
|
159
|
-
The outputs of the first stage {self.output} do not match the inputs of the second stage, {stage.input}."""
|
160
|
-
)
|
161
|
-
)
|
162
|
-
|
163
|
-
def __init_subclass__(cls, **kwargs):
|
164
|
-
"Checks that the subclass has the required class variables of input & output"
|
165
|
-
super().__init_subclass__(**kwargs)
|
166
|
-
if cls.input is NotImplemented:
|
167
|
-
raise NotImplementedError(
|
168
|
-
f"Class {cls.__name__} lacks required class variable 'inputs'"
|
169
|
-
)
|
170
|
-
if cls.output is NotImplemented:
|
171
|
-
raise NotImplementedError(
|
172
|
-
f"Class {cls.__name__} lacks required class variable 'outputs'"
|
173
|
-
)
|
174
|
-
|
175
|
-
def process(self, data):
|
176
|
-
print(f"Running stage: {self.__class__.__name__}")
|
177
|
-
data.sent_to_stage_name = self.__class__.__name__
|
178
|
-
processed_data = self.handle_data(data)
|
179
|
-
processed_data.came_from_stage_name = self.__class__.__name__
|
180
|
-
processed_data.previous_stage = data
|
181
|
-
if self.next_stage:
|
182
|
-
return self.next_stage.process(processed_data)
|
183
|
-
else:
|
184
|
-
return processed_data
|
185
|
-
|
186
|
-
|
187
|
-
if __name__ == "__main__":
|
188
|
-
pass
|
189
|
-
# try:
|
190
|
-
|
191
|
-
# class StageMissing(StageBase):
|
192
|
-
# def handle_data(self, data):
|
193
|
-
# return data
|
194
|
-
|
195
|
-
# except NotImplementedError as e:
|
196
|
-
# print(e)
|
197
|
-
# else:
|
198
|
-
# raise Exception("Should have raised NotImplementedError")
|
199
|
-
|
200
|
-
# try:
|
201
|
-
|
202
|
-
# class StageMissingInput(StageBase):
|
203
|
-
# output = FlowDataBase
|
204
|
-
|
205
|
-
# except NotImplementedError as e:
|
206
|
-
# print(e)
|
207
|
-
|
208
|
-
# else:
|
209
|
-
# raise Exception("Should have raised NotImplementedError")
|
210
|
-
|
211
|
-
# @dataclass
|
212
|
-
# class MockInputOutput(FlowDataBase):
|
213
|
-
# text: str
|
214
|
-
|
215
|
-
# class StageTest(StageBase):
|
216
|
-
# input = MockInputOutput
|
217
|
-
# output = MockInputOutput
|
218
|
-
|
219
|
-
# def handle_data(self, data):
|
220
|
-
# return self.output(text=data["text"] + "processed")
|
221
|
-
|
222
|
-
# result = StageTest().process(MockInputOutput(text="Hello world!"))
|
223
|
-
# print(result.text)
|
224
|
-
|
225
|
-
# pipeline = StageTest(next_stage=StageTest(next_stage=StageTest()))
|
226
|
-
# result = pipeline.process(MockInputOutput(text="Hello world!"))
|
227
|
-
# print(result.text)
|
228
|
-
|
229
|
-
# class BadMockInput(FlowDataBase):
|
230
|
-
# text: str
|
231
|
-
# other: str
|
232
|
-
|
233
|
-
# class StageBad(StageBase):
|
234
|
-
# input = BadMockInput
|
235
|
-
# output = BadMockInput
|
236
|
-
|
237
|
-
# def handle_data(self, data):
|
238
|
-
# return self.output(text=data["text"] + "processed")
|
239
|
-
|
240
|
-
# try:
|
241
|
-
# pipeline = StageTest(next_stage=StageBad(next_stage=StageTest()))
|
242
|
-
# except ExceptionPipesDoNotFit as e:
|
243
|
-
# print(e)
|