Function getLangchainCallbacks

  • Converts the current run tree active within a traceable-wrapped function into a LangChain compatible callback manager. This is useful to handoff tracing from LangSmith to LangChain Runnables and LLMs.

    Parameters

    • OptionalcurrentRunTree: RunTree

      Current RunTree from within a traceable-wrapped function. If not provided, the current run tree will be inferred from AsyncLocalStorage.

    Returns Promise<undefined | CallbackManager>

    Callback manager used by LangChain Runnable objects.