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

Function _messages_to_transcript

uncommon_route/composition.py:664–674  ·  view source on GitHub ↗
(messages: list[dict[str, Any]])

Source from the content-addressed store, hash-verified

662
663
664def _messages_to_transcript(messages: list[dict[str, Any]]) -> str:
665 parts: list[str] = []
666 for msg in messages:
667 if not isinstance(msg, dict):
668 continue
669 role = str(msg.get("role", "unknown")).upper()
670 text = _content_to_text(msg.get("content"))
671 if not text:
672 continue
673 parts.append(f"[{role}]\n{text}")
674 return "\n\n".join(parts)
675
676
677def _split_leading_system(messages: list[dict[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:

Callers 1

_checkpoint_historyFunction · 0.85

Calls 3

_content_to_textFunction · 0.85
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected