Flask / llm /aggregator.py
UntilDot's picture
Upload 9 files
a50063c verified
raw
history blame
352 Bytes
def aggregate_responses(responses: list) -> str:
if not responses:
return "No responses received."
# Sanitize: only join valid strings
safe_responses = [r if isinstance(r, str) else str(r) for r in responses]
combined = "\n".join(safe_responses)
return f"Final synthesized response based on multiple agents:\n{combined}"