From 653fc5851de3cc5696a1373c4bc9640510d5bda3 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Mon, 30 Oct 2023 16:09:50 -0700 Subject: [PATCH] fix: Fix serialization error caused by ignored field in ErrorInfo object - Change `ErrorInfo` class attribute `_repr` to `repr` for consistent serialization - Update `__repr__` method to return `self.repr` instead of `self._repr` --- autogpts/autogpt/autogpt/models/action_history.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogpts/autogpt/autogpt/models/action_history.py b/autogpts/autogpt/autogpt/models/action_history.py index 01ab47171bfb..a5ed8f28ff21 100644 --- a/autogpts/autogpt/autogpt/models/action_history.py +++ b/autogpts/autogpt/autogpt/models/action_history.py @@ -30,7 +30,7 @@ class ErrorInfo(BaseModel): args: tuple message: str exception_type: str - _repr: str + repr: str @staticmethod def from_exception(exception: Exception) -> ErrorInfo: @@ -38,14 +38,14 @@ def from_exception(exception: Exception) -> ErrorInfo: args=exception.args, message=getattr(exception, "message", exception.args[0]), exception_type=exception.__class__.__name__, - _repr=repr(exception), + repr=repr(exception), ) def __str__(self): return repr(self) def __repr__(self): - return self._repr + return self.repr class ActionErrorResult(BaseModel):