MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _flatten_tool_result

Function _flatten_tool_result

uncommon_route/proxy.py:2523–2532  ·  view source on GitHub ↗
(content: Any)

Source from the content-addressed store, hash-verified

2521
2522
2523def _flatten_tool_result(content: Any) -> str:
2524 if isinstance(content, str):
2525 return content
2526 if isinstance(content, list):
2527 parts: list[str] = []
2528 for b in content:
2529 if isinstance(b, dict) and b.get("type") == "text":
2530 parts.append(str(b.get("text", "")))
2531 return " ".join(parts)
2532 return str(content) if content else ""
2533
2534
2535def _trace_decision_card(trace: "RequestTrace") -> dict[str, Any]:

Callers 1

_assemble_conversationFunction · 0.85

Calls 2

getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected