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

Function _split_leading_system

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

Source from the content-addressed store, hash-verified

675
676
677def _split_leading_system(messages: list[dict[str, Any]]) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
678 leading: list[dict[str, Any]] = []
679 idx = 0
680 while idx < len(messages):
681 msg = messages[idx]
682 if isinstance(msg, dict) and msg.get("role") == "system":
683 leading.append(msg)
684 idx += 1
685 continue
686 break
687 return leading, messages[idx:]
688
689
690def _latest_user_text(messages: list[dict[str, Any]]) -> str:

Callers 1

_checkpoint_historyFunction · 0.85

Calls 2

getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected