Skip to content

Commit b075eab

Browse files
authored
Include delayed inputs in langchain tracer (#30546)
1 parent 372dc7f commit b075eab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libs/core/langchain_core/tracers/langchain.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ def _persist_run_single(self, run: Run) -> None:
222222
extra = run_dict.get("extra", {})
223223
extra["runtime"] = get_runtime_environment()
224224
run_dict["extra"] = extra
225-
inputs_is_truthy = bool(run_dict.get("inputs"))
225+
inputs_ = run_dict.get("inputs")
226+
if inputs_ and (len(inputs_) > 1 or bool(next(iter(inputs_.values())))):
227+
inputs_is_truthy = True
228+
else:
229+
inputs_is_truthy = False
226230
run.extra["inputs_is_truthy"] = inputs_is_truthy
227231
self.client.create_run(**run_dict, project_name=self.project_name)
228232
except Exception as e:

0 commit comments

Comments
 (0)