LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
Pythonlangsmithrun_treesRunTreefrom_headers
Method●Since v0.1

from_headers

Create a new 'parent' span from the provided headers.

Extracts parent span information from the headers and creates a new span.

Metadata and tags are extracted from the baggage header.

The dotted order and trace id are extracted from the trace header.

Copy
from_headers(
  cls,
  headers: Mapping[Union[str, bytes], Union[str, bytes]],
  **kwargs: Any = {}
) -> Optional[RunTree]
View source on GitHub