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

Function _build_semantic_artifact_stub

uncommon_route/composition.py:647–661  ·  view source on GitHub ↗
(artifact: dict[str, Any], summary: str, policy: CompositionPolicy)

Source from the content-addressed store, hash-verified

645
646
647def _build_semantic_artifact_stub(artifact: dict[str, Any], summary: str, policy: CompositionPolicy) -> str:
648 preview = summary[: policy.preview_chars].strip()
649 lines = [
650 f"[UncommonRoute artifact://{artifact['id']}]",
651 "Large tool result summarized via side-channel compression.",
652 (
653 f"tool={artifact.get('tool_name') or 'unknown'}"
654 f" tool_call_id={artifact.get('tool_call_id') or '-'}"
655 f" tokens~{artifact.get('token_estimate', 0)}"
656 f" sha256={str(artifact.get('sha256', ''))[:12]}"
657 ),
658 "summary:",
659 preview,
660 ]
661 return "\n".join(lines)
662
663
664def _messages_to_transcript(messages: list[dict[str, Any]]) -> str:

Callers 1

Calls 1

getMethod · 0.45

Tested by

no test coverage detected