diff --git a/parea/utils/trace_utils.py b/parea/utils/trace_utils.py index ea467388..17193f43 100644 --- a/parea/utils/trace_utils.py +++ b/parea/utils/trace_utils.py @@ -70,6 +70,12 @@ def init_trace(func_name, args, kwargs, func) -> tuple[str, float]: inputs = {k: v for k, v in zip(parameters.keys(), args)} inputs.update(kwargs) + # filter out any values which aren't JSON serializable + for k, v in inputs.items(): + try: + json.dumps(v) + except TypeError: + inputs[k] = str(v) trace_data.get()[trace_id] = TraceLog( trace_id=trace_id, diff --git a/pyproject.toml b/pyproject.toml index f4e9f158..fe2e17d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "parea-ai" packages = [{ include = "parea" }] -version = "0.2.27" +version = "0.2.28" description = "Parea python sdk" readme = "README.md" authors = ["joel-parea-ai "]