diff --git a/backend/app/rag/chat/chat_flow.py b/backend/app/rag/chat/chat_flow.py index 9e5db21ec..cc3de307d 100644 --- a/backend/app/rag/chat/chat_flow.py +++ b/backend/app/rag/chat/chat_flow.py @@ -626,7 +626,9 @@ def _chat_finish( # TODO: Separate _external_chat() method into another ExternalChatFlow class, but at the same time, we need to # share some common methods through ChatMixin or BaseChatFlow. def _external_chat(self) -> Generator[ChatEvent | str, None, None]: + ctx = langfuse_instrumentor_context.get().copy() db_user_message, db_assistant_message = yield from self._chat_start() + langfuse_instrumentor_context.get().update(ctx) cache_messages = None goal, response_format = self.user_question, {}