Skip to content

Commit 0d93065

Browse files
committed
fix: better naming for clarity
1 parent 4ca077c commit 0d93065

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

posthog/ai/langchain/callbacks.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def on_chain_end(
212212
self._pop_parent_of_run(run_id)
213213

214214
if parent_run_id is None:
215-
self._capture_trace(run_id, outputs=outputs)
215+
self._pop_trace_and_capture(run_id, outputs=outputs)
216216

217217
def on_chain_error(
218218
self,
@@ -226,7 +226,7 @@ def on_chain_error(
226226
self._pop_parent_of_run(run_id)
227227

228228
if parent_run_id is None:
229-
self._capture_trace(run_id, outputs=None)
229+
self._pop_trace_and_capture(run_id, outputs=None)
230230

231231
def on_llm_end(
232232
self,
@@ -465,7 +465,7 @@ def _get_langchain_run_name(self, serialized: Optional[Dict[str, Any]], **kwargs
465465
except (KeyError, TypeError):
466466
pass
467467

468-
def _capture_trace(self, run_id: UUID, *, outputs: Optional[Dict[str, Any]]):
468+
def _pop_trace_and_capture(self, run_id: UUID, *, outputs: Optional[Dict[str, Any]]):
469469
trace_id = self._get_trace_id(run_id)
470470
run = self._pop_run_metadata(run_id)
471471
if not run:

0 commit comments

Comments
 (0)