A tracer implementation that records to LangChain endpoint.
Allowlist of LangSmith-only tracing metadata keys that bypass the default "first wins" merge semantics used when propagating tracer metadata to nested runs.
Keys in this set are ALWAYS overridden by the nearest enclosing tracer config, so nested callers (e.g. a subagent) can replace a value inherited from an ancestor.
Keep this list very small: every key here loses the default "first wins" protection and is always clobbered by the nearest enclosing tracer config. Only keys that are strictly for LangSmith tracing bookkeeping should be added.
Get information about the LangChain runtime environment.
Return a dict representation of an object.
Recursively add two UsageMetadata objects.
Construct run without validation, compatible with both Pydantic v1 and v2.
Convert run to dict, compatible with both Pydantic v1 and v2.
Log an error once.
Wait for all tracers to finish.
Get the client.
Usage metadata for a message, such as token counts.
This is a standard representation of token usage that is consistent across models.
Base interface for tracers.
Base abstract message class.
Messages are the inputs and outputs of a chat model.
Examples include HumanMessage,
AIMessage, and
SystemMessage.
ChatGeneration chunk.
ChatGeneration chunks can be concatenated with other ChatGeneration chunks.
GenerationChunk, which can be concatenated with other Generation chunks.
Implementation of the SharedTracer that POSTS to the LangChain endpoint.