Skip to content

Commit

Permalink
Fix forward annotations evaluation issue in chainlit.config (#1564)
Browse files Browse the repository at this point in the history
Big shout out to @Viicos for support building awesome pydantic.
  • Loading branch information
Viicos authored Dec 3, 2024
1 parent 3f31454 commit 1000c91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/chainlit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1000c91

Please sign in to comment.