diff --git a/backend/chainlit/message.py b/backend/chainlit/message.py index 0700f630a7..0b6171a767 100644 --- a/backend/chainlit/message.py +++ b/backend/chainlit/message.py @@ -59,7 +59,7 @@ def __post_init__(self) -> None: self.id = str(uuid.uuid4()) @classmethod - def from_dict(self, _dict: StepDict): + def from_dict(cls, _dict: StepDict): type = _dict.get("type", "assistant_message") return Message( id=_dict["id"], diff --git a/backend/chainlit/step.py b/backend/chainlit/step.py index 1604bac8af..ee951e39f8 100644 --- a/backend/chainlit/step.py +++ b/backend/chainlit/step.py @@ -123,7 +123,7 @@ async def async_wrapper(*args, **kwargs): logger.exception(e) result = await func(*args, **kwargs) try: - if result and not step.output: + if result is not None and not step.output: step.output = result except Exception as e: step.is_error = True @@ -154,7 +154,7 @@ def sync_wrapper(*args, **kwargs): logger.exception(e) result = func(*args, **kwargs) try: - if result and not step.output: + if result is not None and not step.output: step.output = result except Exception as e: step.is_error = True