Skip to content

Build and run agents you can see, understand and trust.

fix(formatter): validate input in the dashscope multi-agent formatter (#2952)

ANIRUDDHA ADAK8814da430124
diff --git a/src/agentscope/formatter/_dashscope_formatter.py b/src/agentscope/formatter/_dashscope_formatter.py
index cf17e3d42..9ea0a2acc 100644
--- a/src/agentscope/formatter/_dashscope_formatter.py
+++ b/src/agentscope/formatter/_dashscope_formatter.py
@@ -459,6 +459,8 @@ class DashScopeMultiAgentFormatter(_DashScopeFormatterBase):
A list of dictionaries formatted for the DashScope API.
"""
+ self.assert_list_of_msgs(msgs)
+
formatted_msgs = []
start_index = 0
if len(msgs) > 0 and msgs[0].role == "system":