From 353dc37a5be9e25d21c55e0816713520cae013f9 Mon Sep 17 00:00:00 2001
From: Wenyi Wang <wenyi.wang@kaust.edu.sa>
Date: Wed, 28 Feb 2024 14:23:55 +0300
Subject: [PATCH] a quick fix

---
 swarm/environment/prompt/common.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/swarm/environment/prompt/common.py b/swarm/environment/prompt/common.py
index 0453dab..dbfe2ca 100644
--- a/swarm/environment/prompt/common.py
+++ b/swarm/environment/prompt/common.py
@@ -8,6 +8,10 @@ def get_combine_materials(materials: Dict[str, Any], avoid_vague=True) -> str:
     for key, value in materials.items():
         if "No useful information from WebSearch" in value:
             continue
+        if isinstance(value, list):
+            value = "\n".join(value)
+        if not (isinstance(value, str) and isinstance(key, str)):
+            continue
         value = value.strip("\n").strip()
         if key != 'task' and value:
             question += f"\n\nReference information for {key}:" + \
-- 
GitLab