Update llm/aggregator.py
Browse files- llm/aggregator.py +6 -3
llm/aggregator.py
CHANGED
@@ -2,6 +2,9 @@ def aggregate_responses(responses: list) -> str:
|
|
2 |
if not responses:
|
3 |
return "No responses received."
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
2 |
if not responses:
|
3 |
return "No responses received."
|
4 |
|
5 |
+
# Sanitize: only join valid strings
|
6 |
+
safe_responses = [r if isinstance(r, str) else str(r) for r in responses]
|
7 |
+
|
8 |
+
combined = "\n".join(safe_responses)
|
9 |
+
|
10 |
+
return f"Final synthesized response based on multiple agents:\n{combined}"
|