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

Function _latest_user_index

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

Source from the content-addressed store, hash-verified

696
697
698def _latest_user_index(messages: list[dict[str, Any]]) -> int | None:
699 for idx in range(len(messages) - 1, -1, -1):
700 msg = messages[idx]
701 if isinstance(msg, dict) and msg.get("role") == "user":
702 return idx
703 return None
704
705
706def _extract_artifact_id(text: str) -> str:

Callers 2

_rehydrate_artifactsFunction · 0.85
_latest_user_textFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected