Skip to content

Commit 2c98b11

Browse files
committed
push
1 parent dfa5185 commit 2c98b11

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

langfuse/langchain/CallbackHandler.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -858,11 +858,14 @@ def __on_llm_action(
858858
registered_prompt = self._prompt_to_parent_run_map.get(
859859
current_parent_run_id
860860
)
861-
if registered_prompt is not None:
861+
862+
if registered_prompt:
863+
self._deregister_langfuse_prompt(current_parent_run_id)
862864
break
863-
current_parent_run_id = self._child_to_parent_run_id_map.get(
864-
current_parent_run_id
865-
)
865+
else:
866+
current_parent_run_id = self._child_to_parent_run_id_map.get(
867+
current_parent_run_id, None
868+
)
866869

867870
content = {
868871
"name": self.get_langchain_run_name(serialized, **kwargs),

0 commit comments

Comments
 (0)