edsl 0.1.43__tar.gz → 0.1.44__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 (366) hide show
  1. {edsl-0.1.43 → edsl-0.1.44}/PKG-INFO +1 -1
  2. {edsl-0.1.43 → edsl-0.1.44}/edsl/Base.py +15 -6
  3. edsl-0.1.44/edsl/__version__.py +1 -0
  4. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/coop.py +35 -3
  5. {edsl-0.1.43 → edsl-0.1.44}/edsl/enums.py +4 -1
  6. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/AnthropicService.py +2 -0
  7. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/GoogleService.py +2 -0
  8. edsl-0.1.44/edsl/inference_services/GrokService.py +11 -0
  9. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/InferenceServiceABC.py +1 -0
  10. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/OpenAIService.py +1 -0
  11. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/TestService.py +1 -0
  12. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/registry.py +2 -0
  13. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/JobsChecks.py +7 -7
  14. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/JobsPrompts.py +3 -3
  15. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/LanguageModel.py +5 -2
  16. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/model.py +43 -11
  17. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/Results.py +2 -1
  18. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/FileStore.py +19 -8
  19. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/Survey.py +27 -6
  20. {edsl-0.1.43 → edsl-0.1.44}/pyproject.toml +1 -1
  21. edsl-0.1.43/edsl/__version__.py +0 -1
  22. {edsl-0.1.43 → edsl-0.1.44}/LICENSE +0 -0
  23. {edsl-0.1.43 → edsl-0.1.44}/README.md +0 -0
  24. {edsl-0.1.43 → edsl-0.1.44}/edsl/BaseDiff.py +0 -0
  25. {edsl-0.1.43 → edsl-0.1.44}/edsl/TemplateLoader.py +0 -0
  26. {edsl-0.1.43 → edsl-0.1.44}/edsl/__init__.py +0 -0
  27. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/Agent.py +0 -0
  28. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/AgentList.py +0 -0
  29. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/Invigilator.py +0 -0
  30. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/InvigilatorBase.py +0 -0
  31. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/PromptConstructor.py +0 -0
  32. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/QuestionInstructionPromptBuilder.py +0 -0
  33. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/QuestionTemplateReplacementsBuilder.py +0 -0
  34. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/__init__.py +0 -0
  35. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/descriptors.py +0 -0
  36. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/prompt_helpers.py +0 -0
  37. {edsl-0.1.43 → edsl-0.1.44}/edsl/agents/question_option_processor.py +0 -0
  38. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/AutoStudy.py +0 -0
  39. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StageBase.py +0 -0
  40. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StageGenerateSurvey.py +0 -0
  41. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StageLabelQuestions.py +0 -0
  42. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StagePersona.py +0 -0
  43. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StagePersonaDimensionValueRanges.py +0 -0
  44. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StagePersonaDimensionValues.py +0 -0
  45. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StagePersonaDimensions.py +0 -0
  46. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/StageQuestions.py +0 -0
  47. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/SurveyCreatorPipeline.py +0 -0
  48. {edsl-0.1.43 → edsl-0.1.44}/edsl/auto/utilities.py +0 -0
  49. {edsl-0.1.43 → edsl-0.1.44}/edsl/base/Base.py +0 -0
  50. {edsl-0.1.43 → edsl-0.1.44}/edsl/config.py +0 -0
  51. {edsl-0.1.43 → edsl-0.1.44}/edsl/conversation/Conversation.py +0 -0
  52. {edsl-0.1.43 → edsl-0.1.44}/edsl/conversation/car_buying.py +0 -0
  53. {edsl-0.1.43 → edsl-0.1.44}/edsl/conversation/chips.py +0 -0
  54. {edsl-0.1.43 → edsl-0.1.44}/edsl/conversation/mug_negotiation.py +0 -0
  55. {edsl-0.1.43 → edsl-0.1.44}/edsl/conversation/next_speaker_utilities.py +0 -0
  56. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/CoopFunctionsMixin.py +0 -0
  57. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/ExpectedParrotKeyHandler.py +0 -0
  58. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/PriceFetcher.py +0 -0
  59. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/__init__.py +0 -0
  60. {edsl-0.1.43 → edsl-0.1.44}/edsl/coop/utils.py +0 -0
  61. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/Cache.py +0 -0
  62. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/CacheEntry.py +0 -0
  63. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/CacheHandler.py +0 -0
  64. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/RemoteCacheSync.py +0 -0
  65. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/SQLiteDict.py +0 -0
  66. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/__init__.py +0 -0
  67. {edsl-0.1.43 → edsl-0.1.44}/edsl/data/orm.py +0 -0
  68. {edsl-0.1.43 → edsl-0.1.44}/edsl/data_transfer_models.py +0 -0
  69. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/BaseException.py +0 -0
  70. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/__init__.py +0 -0
  71. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/agents.py +0 -0
  72. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/cache.py +0 -0
  73. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/configuration.py +0 -0
  74. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/coop.py +0 -0
  75. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/data.py +0 -0
  76. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/general.py +0 -0
  77. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/inference_services.py +0 -0
  78. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/jobs.py +0 -0
  79. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/language_models.py +0 -0
  80. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/prompts.py +0 -0
  81. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/questions.py +0 -0
  82. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/results.py +0 -0
  83. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/scenarios.py +0 -0
  84. {edsl-0.1.43 → edsl-0.1.44}/edsl/exceptions/surveys.py +0 -0
  85. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/AvailableModelCacheHandler.py +0 -0
  86. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/AvailableModelFetcher.py +0 -0
  87. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/AwsBedrock.py +0 -0
  88. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/AzureAI.py +0 -0
  89. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/DeepInfraService.py +0 -0
  90. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/DeepSeekService.py +0 -0
  91. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/GroqService.py +0 -0
  92. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/InferenceServicesCollection.py +0 -0
  93. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/MistralAIService.py +0 -0
  94. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/OllamaService.py +0 -0
  95. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/PerplexityService.py +0 -0
  96. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/ServiceAvailability.py +0 -0
  97. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/TogetherAIService.py +0 -0
  98. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/__init__.py +0 -0
  99. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/data_structures.py +0 -0
  100. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/models_available_cache.py +0 -0
  101. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/rate_limits_cache.py +0 -0
  102. {edsl-0.1.43 → edsl-0.1.44}/edsl/inference_services/write_available.py +0 -0
  103. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/AnswerQuestionFunctionConstructor.py +0 -0
  104. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/Answers.py +0 -0
  105. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/FetchInvigilator.py +0 -0
  106. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/InterviewTaskManager.py +0 -0
  107. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/InterviewsConstructor.py +0 -0
  108. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/Jobs.py +0 -0
  109. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/JobsComponentConstructor.py +0 -0
  110. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/JobsRemoteInferenceHandler.py +0 -0
  111. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/JobsRemoteInferenceLogger.py +0 -0
  112. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/RequestTokenEstimator.py +0 -0
  113. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/__init__.py +0 -0
  114. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/async_interview_runner.py +0 -0
  115. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/buckets/BucketCollection.py +0 -0
  116. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/buckets/ModelBuckets.py +0 -0
  117. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/buckets/TokenBucket.py +0 -0
  118. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/buckets/TokenBucketAPI.py +0 -0
  119. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/buckets/TokenBucketClient.py +0 -0
  120. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/check_survey_scenario_compatibility.py +0 -0
  121. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/data_structures.py +0 -0
  122. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/decorators.py +0 -0
  123. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/Interview.py +0 -0
  124. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewExceptionCollection.py +0 -0
  125. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewExceptionEntry.py +0 -0
  126. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewStatistic.py +0 -0
  127. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewStatisticsCollection.py +0 -0
  128. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewStatusDictionary.py +0 -0
  129. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/InterviewStatusLog.py +0 -0
  130. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/ReportErrors.py +0 -0
  131. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/interviews/interview_status_enum.py +0 -0
  132. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/jobs_status_enums.py +0 -0
  133. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/loggers/HTMLTableJobLogger.py +0 -0
  134. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/results_exceptions_handler.py +0 -0
  135. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/runners/JobsRunnerAsyncio.py +0 -0
  136. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/runners/JobsRunnerStatus.py +0 -0
  137. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/runners/JobsRunnerStatusData.py +0 -0
  138. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tasks/QuestionTaskCreator.py +0 -0
  139. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tasks/TaskCreators.py +0 -0
  140. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tasks/TaskHistory.py +0 -0
  141. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tasks/TaskStatusLog.py +0 -0
  142. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tasks/task_status_enum.py +0 -0
  143. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tokens/InterviewTokenUsage.py +0 -0
  144. {edsl-0.1.43 → edsl-0.1.44}/edsl/jobs/tokens/TokenUsage.py +0 -0
  145. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/ComputeCost.py +0 -0
  146. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/ModelList.py +0 -0
  147. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/PriceManager.py +0 -0
  148. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/RawResponseHandler.py +0 -0
  149. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/RegisterLanguageModelsMeta.py +0 -0
  150. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/ServiceDataSources.py +0 -0
  151. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/__init__.py +0 -0
  152. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/fake_openai_call.py +0 -0
  153. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/fake_openai_service.py +0 -0
  154. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/key_management/KeyLookup.py +0 -0
  155. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/key_management/KeyLookupBuilder.py +0 -0
  156. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/key_management/KeyLookupCollection.py +0 -0
  157. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/key_management/__init__.py +0 -0
  158. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/key_management/models.py +0 -0
  159. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/repair.py +0 -0
  160. {edsl-0.1.43 → edsl-0.1.44}/edsl/language_models/utilities.py +0 -0
  161. {edsl-0.1.43 → edsl-0.1.44}/edsl/notebooks/Notebook.py +0 -0
  162. {edsl-0.1.43 → edsl-0.1.44}/edsl/notebooks/NotebookToLaTeX.py +0 -0
  163. {edsl-0.1.43 → edsl-0.1.44}/edsl/notebooks/__init__.py +0 -0
  164. {edsl-0.1.43 → edsl-0.1.44}/edsl/prompts/Prompt.py +0 -0
  165. {edsl-0.1.43 → edsl-0.1.44}/edsl/prompts/__init__.py +0 -0
  166. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/ExceptionExplainer.py +0 -0
  167. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/HTMLQuestion.py +0 -0
  168. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionBase.py +0 -0
  169. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionBasePromptsMixin.py +0 -0
  170. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionBudget.py +0 -0
  171. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionCheckBox.py +0 -0
  172. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionDict.py +0 -0
  173. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionExtract.py +0 -0
  174. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionFreeText.py +0 -0
  175. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionFunctional.py +0 -0
  176. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionList.py +0 -0
  177. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionMatrix.py +0 -0
  178. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionMultipleChoice.py +0 -0
  179. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionNumerical.py +0 -0
  180. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/QuestionRank.py +0 -0
  181. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/Quick.py +0 -0
  182. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/SimpleAskMixin.py +0 -0
  183. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/__init__.py +0 -0
  184. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/answer_validator_mixin.py +0 -0
  185. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/compose_questions.py +0 -0
  186. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/data_structures.py +0 -0
  187. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/decorators.py +0 -0
  188. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/derived/QuestionLikertFive.py +0 -0
  189. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/derived/QuestionLinearScale.py +0 -0
  190. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/derived/QuestionTopK.py +0 -0
  191. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/derived/QuestionYesNo.py +0 -0
  192. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/derived/__init__.py +0 -0
  193. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/descriptors.py +0 -0
  194. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/loop_processor.py +0 -0
  195. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_budget.jinja +0 -0
  196. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_checkbox.jinja +0 -0
  197. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_extract.jinja +0 -0
  198. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_free_text.jinja +0 -0
  199. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_linear_scale.jinja +0 -0
  200. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_list.jinja +0 -0
  201. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_multiple_choice.jinja +0 -0
  202. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/prompt_templates/question_numerical.jinja +0 -0
  203. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/question_base_gen_mixin.py +0 -0
  204. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/question_registry.py +0 -0
  205. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/register_questions_meta.py +0 -0
  206. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/response_validator_abc.py +0 -0
  207. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/response_validator_factory.py +0 -0
  208. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/settings.py +0 -0
  209. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/__init__.py +0 -0
  210. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/budget/__init__.py +0 -0
  211. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/budget/answering_instructions.jinja +0 -0
  212. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/budget/question_presentation.jinja +0 -0
  213. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/checkbox/__init__.py +0 -0
  214. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/checkbox/answering_instructions.jinja +0 -0
  215. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/checkbox/question_presentation.jinja +0 -0
  216. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/dict/__init__.py +0 -0
  217. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/dict/answering_instructions.jinja +0 -0
  218. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/dict/question_presentation.jinja +0 -0
  219. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/extract/__init__.py +0 -0
  220. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/extract/answering_instructions.jinja +0 -0
  221. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/extract/question_presentation.jinja +0 -0
  222. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/free_text/__init__.py +0 -0
  223. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/free_text/answering_instructions.jinja +0 -0
  224. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/free_text/question_presentation.jinja +0 -0
  225. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/likert_five/__init__.py +0 -0
  226. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/likert_five/answering_instructions.jinja +0 -0
  227. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/likert_five/question_presentation.jinja +0 -0
  228. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/linear_scale/__init__.py +0 -0
  229. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/linear_scale/answering_instructions.jinja +0 -0
  230. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/linear_scale/question_presentation.jinja +0 -0
  231. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/list/__init__.py +0 -0
  232. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/list/answering_instructions.jinja +0 -0
  233. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/list/question_presentation.jinja +0 -0
  234. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/matrix/__init__.py +0 -0
  235. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/matrix/answering_instructions.jinja +0 -0
  236. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/matrix/question_presentation.jinja +0 -0
  237. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/multiple_choice/__init__.py +0 -0
  238. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/multiple_choice/answering_instructions.jinja +0 -0
  239. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/multiple_choice/html.jinja +0 -0
  240. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/multiple_choice/question_presentation.jinja +0 -0
  241. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/numerical/__init__.py +0 -0
  242. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/numerical/answering_instructions.jinja +0 -0
  243. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/numerical/question_presentation.jinja +0 -0
  244. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/rank/__init__.py +0 -0
  245. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/rank/answering_instructions.jinja +0 -0
  246. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/rank/question_presentation.jinja +0 -0
  247. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/top_k/__init__.py +0 -0
  248. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/top_k/answering_instructions.jinja +0 -0
  249. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/top_k/question_presentation.jinja +0 -0
  250. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/yes_no/__init__.py +0 -0
  251. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/yes_no/answering_instructions.jinja +0 -0
  252. {edsl-0.1.43 → edsl-0.1.44}/edsl/questions/templates/yes_no/question_presentation.jinja +0 -0
  253. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/CSSParameterizer.py +0 -0
  254. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/Dataset.py +0 -0
  255. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/DatasetExportMixin.py +0 -0
  256. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/DatasetTree.py +0 -0
  257. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/MarkdownToDocx.py +0 -0
  258. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/MarkdownToPDF.py +0 -0
  259. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/Result.py +0 -0
  260. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/ResultsExportMixin.py +0 -0
  261. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/ResultsGGMixin.py +0 -0
  262. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/TableDisplay.py +0 -0
  263. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/TextEditor.py +0 -0
  264. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/__init__.py +0 -0
  265. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/file_exports.py +0 -0
  266. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/results_fetch_mixin.py +0 -0
  267. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/results_selector.py +0 -0
  268. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/results_tools_mixin.py +0 -0
  269. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/smart_objects.py +0 -0
  270. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/table_data_class.py +0 -0
  271. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/table_display.css +0 -0
  272. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/table_renderers.py +0 -0
  273. {edsl-0.1.43 → edsl-0.1.44}/edsl/results/tree_explore.py +0 -0
  274. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/ConstructDownloadLink.py +0 -0
  275. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/DocumentChunker.py +0 -0
  276. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/DocxScenario.py +0 -0
  277. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/PdfExtractor.py +0 -0
  278. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/Scenario.py +0 -0
  279. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/ScenarioHtmlMixin.py +0 -0
  280. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/ScenarioList.py +0 -0
  281. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/ScenarioListExportMixin.py +0 -0
  282. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/ScenarioListPdfMixin.py +0 -0
  283. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/__init__.py +0 -0
  284. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/directory_scanner.py +0 -0
  285. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/file_methods.py +0 -0
  286. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/__init__.py +0 -0
  287. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/csv.py +0 -0
  288. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/docx.py +0 -0
  289. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/html.py +0 -0
  290. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/json.py +0 -0
  291. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/latex.py +0 -0
  292. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/md.py +0 -0
  293. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/pdf.py +0 -0
  294. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/png.py +0 -0
  295. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/pptx.py +0 -0
  296. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/py.py +0 -0
  297. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/sql.py +0 -0
  298. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/sqlite.py +0 -0
  299. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/handlers/txt.py +0 -0
  300. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/scenario_join.py +0 -0
  301. {edsl-0.1.43 → edsl-0.1.44}/edsl/scenarios/scenario_selector.py +0 -0
  302. {edsl-0.1.43 → edsl-0.1.44}/edsl/shared.py +0 -0
  303. {edsl-0.1.43 → edsl-0.1.44}/edsl/study/ObjectEntry.py +0 -0
  304. {edsl-0.1.43 → edsl-0.1.44}/edsl/study/ProofOfWork.py +0 -0
  305. {edsl-0.1.43 → edsl-0.1.44}/edsl/study/SnapShot.py +0 -0
  306. {edsl-0.1.43 → edsl-0.1.44}/edsl/study/Study.py +0 -0
  307. {edsl-0.1.43 → edsl-0.1.44}/edsl/study/__init__.py +0 -0
  308. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/ConstructDAG.py +0 -0
  309. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/DAG.py +0 -0
  310. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/EditSurvey.py +0 -0
  311. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/InstructionHandler.py +0 -0
  312. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/Memory.py +0 -0
  313. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/MemoryManagement.py +0 -0
  314. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/MemoryPlan.py +0 -0
  315. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/Rule.py +0 -0
  316. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/RuleCollection.py +0 -0
  317. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/RuleManager.py +0 -0
  318. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/Simulator.py +0 -0
  319. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/SurveyCSS.py +0 -0
  320. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/SurveyExportMixin.py +0 -0
  321. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/SurveyFlowVisualization.py +0 -0
  322. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/SurveyQualtricsImport.py +0 -0
  323. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/SurveyToApp.py +0 -0
  324. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/__init__.py +0 -0
  325. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/base.py +0 -0
  326. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/descriptors.py +0 -0
  327. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/instructions/ChangeInstruction.py +0 -0
  328. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/instructions/Instruction.py +0 -0
  329. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/instructions/InstructionCollection.py +0 -0
  330. {edsl-0.1.43 → edsl-0.1.44}/edsl/surveys/instructions/__init__.py +0 -0
  331. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/base.html +0 -0
  332. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/exceptions_by_model.html +0 -0
  333. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/exceptions_by_question_name.html +0 -0
  334. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/exceptions_by_type.html +0 -0
  335. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/exceptions_table.html +0 -0
  336. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/interview_details.html +0 -0
  337. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/interviews.html +0 -0
  338. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/overview.html +0 -0
  339. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/performance_plot.html +0 -0
  340. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/report.css +0 -0
  341. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/report.html +0 -0
  342. {edsl-0.1.43 → edsl-0.1.44}/edsl/templates/error_reporting/report.js +0 -0
  343. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/__init__.py +0 -0
  344. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/clusters.py +0 -0
  345. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/embeddings.py +0 -0
  346. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/embeddings_plotting.py +0 -0
  347. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/plotting.py +0 -0
  348. {edsl-0.1.43 → edsl-0.1.44}/edsl/tools/summarize.py +0 -0
  349. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/PrettyList.py +0 -0
  350. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/SystemInfo.py +0 -0
  351. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/__init__.py +0 -0
  352. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/ast_utilities.py +0 -0
  353. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/data/Registry.py +0 -0
  354. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/data/__init__.py +0 -0
  355. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/data/scooter_results.json +0 -0
  356. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/decorators.py +0 -0
  357. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/gcp_bucket/__init__.py +0 -0
  358. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/gcp_bucket/cloud_storage.py +0 -0
  359. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/interface.py +0 -0
  360. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/is_notebook.py +0 -0
  361. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/is_valid_variable_name.py +0 -0
  362. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/naming_utilities.py +0 -0
  363. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/remove_edsl_version.py +0 -0
  364. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/repair_functions.py +0 -0
  365. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/restricted_python.py +0 -0
  366. {edsl-0.1.43 → edsl-0.1.44}/edsl/utilities/utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edsl
