Skip to content

Commit

Permalink
helper for lamdas
Browse files Browse the repository at this point in the history
  • Loading branch information
jalexanderII committed Jun 4, 2024
1 parent 06466ac commit 66ad742
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions parea/utils/trace_integrations/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def _persist_run(self, run: Union[Run, LLMRun, ChainRun, ToolRun]) -> None:
# check if run has an attribute execution order
if hasattr(run, "execution_order") and run.execution_order == 1:
data["_parea_parent_trace_id"] = self._parea_parent_trace_id or None
else:
logger.warning("Execution order is not set for Langchain. May not be able to connect root trace.")
parea_logger.record_vendor_log(data, TraceIntegrations.LANGCHAIN)

def get_parent_trace_id(self) -> UUID:
Expand All @@ -44,8 +42,6 @@ def _on_run_create(self, run: Run) -> None:
if parent_trace_id := get_current_trace_id():
self._parea_parent_trace_id = parent_trace_id
fill_trace_data(str(run.id), {"parent_trace_id": parent_trace_id}, UpdateTraceScenario.LANGCHAIN_CHILD)
else:
logger.warning("Execution order is not set for Langchain. May not be able to connect root trace.")

def _on_llm_end(self, run: Run) -> None:
self._persist_run(run)
Expand Down

0 comments on commit 66ad742

Please sign in to comment.