edsl 0.1.43__py3-none-any.whl → 0.1.45__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.
Files changed (65) hide show
  1. edsl/Base.py +15 -6
  2. edsl/__version__.py +1 -1
  3. edsl/agents/InvigilatorBase.py +3 -1
  4. edsl/agents/PromptConstructor.py +62 -34
  5. edsl/agents/QuestionInstructionPromptBuilder.py +111 -68
  6. edsl/agents/QuestionTemplateReplacementsBuilder.py +69 -16
  7. edsl/agents/question_option_processor.py +15 -6
  8. edsl/coop/CoopFunctionsMixin.py +3 -4
  9. edsl/coop/coop.py +56 -10
  10. edsl/enums.py +4 -1
  11. edsl/inference_services/AnthropicService.py +12 -8
  12. edsl/inference_services/AvailableModelFetcher.py +2 -0
  13. edsl/inference_services/AwsBedrock.py +1 -2
  14. edsl/inference_services/AzureAI.py +12 -9
  15. edsl/inference_services/GoogleService.py +10 -3
  16. edsl/inference_services/InferenceServiceABC.py +1 -0
  17. edsl/inference_services/InferenceServicesCollection.py +2 -2
  18. edsl/inference_services/MistralAIService.py +1 -2
  19. edsl/inference_services/OpenAIService.py +10 -4
  20. edsl/inference_services/PerplexityService.py +2 -1
  21. edsl/inference_services/TestService.py +1 -0
  22. edsl/inference_services/XAIService.py +11 -0
  23. edsl/inference_services/registry.py +2 -0
  24. edsl/jobs/Jobs.py +9 -0
  25. edsl/jobs/JobsChecks.py +11 -14
  26. edsl/jobs/JobsPrompts.py +3 -3
  27. edsl/jobs/async_interview_runner.py +3 -1
  28. edsl/jobs/check_survey_scenario_compatibility.py +5 -5
  29. edsl/jobs/interviews/InterviewExceptionEntry.py +12 -0
  30. edsl/jobs/tasks/TaskHistory.py +1 -1
  31. edsl/language_models/LanguageModel.py +3 -3
  32. edsl/language_models/PriceManager.py +45 -5
  33. edsl/language_models/model.py +89 -36
  34. edsl/questions/QuestionBase.py +21 -0
  35. edsl/questions/QuestionBasePromptsMixin.py +103 -0
  36. edsl/questions/QuestionFreeText.py +22 -5
  37. edsl/questions/descriptors.py +4 -0
  38. edsl/questions/question_base_gen_mixin.py +94 -29
  39. edsl/results/Dataset.py +65 -0
  40. edsl/results/DatasetExportMixin.py +299 -32
  41. edsl/results/Result.py +27 -0
  42. edsl/results/Results.py +24 -3
  43. edsl/results/ResultsGGMixin.py +7 -3
  44. edsl/scenarios/DocumentChunker.py +2 -0
  45. edsl/scenarios/FileStore.py +29 -8
  46. edsl/scenarios/PdfExtractor.py +21 -1
  47. edsl/scenarios/Scenario.py +25 -9
  48. edsl/scenarios/ScenarioList.py +73 -3
  49. edsl/scenarios/handlers/__init__.py +1 -0
  50. edsl/scenarios/handlers/docx.py +5 -1
  51. edsl/scenarios/handlers/jpeg.py +39 -0
  52. edsl/surveys/Survey.py +28 -6
  53. edsl/surveys/SurveyFlowVisualization.py +91 -43
  54. edsl/templates/error_reporting/exceptions_table.html +7 -8
  55. edsl/templates/error_reporting/interview_details.html +1 -1
  56. edsl/templates/error_reporting/interviews.html +0 -1
  57. edsl/templates/error_reporting/overview.html +2 -7
  58. edsl/templates/error_reporting/performance_plot.html +1 -1
  59. edsl/templates/error_reporting/report.css +1 -1
  60. edsl/utilities/PrettyList.py +14 -0
  61. edsl-0.1.45.dist-info/METADATA +246 -0
  62. {edsl-0.1.43.dist-info → edsl-0.1.45.dist-info}/RECORD +64 -62
  63. edsl-0.1.43.dist-info/METADATA +0 -110
  64. {edsl-0.1.43.dist-info → edsl-0.1.45.dist-info}/LICENSE +0 -0
  65. {edsl-0.1.43.dist-info → edsl-0.1.45.dist-info}/WHEEL +0 -0
@@ -1,110 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: edsl
3
- Version: 0.1.43
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: Apostolos Filippas
9
- Author-email: apostolos@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
57
- <p align="center">
58
- <img src="https://github.com/expectedparrot/edsl/blob/main/static/logo.png?raw=true" alt="edsl.png" width="100"/>
59
- </p>
60
-
61
- The Expected Parrot Domain-Specific Language (EDSL) package lets you conduct computational social science and market research with AI. Use it to design surveys and experiments, simulate responses with large language models, and perform data labeling and other research tasks. Results are formatted as specified datasets and come with built-in methods for analyzing, visualizing, and sharing.
62
-
63
- ## 🔗 Links
64
- - [PyPI](https://pypi.org/project/edsl/)
65
- - [Documentation](https://docs.expectedparrot.com)
66
- - [Getting started](https://docs.expectedparrot.com/en/latest/starter_tutorial.html)
67
- - [Discord](https://discord.com/invite/mxAYkjfy9m)
68
- - [Twitter](https://x.com/ExpectedParrot)
69
- - [LinkedIn](https://www.linkedin.com/company/expectedparrot/)
70
- - [Blog](https://blog.expectedparrot.com)
71
-
72
- ## 🌎 Hello, World!
73
- A quick example:
74
-
75
- ```python
76
- # Import a question type
77
- from edsl import QuestionMultipleChoice
78
-
79
- # Construct a question using the question type template
80
- q = QuestionMultipleChoice(
81
- question_name="example_question",
82
- question_text="How do you feel today?",
83
- question_options=["Bad", "OK", "Good"]
84
- )
85
-
86
- # Run it with the default language model
87
- results = q.run()
88
-
89
- # Inspect the results
90
- results.select("example_question")
91
- ```
92
-
93
- Output:
94
- ```python
95
- ┏━━━━━━━━━━━━━━━━━━━━━━━━━┓
96
- ┃ answer.example_question ┃
97
- ┡━━━━━━━━━━━━━━━━━━━━━━━━━┩
98
- │ Good │
99
- └─────────────────────────┘
100
- ```
101
-
102
- ## 💻 Requirements
103
- * EDSL is compatible with Python 3.9 - 3.12.
104
- * API keys for large language models that you want to use, stored in a `.env` file.
105
- See instructions on [storing API keys](https://docs.expectedparrot.com/en/latest/api_keys.html) and [activating remote inference](https://docs.expectedparrot.com/en/latest/remote_inference.html).
106
-
107
- ## 💡 Contributions, feature requests & bugs
108
- Interested in contributing? Want us to add a new feature? Found a bug for us to squash?
109
- Please send us an email at [info@expectedparrot.com](mailto:info@expectedparrot.com) or message us at our [Discord channel](https://discord.com/invite/mxAYkjfy9m).
110
-
File without changes
File without changes