3
- Version: 0.1.43
3
+ Version: 0.1.44
4
4
  Summary: Create and analyze LLM-based surveys
5
5
  Home-page: https://www.expectedparrot.com/
6
6
  License: MIT
@@ -64,17 +64,26 @@ class PersistenceMixin:
64
64
  @classmethod
65
65
  def pull(
66
66
  cls,
67
- uuid: Optional[Union[str, UUID]] = None,
68
- url: Optional[str] = None,
69
- expected_parrot_url: Optional[str] = None,
67
+ url_or_uuid: Optional[Union[str, UUID]] = None,
68
+ #expected_parrot_url: Optional[str] = None,
70
69
  ):
71
- """Pull the object from coop."""
70
+ """Pull the object from coop.
71
+
72
+ Args:
73
+ url_or_uuid: Either a UUID string or a URL pointing to the object
74
+ expected_parrot_url: Optional URL for the Parrot server
75
+ """
72
76
  from edsl.coop import Coop
73
77
  from edsl.coop.utils import ObjectRegistry
74
78
 
75
79
  object_type = ObjectRegistry.get_object_type_by_edsl_class(cls)
76
- coop = Coop(url=expected_parrot_url)
77
- return coop.get(uuid, url, object_type)
80
+ coop = Coop()
81
+
82
+ # Determine if input is URL or UUID
83
+ if url_or_uuid and ("http://" in str(url_or_uuid) or "https://" in str(url_or_uuid)):
84
+ return coop.get(url=url_or_uuid, expected_object_type=object_type)
85
+ else:
86
+ return coop.get(uuid=url_or_uuid, expected_object_type=object_type)
78
87
 
