Include delayed inputs in langchain tracer (#30546)

This commit is contained in:
William FH 2025-03-28 16:07:22 -07:00 committed by GitHub
parent 372dc7f991
commit b075eab3e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -222,7 +222,11 @@ class LangChainTracer(BaseTracer):
extra = run_dict.get("extra", {}) extra = run_dict.get("extra", {})
extra["runtime"] = get_runtime_environment() extra["runtime"] = get_runtime_environment()
run_dict["extra"] = extra run_dict["extra"] = extra
inputs_is_truthy = bool(run_dict.get("inputs")) inputs_ = run_dict.get("inputs")
if inputs_ and (len(inputs_) > 1 or bool(next(iter(inputs_.values())))):
inputs_is_truthy = True
else:
inputs_is_truthy = False
run.extra["inputs_is_truthy"] = inputs_is_truthy run.extra["inputs_is_truthy"] = inputs_is_truthy
self.client.create_run(**run_dict, project_name=self.project_name) self.client.create_run(**run_dict, project_name=self.project_name)
except Exception as e: except Exception as e: