Skip to content

Commit

Permalink
enhance langchain tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard committed Jan 17, 2024
1 parent 179c89c commit 320e161
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backend/chainlit/langchain/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def _build_llm_settings(
return provider, settings


DEFAULT_TO_IGNORE = ["RunnableSequence", "RunnableParallel", "<lambda>"]
DEFAULT_TO_IGNORE = ["Runnable", "<lambda>"]
DEFAULT_TO_KEEP = ["retriever", "llm", "agent", "chain", "tool"]


Expand Down Expand Up @@ -442,9 +442,14 @@ def _should_ignore_run(self, run: Run):
# so we can re-attach a kept child to the right parent id
self.parent_id_map[str(run.id)] = parent_id

ignore_by_name = run.name in self.to_ignore
ignore_by_name = False
ignore_by_parent = parent_id in self.ignored_runs

for filter in self.to_ignore:
if filter in run.name:
ignore_by_name = True
break

ignore = ignore_by_name or ignore_by_parent

# If the ignore cause is the parent being ignored, check if we should nonetheless keep the child
Expand Down

0 comments on commit 320e161

Please sign in to comment.