From d46ff659740101217250e4d0f8876cf743e1476d Mon Sep 17 00:00:00 2001 From: wuyiqunLu <132986242+wuyiqunLu@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:51:57 +0800 Subject: [PATCH] feat: make logs json searializable (#227) * feat: make logs json searializable * change to json format * remove unused pkg * fix lint --- vision_agent/utils/execute.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vision_agent/utils/execute.py b/vision_agent/utils/execute.py index 0de10335..7967367e 100644 --- a/vision_agent/utils/execute.py +++ b/vision_agent/utils/execute.py @@ -243,6 +243,9 @@ def __str__(self) -> str: f"----- stdout -----\n{stdout_str}\n----- stderr -----\n{stderr_str}" ) + def to_json(self) -> dict[str, list[str]]: + return {"stdout": self.stdout, "stderr": self.stderr} + class Error(BaseModel): """Represents an error that occurred during the execution of a cell. The error