79
88
  @classmethod
80
89
  def delete(cls, uuid: Optional[Union[str, UUID]] = None, url: Optional[str] = None):
@@ -0,0 +1 @@
1
+ __version__ = "0.1.44"
@@ -4,10 +4,8 @@ import requests
4
4
 
5
5
  from typing import Any, Optional, Union, Literal, TypedDict
6
6
  from uuid import UUID
7
- from collections import UserDict, defaultdict
8
7
 
9
8
  import edsl
10
- from pathlib import Path
11
9
 
12
10
  from edsl.config import CONFIG
13
11
  from edsl.data.CacheEntry import CacheEntry
@@ -340,7 +338,7 @@ class Coop(CoopFunctionsMixin):
340
338
 
341
339
  try:
342
340
  response = self._send_server_request(
343
- uri="api/v0/edsl-settings", method="GET", timeout=5
341
+ uri="api/v0/edsl-settings", method="GET", timeout=20
344
342
  )
345
343
  self._resolve_server_response(response, check_api_key=False)
346
344
  return response.json()
@@ -866,6 +864,40 @@ class Coop(CoopFunctionsMixin):
866
864
  "usd": response_json.get("cost_in_usd"),
867
865
  }
868
866
 
867
+ ################
868
+ # PROJECTS
869
+ ################
870
+ def create_project(
871
+ self,
872
+ survey: Survey,
873
+ project_name: str,
874
+ survey_description: Optional[str] = None,
875
+ survey_alias: Optional[str] = None,
876
+ survey_visibility: Optional[VisibilityType] = "unlisted",
877
+ ):
878
+ """
879
+ Create a survey object on Coop, then create a project from the survey.
880
+ """
881
+ survey_details = self.create(
882
+ object=survey,
883
+ description=survey_description,
884
+ alias=survey_alias,
885
+ visibility=survey_visibility,
886
+ )
887
+ survey_uuid = survey_details.get("uuid")
888
+ response = self._send_server_request(
889
+ uri=f"api/v0/projects/create-from-survey",
890
+ method="POST",
891
+ payload={"project_name": project_name, "survey_uuid": str(survey_uuid)},
892
+ )
893
+ self._resolve_server_response(response)
894
+ response_json = response.json()
895
+ return {
896
+ "name": response_json.get("project_name"),
897
+ "uuid": response_json.get("uuid"),
898
+ "url": f"{self.url}/home/projects/{response_json.get('uuid')}",
899
+ }
900
+
869
901
  ################
