From 7e036c6b2f853b6ffe1640c5712d6e486b68b554 Mon Sep 17 00:00:00 2001 From: Willy Douhard Date: Thu, 26 Sep 2024 19:12:24 +0200 Subject: [PATCH] fix: make callback handler serializable --- literalai/callback/langchain_callback.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/literalai/callback/langchain_callback.py b/literalai/callback/langchain_callback.py index 29c9b95..7c4584c 100644 --- a/literalai/callback/langchain_callback.py +++ b/literalai/callback/langchain_callback.py @@ -236,6 +236,9 @@ def __init__( else: self.to_keep = to_keep + def model_dump(self): + return {} + def on_chat_model_start( self, serialized: Dict[str, Any], @@ -377,12 +380,9 @@ def _start_trace(self, run: Run) -> None: if ignore: return - step_type: "TrueStepType" = "undefined" + step_type: "TrueStepType" = "run" if not self.steps else "undefined" if run.run_type == "agent": step_type = "run" - elif run.run_type == "chain": - if not self.steps: - step_type = "run" elif run.run_type == "llm": step_type = "llm" elif run.run_type == "retriever":