Flask / llm /aggregator.py
UntilDot's picture
Update llm/aggregator.py
fb07cb8 verified
raw
history blame
351 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}"