From 05996e43d42c04b375f92f62cc5c8ada287d2be7 Mon Sep 17 00:00:00 2001 From: Aymeric Date: Mon, 11 Nov 2024 19:22:42 +0100 Subject: [PATCH] Hopefully fix tests --- src/transformers/agents/monitoring.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/transformers/agents/monitoring.py b/src/transformers/agents/monitoring.py index 65ed3d79cfe6c9..755418d35a56a3 100644 --- a/src/transformers/agents/monitoring.py +++ b/src/transformers/agents/monitoring.py @@ -25,8 +25,10 @@ def pull_message(step_log: dict, test_mode: bool = True): if test_mode: class ChatMessage: - role: str - content: dict + def __init__(self, role, content, metadata=None): + self.role = role + self.content = content + self.metadata = metadata else: raise ImportError("Gradio should be installed in order to launch a gradio demo.") @@ -61,8 +63,10 @@ def stream_to_gradio(agent: ReactAgent, task: str, test_mode: bool = False, **kw if test_mode: class ChatMessage: - role: str - content: dict + def __init__(self, role, content, metadata=None): + self.role = role + self.content = content + self.metadata = metadata else: raise ImportError("Gradio should be installed in order to launch a gradio demo.")