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

Class CompositionResult

uncommon_route/composition.py:149–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148@dataclass(frozen=True, slots=True)
149class CompositionResult:
150 messages: list[dict[str, Any]]
151 input_tokens_before: int
152 input_tokens_after: int
153 artifact_ids: list[str] = field(default_factory=list)
154 compacted_messages: int = 0
155 offloaded_messages: int = 0
156 semantic_summaries: int = 0
157 checkpoint_created: bool = False
158 rehydrated_artifacts: int = 0
159 semantic_calls: int = 0
160 semantic_failures: int = 0
161 semantic_quality_fallbacks: int = 0
162 semantic_estimated_cost: float = 0.0
163 semantic_actual_cost: float = 0.0
164
165 @property
166 def changed(self) -> bool:
167 return (
168 self.input_tokens_after < self.input_tokens_before
169 or self.compacted_messages > 0
170 or self.offloaded_messages > 0
171 or self.semantic_summaries > 0
172 or self.checkpoint_created
173 or self.rehydrated_artifacts > 0
174 )
175
176
177DEFAULT_COMPOSITION_POLICY = CompositionPolicy()

Callers 2

_compose_deterministicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected