diff --git a/ragna/deploy/_ui/central_view.py b/ragna/deploy/_ui/central_view.py index dc2b7bd2..811d24d8 100644 --- a/ragna/deploy/_ui/central_view.py +++ b/ragna/deploy/_ui/central_view.py @@ -162,7 +162,7 @@ def _build_message(self, *args, **kwargs) -> Optional[RagnaChatMessage]: # We only ever hit this function for user inputs, since we control the # generation of the system and assistant messages manually. Thus, we can # unconditionally create a user message here. - return RagnaChatMessage(message.object, role="user", user=self.user) + return RagnaChatMessage(message.object, role="user", user=pn.state.user) class CentralView(pn.viewable.Viewer): @@ -300,7 +300,7 @@ def get_user_from_role(self, role: Literal["system", "user", "assistant"]) -> st if role == "system": return "Ragna" elif role == "user": - return cast(str, self.user) + return cast(str, pn.state.user) elif role == "assistant": return cast(str, self.current_chat["assistant"]) else: @@ -368,7 +368,7 @@ def chat_interface(self): for message in self.current_chat["messages"] ], callback=self.chat_callback, - user=self.user, + user=pn.state.user, get_user_from_role=self.get_user_from_role, show_rerun=False, show_undo=False,