Set the tracing context for a block of code.
tracing_context(
*,
project_name: Optional[str] = None,
tags: Optional[list[str]] = None,
metadata: Optional[dict[str, Any]] = None,
parent: Optional[Union[run_trees.RunTree, Mapping, str, Literal[False]]] = None,
enabled: Optional[Union[bool, Literal['local']]] = None,
client: Optional[ls_client.Client] = None,
replicas: Optional[Sequence[WriteReplica]] = None,
distributed_parent_id: Optional[str] = None,
**kwargs: Any = {}
) -> Generator[None, None, None]| Name | Type | Description |
|---|---|---|
project_name | Optional[str] | Default: NoneThe name of the project to log the run to. |
tags | Optional[list[str]] | Default: NoneThe tags to add to the run. |
metadata | Optional[dict[str, Any]] | Default: NoneThe metadata to add to the run. |
parent | Optional[Union[run_trees.RunTree, Mapping, str, Literal[False]]] | Default: NoneThe parent run to use for the context. Can be a Run/ |
client | Optional[ls_client.Client] | Default: NoneThe client to use for logging the run to LangSmith. |
enabled | Optional[Union[bool, Literal['local']]] | Default: NoneWhether tracing is enabled. Defaults to |
replicas | Optional[Sequence[WriteReplica]] | Default: NoneA sequence of Example: |
distributed_parent_id | Optional[str] | Default: NoneThe distributed parent ID for distributed tracing. Defaults to None. |