870
902
  # DUNDER METHODS
871
903
  ################
@@ -67,6 +67,7 @@ class InferenceServiceType(EnumWithChecks):
67
67
  TOGETHER = "together"
68
68
  PERPLEXITY = "perplexity"
69
69
  DEEPSEEK = "deepseek"
70
+ GROK = "grok"
70
71
 
71
72
 
72
73
  # unavoidable violation of the DRY principle but it is necessary
@@ -86,6 +87,7 @@ InferenceServiceLiteral = Literal[
86
87
  "together",
87
88
  "perplexity",
88
89
  "deepseek",
90
+ "grok",
89
91
  ]
90
92
 
91
93
  available_models_urls = {
@@ -108,7 +110,8 @@ service_to_api_keyname = {
108
110
  InferenceServiceType.MISTRAL.value: "MISTRAL_API_KEY",
109
111
  InferenceServiceType.TOGETHER.value: "TOGETHER_API_KEY",
110
112
  InferenceServiceType.PERPLEXITY.value: "PERPLEXITY_API_KEY",
111
- InferenceServiceType.DEEPSEEK.value: "DEEPSEEK_API_KEY"
113
+ InferenceServiceType.DEEPSEEK.value: "DEEPSEEK_API_KEY",
114
+ InferenceServiceType.GROK.value: "XAI_API_KEY",
112
115
  }
113
116
 
114
117
 
@@ -17,6 +17,8 @@ class AnthropicService(InferenceServiceABC):
17
17
  output_token_name = "output_tokens"
18
18
  model_exclude_list = []
19
19
 
20
+ available_models_url = 'https://docs.anthropic.com/en/docs/about-claude/models'
21
+
20
22
  @classmethod
21
23
  def get_model_list(cls, api_key: str = None):
22
24
 
@@ -39,6 +39,8 @@ class GoogleService(InferenceServiceABC):
39
39
 
40
40
  model_exclude_list = []
41
41
 
42
+ available_models_url = 'https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models'
43
+
42
44
  @classmethod
43
45
  def get_model_list(cls):
44
46
  model_list = []
@@ -0,0 +1,11 @@
1
+ from typing import Any, List
2
+ from edsl.inference_services.OpenAIService import OpenAIService
3
+
4
+
5
+ class GrokService(OpenAIService):
6
+ """Openai service class."""
7
+
8
+ _inference_service_ = "grok"
9
+ _env_key_name_ = "XAI_API_KEY"
10
+ _base_url_ = "https://api.x.ai/v1"
11
+ _models_list_cache: List[str] = []
@@ -23,6 +23,7 @@ class InferenceServiceABC(ABC):
23
23
  "usage_sequence",
24
24
  "input_token_name",
25
25
  "output_token_name",
26
+ #"available_models_url",
26
27
  ]
