Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/chainlit/emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async def send_window_message(self, data: Any):
"""Stub method to send custom data to the host window."""
pass

def send_toast(self, message: str, type: Optional[ToastType] = "info"):
async def send_toast(self, message: str, type: Optional[ToastType] = "info"):
"""Stub method to send a toast message to the UI."""
pass

Expand Down Expand Up @@ -465,9 +465,9 @@ def send_window_message(self, data: Any):
"""Send custom data to the host window."""
return self.emit("window_message", data)

def send_toast(self, message: str, type: Optional[ToastType] = "info"):
async def send_toast(self, message: str, type: Optional[ToastType] = "info"):
"""Send a toast message to the UI."""
# check that the type is valid using ToastType
if type not in get_args(ToastType):
raise ValueError(f"Invalid toast type: {type}")
return self.emit("toast", {"message": message, "type": type})
await self.emit("toast", {"message": message, "type": type})
Loading