Skip to content

Commit aa715ba

Browse files
authored
fix: avoid external chat miss trace id (#682)
1 parent cdc3190 commit aa715ba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/app/rag/chat/chat_flow.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,9 @@ def _chat_finish(
626626
# TODO: Separate _external_chat() method into another ExternalChatFlow class, but at the same time, we need to
627627
# share some common methods through ChatMixin or BaseChatFlow.
628628
def _external_chat(self) -> Generator[ChatEvent | str, None, None]:
629+
ctx = langfuse_instrumentor_context.get().copy()
629630
db_user_message, db_assistant_message = yield from self._chat_start()
631+
langfuse_instrumentor_context.get().update(ctx)
630632

631633
cache_messages = None
632634
goal, response_format = self.user_question, {}

0 commit comments

Comments
 (0)