27
28
  for attr in must_have_attributes:
28
29
  if not hasattr(cls, attr):
@@ -84,6 +84,7 @@ class OpenAIService(InferenceServiceABC):
84
84
 
85
85
  @classmethod
86
86
  def get_model_list(cls, api_key=None):
87
+ # breakpoint()
87
88
  if api_key is None:
88
89
  api_key = os.getenv(cls._env_key_name_)
89
90
  raw_list = cls.sync_client(api_key).models.list()
@@ -28,6 +28,7 @@ class TestService(InferenceServiceABC):
28
28
  model_exclude_list = []
29
29
  input_token_name = "prompt_tokens"
30
30
  output_token_name = "completion_tokens"
31
+ available_models_url = None
31
32
 
32
33
  @classmethod
33
34
  def available(cls) -> list[str]:
@@ -14,6 +14,7 @@ from edsl.inference_services.TestService import TestService
14
14
  from edsl.inference_services.TogetherAIService import TogetherAIService
15
15
  from edsl.inference_services.PerplexityService import PerplexityService
16
16
  from edsl.inference_services.DeepSeekService import DeepSeekService
17
+ from edsl.inference_services.GrokService import GrokService
17
18
 
18
19
  try:
19
20
  from edsl.inference_services.MistralAIService import MistralAIService
@@ -35,6 +36,7 @@ services = [
35
36
  TogetherAIService,
36
37
  PerplexityService,
37
38
  DeepSeekService,
39
+ GrokService,
38
40
  ]
39
41
 
40
42
  if mistral_available:
@@ -31,7 +31,7 @@ class JobsChecks:
31
31
  from edsl.language_models.model import Model
32
32
  from edsl.enums import service_to_api_keyname
33
33
 
34
- for model in self.jobs.models + [Model()]:
34
+ for model in self.jobs.models: # + [Model()]:
35
35
  if not model.has_valid_api_key():
36
36
  key_name = service_to_api_keyname.get(
37
37
  model._inference_service_, "NOT FOUND"
@@ -134,22 +134,22 @@ class JobsChecks:
134
134
 
135
135
  edsl_auth_token = secrets.token_urlsafe(16)
136
136
 
137
- print("You're missing some of the API keys needed to run this job:")
137
+ print("API keys are required to run surveys with language models. The following keys are needed to run this survey: ")
138
138
  for api_key in missing_api_keys:
139
139
  print(f" 🔑 {api_key}")
140
140
  print(
141
- "\nYou can either add the missing keys to your .env file, or use remote inference."
141
+ "\nYou can provide your own keys or use an Expected Parrot key to access all available models."
142
142
  )
143
- print("Remote inference allows you to run jobs on our server.")
143
+ print("Please see the documentation page to learn about options for managing keys: https://docs.expectedparrot.com/en/latest/api_keys.html")
144
144
 
145
145
  coop = Coop()
146
146
  coop._display_login_url(
147
147
  edsl_auth_token=edsl_auth_token,
148
- link_description="\n🚀 To use remote inference, sign up at the following link:",
148
+ link_description="\n➡️ Click the link below to create an account and get an Expected Parrot key:\n",
149
149
  )
150
150
 
151
151
  print(
152
- "\nOnce you log in, we will automatically retrieve your Expected Parrot API key and continue your job remotely."
152
+ "\nOnce you log in, your key will be stored on your computer and your survey will start running at the Expected Parrot server."
153
153
  )
154
154
 
155
155
  api_key = coop._poll_for_api_key(edsl_auth_token)
@@ -159,7 +159,7 @@ class JobsChecks:
159
159
  return
160
160
 
161
161
  path_to_env = write_api_key_to_env(api_key)
162
- print("\n✨ API key retrieved and written to .env file at the following path:")
162
+ print("\n✨ Your key has been stored at the following path: ")
163
163
  print(f" {path_to_env}")
164
164
 
165
165
  # Retrieve API key so we can continue running the job
@@ -200,10 +200,10 @@ class JobsPrompts:
200
200
  import warnings
201
201
 
202
202
  warnings.warn(
203
- "Price data could not be retrieved. Using default estimates for input and output token prices. Input: $0.15 / 1M tokens; Output: $0.60 / 1M tokens"
203
+ "Price data could not be retrieved. Using default estimates for input and output token prices. Input: $1.00 / 1M tokens; Output: $1.00 / 1M tokens"
204
204
  )
205
- input_price_per_token = 0.00000015 # $0.15 / 1M tokens
206
- output_price_per_token = 0.00000060 # $0.60 / 1M tokens
205
+ input_price_per_token = 0.000001 # $1.00 / 1M tokens
206
+ output_price_per_token = 0.000001 # $1.00 / 1M tokens
207
207
 
208
208
  # Compute the number of characters (double if the question involves piping)
209
209
  user_prompt_chars = len(str(user_prompt)) * get_piping_multiplier(
@@ -518,7 +518,11 @@ class LanguageModel(
518
518
  """
519
519
  from edsl.language_models.model import get_model_class
520
520
 
521
- model_class = get_model_class(data["model"])
521
+ # breakpoint()
522
+
523
+ model_class = get_model_class(
524
+ data["model"], service_name=data.get("inference_service", None)
525
+ )
522
526
  return model_class(**data)
523
527
 
524
528
  def __repr__(self) -> str:
@@ -574,7 +578,6 @@ class LanguageModel(
574
578
  return Model(skip_api_key_check=True)
575
579
 
576
580
  def from_cache(self, cache: "Cache") -> LanguageModel:
577
-
578
581
  from copy import deepcopy
579
582
  from types import MethodType
580
583
  from edsl import Cache
@@ -1,6 +1,6 @@
1
1
  import textwrap
2
2
  from random import random
3
- from typing import Optional, TYPE_CHECKING, List
3
+ from typing import Optional, TYPE_CHECKING, List, Callable
4
4
 
5
5
  from edsl.utilities.PrettyList import PrettyList
6
6
  from edsl.config import CONFIG
@@ -11,17 +11,21 @@ from edsl.inference_services.InferenceServicesCollection import (
11
11
  from edsl.inference_services.data_structures import AvailableModels
12
12
  from edsl.inference_services.InferenceServiceABC import InferenceServiceABC
13
13
  from edsl.enums import InferenceServiceLiteral
14
+ from edsl.exceptions.inference_services import InferenceServiceError
14
15
 
15
16
  if TYPE_CHECKING:
16
17
  from edsl.results.Dataset import Dataset
17
18
 
18
19
 
19
- def get_model_class(model_name, registry: Optional[InferenceServicesCollection] = None):
20
+ def get_model_class(model_name, registry: Optional[InferenceServicesCollection] = None, service_name: Optional[InferenceServiceLiteral] = None):
20
21
  from edsl.inference_services.registry import default
21
22
 
22
23
  registry = registry or default
23
- factory = registry.create_model_factory(model_name)
24
- return factory
24
+ try:
25
+ factory = registry.create_model_factory(model_name, service_name=service_name)
26
+ return factory
27
+ except (InferenceServiceError, Exception) as e:
28
+ return Model._handle_model_error(model_name, e)
25
29
 
26
30
 
27
31
  class Meta(type):
@@ -58,6 +62,33 @@ class Model(metaclass=Meta):
58
62
  """Set a new registry"""
59
63
  cls._registry = registry
60
64
 
65
+ @classmethod
66
+ def _handle_model_error(cls, model_name: str, error: Exception):
67
+ """Handle errors from model creation and execution with notebook-aware behavior."""
68
+ if isinstance(error, InferenceServiceError):
69
+ services = [s._inference_service_ for s in cls.get_registry().services]
70
+ message = (
71
+ f"Model '{model_name}' not found in any services.\n"
72
+ "It is likely that our registry is just out of date.\n"
73
+ "Simply adding the service name to your model call should fix this.\n"
74
+ f"Available services are: {services}\n"
75
+ f"To specify a model with a service, use:\n"
76
+ f'Model("{model_name}", service_name="<service_name>")'
77
+ )
78
+ else:
79
+ message = f"An error occurred: {str(error)}"
80
+
81
+ # Check if we're in a notebook environment
82
+ try:
83
+ get_ipython()
84
+ print(message)
85
+ return None
86
+ except NameError:
87
+ # Not in a notebook, raise the exception
88
+ if isinstance(error, InferenceServiceError):
89
+ raise InferenceServiceError(message)
90
+ raise error
91
+
61
92
  def __new__(
62
93
  cls,
63
94
  model_name: Optional[str] = None,
@@ -69,9 +100,7 @@ class Model(metaclass=Meta):
69
100
  "Instantiate a new language model."
70
101
  # Map index to the respective subclass
71
102
  if model_name is None:
72
- model_name = (
73
- cls.default_model
74
- ) # when model_name is None, use the default model, set in the config file
103
+ model_name = cls.default_model
75
104
 
76
105
  if registry is not None:
77
106
  cls.set_registry(registry)
@@ -79,10 +108,13 @@ class Model(metaclass=Meta):
79
108
  if isinstance(model_name, int): # can refer to a model by index
80
109
  model_name = cls.available(name_only=True)[model_name]
81
110
 
82
- factory = cls.get_registry().create_model_factory(
83
- model_name, service_name=service_name
84
- )
85
- return factory(*args, **kwargs)
111
+ try:
112
+ factory = cls.get_registry().create_model_factory(
113
+ model_name, service_name=service_name
114
+ )
115
+ return factory(*args, **kwargs)
116
+ except (InferenceServiceError, Exception) as e:
117
+ return cls._handle_model_error(model_name, e)
86
118
 
87
119
  @classmethod
88
120
  def add_model(cls, service_name, model_name) -> None:
@@ -1326,7 +1326,7 @@ class Results(UserList, Mixins, Base):
1326
1326
  except Exception as e:
1327
1327
  raise ResultsError(f"Failed to fetch remote results: {str(e)}")
1328
1328
 
1329
- def fetch(self, polling_interval: float = 1.0) -> Results:
1329
+ def fetch(self, polling_interval: [float, int] = 1.0) -> Results:
1330
1330
  """
1331
1331
  Polls the server for job completion and updates this Results instance with the completed data.
1332
1332
 
@@ -1346,6 +1346,7 @@ class Results(UserList, Mixins, Base):
1346
1346
  remote_job_data = JobsRemoteInferenceHandler.check_status(self.job_info.job_uuid)
1347
1347
 
1348
1348
  while remote_job_data.get("status") not in ["completed", "failed"]:
1349
+ print("Waiting for remote job to complete...")
1349
1350
  import time
1350
1351
  time.sleep(polling_interval)
1351
1352
  remote_job_data = JobsRemoteInferenceHandler.check_status(self.job_info.job_uuid)
@@ -9,7 +9,8 @@ from edsl.scenarios.Scenario import Scenario
9
9
  from edsl.utilities.remove_edsl_version import remove_edsl_version
10
10
 
11
11
  from edsl.scenarios.file_methods import FileMethods
12
-
12
+ from typing import Union
13
+ from uuid import UUID
13
14
 
14
15
  class FileStore(Scenario):
15
16
  __documentation__ = "https://docs.expectedparrot.com/en/latest/filestore.html"
@@ -262,7 +263,12 @@ class FileStore(Scenario):
262
263
  # raise TypeError("No text method found for this file type.")
263
264
 
264
265
  def push(
265
- self, description: Optional[str] = None, visibility: str = "unlisted"
266
+ self,
267
+ description: Optional[str] = None,
268
+ alias: Optional[str] = None,
269
+ visibility: Optional[str] = "unlisted",
270
+ expected_parrot_url: Optional[str] = None,
271
+
266
272
  ) -> dict:
267
273
  """
268
274
  Push the object to Coop.
@@ -272,17 +278,22 @@ class FileStore(Scenario):
272
278
  scenario_version = Scenario.from_dict(self.to_dict())
273
279
  if description is None:
274
280
  description = "File: " + self.path
275
- info = scenario_version.push(description=description, visibility=visibility)
281
+ info = scenario_version.push(description=description, visibility=visibility, expected_parrot_url=expected_parrot_url, alias=alias)
276
282
  return info
277
283
 
278
284
  @classmethod
279
- def pull(cls, uuid: str, expected_parrot_url: Optional[str] = None) -> "FileStore":
285
+ def pull(cls, url_or_uuid: Union[str, UUID]) -> "FileStore":
280
286
  """
281
- :param uuid: The UUID of the object to pull.
282
- :param expected_parrot_url: The URL of the Parrot server to use.
283
- :return: The object pulled from the Parrot server.
287
+ Pull a FileStore object from Coop.
288
+
289
+ Args:
290
+ url_or_uuid: Either a UUID string or a URL pointing to the object
291
+ expected_parrot_url: Optional URL for the Parrot server
292
+
293
+ Returns:
294
+ FileStore: The pulled FileStore object
284
295
  """
285
- scenario_version = Scenario.pull(uuid, expected_parrot_url=expected_parrot_url)
296
+ scenario_version = Scenario.pull(url_or_uuid)
286
297
  return cls.from_dict(scenario_version.to_dict())
287
298
 
288
299
  @classmethod
@@ -942,12 +942,11 @@ class Survey(SurveyExportMixin, Base):
942
942
  # TODO: temp fix by creating a cache
943
943
  if cache is None:
944
944
  from edsl.data import Cache
945
+
945
946
  c = Cache()
946
947
  else:
947
948
  c = cache
948
949
 
949
-
950
-
951
950
  jobs: "Jobs" = self.get_job(model=model, agent=agent, **kwargs).using(c)
952
951
  return await jobs.run_async(
953
952
  disable_remote_inference=disable_remote_inference,
@@ -1244,6 +1243,28 @@ class Survey(SurveyExportMixin, Base):
1244
1243
 
1245
1244
  return self.by(s).by(agent).by(model)
1246
1245
 
1246
+ ###################
1247
+ # COOP METHODS
1248
+ ###################
1249
+ def humanize(
1250
+ self,
1251
+ project_name: str,
1252
+ survey_description: Optional[str] = None,
1253
+ survey_alias: Optional[str] = None,
1254
+ survey_visibility: Optional["VisibilityType"] = "unlisted",
1255
+ ):
1256
+ """
1257
+ Create a survey object on Coop.
1258
+ Then, create a project on Coop so you can share the survey with humans.
1259
+ """
1260
+ from edsl.coop import Coop
1261
+
1262
+ c = Coop()
1263
+ project_details = c.create_project(
1264
+ self, project_name, survey_description, survey_alias, survey_visibility
1265
+ )
1266
+ return project_details
1267
+
1247
1268
 
1248
1269
  def main():
1249
1270
  """Run the example survey."""
@@ -1255,16 +1276,16 @@ def main():
1255
1276
  q0 = QuestionMultipleChoice(
1256
1277
  question_name="q0",
1257
1278
  question_text="What is the capital of France?",
1258
- question_options=["London", "Paris", "Rome", "Boston", "I don't know"]
1279
+ question_options=["London", "Paris", "Rome", "Boston", "I don't know"],
1259
1280
  )
1260
1281
  q1 = QuestionList(
1261
1282
  question_name="q1",
1262
1283
  question_text="Name some cities in France.",
1263
- max_list_items = 5
1284
+ max_list_items=5,
1264
1285
  )
1265
1286
  q2 = QuestionNumerical(
1266
1287
  question_name="q2",
1267
- question_text="What is the population of {{ q0.answer }}?"
1288
+ question_text="What is the population of {{ q0.answer }}?",
1268
1289
  )
1269
1290
  s = Survey(questions=[q0, q1, q2])
1270
1291
  s = s.add_rule(q0, "q0 == 'Paris'", q2)
@@ -1281,4 +1302,4 @@ if __name__ == "__main__":
1281
1302
  import doctest
1282
1303
 
1283
1304
  # doctest.testmod(optionflags=doctest.ELLIPSIS | doctest.SKIP)
1284
- doctest.testmod(optionflags=doctest.ELLIPSIS)
1305
+ doctest.testmod(optionflags=doctest.ELLIPSIS)
@@ -13,7 +13,7 @@ keywords = [ "LLM", "social science", "surveys", "user research",]
13
13
  license = "MIT"
14
14
  name = "edsl"
15
15
  readme = "README.md"
16
- version = "0.1.43"
16
+ version = "0.1.44"
17
17
 
18
18
  [tool.poetry.dependencies]
19
19
  python = ">=3.9.1,<3.13"
@@ -1 +0,0 @@
1
- __version__ = "0.1.43"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes