Skip to content

Commit

Permalink
Merge branch 'main' of github.com:expectedparrot/edsl into q113
Browse files Browse the repository at this point in the history
  • Loading branch information
rbyh committed Jan 18, 2025
2 parents 6f1df28 + 4013d70 commit bcfc9c2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5,902 deletions.
2 changes: 1 addition & 1 deletion edsl/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.40.dev1"
__version__ = "0.1.41.dev1"
18 changes: 14 additions & 4 deletions edsl/jobs/interviews/InterviewExceptionEntry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import traceback
import datetime
from edsl.agents.InvigilatorBase import InvigilatorBase


class InterviewExceptionEntry:
Expand All @@ -9,7 +10,7 @@ def __init__(
self,
*,
exception: Exception,
invigilator: "Invigilator",
invigilator: "InvigilatorBase",
traceback_format="text",
answers=None,
):
Expand All @@ -20,6 +21,8 @@ def __init__(
self.traceback_format = traceback_format
self.answers = answers

# breakpoint()

@property
def question_type(self):
# return self.failed_question.question.question_type
Expand Down Expand Up @@ -163,20 +166,27 @@ def to_dict(self) -> dict:
>>> entry = InterviewExceptionEntry.example()
>>> _ = entry.to_dict()
"""
return {
invigilator = (
self.invigilator.to_dict() if self.invigilator is not None else None
)
d = {
"exception": self.serialize_exception(self.exception),
"time": self.time,
"traceback": self.traceback,
"invigilator": self.invigilator.to_dict(),
"invigilator": invigilator,
}
return d

@classmethod
def from_dict(cls, data: dict) -> "InterviewExceptionEntry":
"""Create an InterviewExceptionEntry from a dictionary."""
from edsl.agents.Invigilator import InvigilatorAI

exception = cls.deserialize_exception(data["exception"])
invigilator = InvigilatorAI.from_dict(data["invigilator"])
if data["invigilator"] is None:
invigilator = None
else:
invigilator = InvigilatorAI.from_dict(data["invigilator"])
return cls(exception=exception, invigilator=invigilator)


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keywords = [ "LLM", "social science", "surveys", "user research",]
license = "MIT"
name = "edsl"
readme = "README.md"
version = "0.1.40.dev1"
version = "0.1.41.dev1"

[tool.poetry.dependencies]
python = ">=3.9.1,<3.13"
Expand Down
Loading

0 comments on commit bcfc9c2

Please sign in to comment.