Skip to content

Commit 65cf22f

Browse files
authored
Merge pull request #84 from UiPath/fix/trace_io_copy
feat(trace): fix trace copyt inputs and outputs
2 parents e7d6e20 + 6cb6c0b commit 65cf22f

4 files changed

Lines changed: 11 additions & 166 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.0.108"
3+
version = "0.0.109"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.10"

src/uipath_langchain/tracers/AsyncUiPathTracer.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,18 @@ def _run_to_dict(self, run: Run):
246246
with warnings.catch_warnings():
247247
warnings.simplefilter("ignore", category=PydanticDeprecationWarning)
248248

249+
# Helper function to safely copy values
250+
def safe_copy(value):
251+
if value is None:
252+
return None
253+
if hasattr(value, "copy") and callable(value.copy):
254+
return value.copy()
255+
return value
256+
249257
return {
250258
**run.dict(exclude={"child_runs", "inputs", "outputs", "serialized"}),
251-
"inputs": run.inputs.copy() if run.inputs is not None else None,
252-
"outputs": run.outputs.copy() if run.outputs is not None else None,
259+
"inputs": safe_copy(run.inputs),
260+
"outputs": safe_copy(run.outputs),
253261
}
254262

255263
def _get_base_url(self) -> str:

src/uipath_langchain/tracers/UiPathTracer.py

Lines changed: 0 additions & 161 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
from ._instrument_traceable import _instrument_traceable_attributes
22
from .AsyncUiPathTracer import AsyncUiPathTracer
3-
from .UiPathTracer import UiPathTracer
43

54
__all__ = [
65
"AsyncUiPathTracer",
7-
"UiPathTracer",
86
"_instrument_traceable_attributes",
97
]

0 commit comments

Comments
 (0)