diff --git a/backend/chainlit/message.py b/backend/chainlit/message.py index dafca7e565..597320a5f2 100644 --- a/backend/chainlit/message.py +++ b/backend/chainlit/message.py @@ -1,6 +1,5 @@ import asyncio import json -import time import uuid from abc import ABC from typing import Dict, List, Optional, Union, cast @@ -218,7 +217,6 @@ def __init__( parent_id: Optional[str] = None, created_at: Union[str, None] = None, ): - time.sleep(0.001) self.language = language if isinstance(content, dict): try: diff --git a/backend/chainlit/socket.py b/backend/chainlit/socket.py index fefd08d34d..b8189a2f14 100644 --- a/backend/chainlit/socket.py +++ b/backend/chainlit/socket.py @@ -1,6 +1,5 @@ import asyncio import json -import time from typing import Any, Dict, Literal, Optional, Tuple, Union from urllib.parse import unquote @@ -258,8 +257,6 @@ async def process_message(session: WebsocketSession, payload: MessagePayload): message = await context.emitter.process_message(payload) if config.code.on_message: - # Sleep 1ms to make sure any children step starts after the message step start - time.sleep(0.001) await config.code.on_message(message) except asyncio.CancelledError: pass diff --git a/backend/chainlit/step.py b/backend/chainlit/step.py index b96e871f44..0253348788 100644 --- a/backend/chainlit/step.py +++ b/backend/chainlit/step.py @@ -1,7 +1,6 @@ import asyncio import inspect import json -import time import uuid from copy import deepcopy from functools import wraps @@ -192,7 +191,6 @@ def __init__( thread_id: Optional[str] = None, ): trace_event(f"init {self.__class__.__name__} {type}") - time.sleep(0.001) self._input = "" self._output = "" self.thread_id = thread_id or context.session.thread_id