[Core] Add more interops tests (#26841)

To test that the client propagates both ways
This commit is contained in:
William FH
2024-09-24 20:18:20 -07:00
committed by GitHub
parent 9b6ac41442
commit 82b5b77940
5 changed files with 36 additions and 18 deletions

View File

@@ -2333,7 +2333,11 @@ def _configure(
try:
handler = LangChainTracer(
project_name=tracer_project,
client=run_tree.client if run_tree is not None else None,
client=(
run_tree.client
if run_tree is not None
else tracing_context["client"]
),
)
callback_manager.add_handler(handler, True)
except Exception as e:

View File

@@ -118,7 +118,7 @@ class _TracerCore(ABC):
self._add_child_run(parent_run, run)
else:
if self.log_missing_parent:
logger.warning(
logger.debug(
f"Parent run {run.parent_run_id} not found for run {run.id}."
" Treating as a root run."
)

View File

@@ -123,7 +123,7 @@ class LangChainTracer(BaseTracer):
super()._start_trace(run)
if run._client is None:
run._client = self.client
run._client = self.client # type: ignore
def on_chat_model_start(
self,