LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Traceable
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerTraceableJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmithtraceablegetCurrentRunTree
Function●Since v0.1

getCurrentRunTree

Return the current run tree from within a traceable-wrapped function. Will throw an error if called outside of a traceable function.

Copy
getCurrentRunTree(): RunTree

Used in Docs

  • Access the current run (span) within a traced function
  • Add metadata and tags to traces
  • Cost tracking
  • Implement distributed tracing
View source on GitHub