middleware.tracing_notebook¶
Notebook helpers that live-render correlated LangChain turn traces.
Classes¶
Render trace sink snapshots in a notebook cell. |
|
Own a recorder and live-render notebook trace updates. |
Module Contents¶
- class middleware.tracing_notebook.NotebookTraceRenderer(sink: middleware.tracing.TraceSink, *, heading: str = 'Trace')¶
Render trace sink snapshots in a notebook cell.
- sink¶
- heading = 'Trace'¶
- class middleware.tracing_notebook.LiveNotebookTrace(*, heading: str = 'Trace', max_events: int = 500, refresh_interval_seconds: float = 0.25)¶
Own a recorder and live-render notebook trace updates.
- sink¶
- recorder¶
- renderer¶
- refresh_interval_seconds = 0.25¶
- property callbacks: tuple[middleware.tracing.TraceRecorder, Ellipsis]¶
Return callback handlers suitable for LangChain config injection.
- attach(runnable: Any) Any¶
Return a runnable configured with this trace recorder.
- dump(path: str | pathlib.Path | os.PathLike[str] | None = None, *, indent: int | None = 2) str¶
Persist correlated
TurnTracerows as JSON.When
pathisNone, returns the transcript as a string and does not write to disk. Otherwise writes UTF-8 JSON and returns the path as a string.