From d9b3d96c07cd417446c7410d2d016d94af2db690 Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:32:34 -0700 Subject: [PATCH] Update to rm collect_runs --- .../tracing/trace_with_langchain.mdx | 64 ++----------------- 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/versioned_docs/version-2.0/how_to_guides/tracing/trace_with_langchain.mdx b/versioned_docs/version-2.0/how_to_guides/tracing/trace_with_langchain.mdx index af747802..43df97fe 100644 --- a/versioned_docs/version-2.0/how_to_guides/tracing/trace_with_langchain.mdx +++ b/versioned_docs/version-2.0/how_to_guides/tracing/trace_with_langchain.mdx @@ -194,60 +194,6 @@ await chain.invoke({ input: "What is the meaning of life?" }, {runName: "MyCusto groupId="client-language" /> -## Access run (span) ID for LangChain invocations - -When you invoke a LangChain object, you can access the run ID of the invocation. This run ID can be used to query the run in LangSmith. - -In Python, you can use the `collect_runs` context manager to access the run ID. - -In JS/TS, you can use a `RunCollectorCallbackHandler` instance to access the run ID. - - - ## Ensure all traces are submitted before exiting In LangChain Python, LangSmith's tracing is done in a background thread to avoid obstructing your production application. This means that your process may end before all traces are successfully posted to LangSmith. This is especially prevalent in a serverless environment, where your VM may be terminated immediately once your chain or agent completes. @@ -300,9 +246,9 @@ This largely builds off of the [previous section](#trace-selectively).