MCPcopy Create free account
hub / github.com/Emmimal/control-layer / _packet

Method _packet

control_layer.py:1047–1068  ·  view source on GitHub ↗
(
        self,
        prompt: str,
        response: str,
        attempts: int,
        start: float,
        validation: ValidationResult,
        budget: TokenBudget,
        strategy: RetryStrategy,
        audit_id: str,
    )

Source from the content-addressed store, hash-verified

1045 ))
1046
1047 def _packet(
1048 self,
1049 prompt: str,
1050 response: str,
1051 attempts: int,
1052 start: float,
1053 validation: ValidationResult,
1054 budget: TokenBudget,
1055 strategy: RetryStrategy,
1056 audit_id: str,
1057 ) -> ControlPacket:
1058 return ControlPacket(
1059 prompt=prompt,
1060 response=response,
1061 attempts=attempts,
1062 total_latency_ms=(time.perf_counter() - start) * 1000,
1063 validation=validation,
1064 token_budget_used=budget.used(),
1065 token_budget_total=self.config.total_tokens,
1066 strategy_used=strategy,
1067 audit_id=audit_id,
1068 )
1069
1070 @staticmethod
1071 def _hash(text: str) -> str:

Callers 1

runMethod · 0.95

Calls 2

ControlPacketClass · 0.85
usedMethod · 0.80

Tested by

no test coverage detected