diff --git a/backend/chainlit/config.py b/backend/chainlit/config.py index 5a0d2c4178..baaab7841a 100644 --- a/backend/chainlit/config.py +++ b/backend/chainlit/config.py @@ -35,7 +35,11 @@ from chainlit.message import Message from chainlit.types import ChatProfile, InputAudioChunk, Starter, ThreadDict from chainlit.user import User - +else: + # Pydantic needs to resolve forward annotations. Because all of these are used + # within `typing.Callable`, alias to `Any` as Pydantic does not perform validation + # of callable argument/return types anyway. + Request = Response = Action = Message = ChatProfile = InputAudioChunk = Starter = ThreadDict = User = Any # fmt: off BACKEND_ROOT = os.path.dirname(__file__) PACKAGE_ROOT = os.path.dirname(os.path.dirname(BACKEND_ROOT))