mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 06:33:41 +00:00
cr
This commit is contained in:
@@ -94,7 +94,9 @@ def trace_as_chain_group(
|
||||
manager.on_chain_end({"output": res})
|
||||
```
|
||||
"""
|
||||
from langchain_core.tracers.context import _get_trace_callbacks # noqa: PLC0415
|
||||
from langchain_core.tracers.context import ( # noqa: PLC0415 -- deferred to avoid importing langsmith at module level
|
||||
_get_trace_callbacks,
|
||||
)
|
||||
|
||||
cb = _get_trace_callbacks(
|
||||
project_name, example_id, callback_manager=callback_manager
|
||||
@@ -175,7 +177,9 @@ async def atrace_as_chain_group(
|
||||
await manager.on_chain_end({"output": res})
|
||||
```
|
||||
"""
|
||||
from langchain_core.tracers.context import _get_trace_callbacks # noqa: PLC0415
|
||||
from langchain_core.tracers.context import ( # noqa: PLC0415 -- deferred to avoid importing langsmith at module level
|
||||
_get_trace_callbacks,
|
||||
)
|
||||
|
||||
cb = _get_trace_callbacks(
|
||||
project_name, example_id, callback_manager=callback_manager
|
||||
@@ -2319,6 +2323,7 @@ def _configure(
|
||||
Returns:
|
||||
The configured callback manager.
|
||||
"""
|
||||
# Deferred to avoid importing langsmith at module level (~132ms).
|
||||
from langsmith.run_helpers import get_tracing_context # noqa: PLC0415
|
||||
|
||||
from langchain_core.tracers.context import ( # noqa: PLC0415
|
||||
|
||||
@@ -158,6 +158,7 @@ def _set_config_context(
|
||||
Returns:
|
||||
The token to reset the config and the previous tracing context.
|
||||
"""
|
||||
# Deferred to avoid importing langsmith at module level (~132ms).
|
||||
from langsmith.run_helpers import ( # noqa: PLC0415
|
||||
_set_tracing_context,
|
||||
get_tracing_context,
|
||||
@@ -199,6 +200,7 @@ def set_config_context(config: RunnableConfig) -> Generator[Context, None, None]
|
||||
Yields:
|
||||
The config context.
|
||||
"""
|
||||
# Deferred to avoid importing langsmith at module level (~132ms).
|
||||
from langsmith.run_helpers import _set_tracing_context # noqa: PLC0415
|
||||
|
||||
ctx = copy_context()
|
||||
|
||||
Reference in New Issue
Block a user