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

Function _record_turn

tests/test_conversation_endpoint.py:19–44  ·  view source on GitHub ↗
(
    store: TraceStore,
    *,
    ts: float,
    request_id: str,
    session_id: str,
    request_messages: list[dict],
    response_text: str,
    response_tool_calls: list[dict] | None = None,
    msg_hashes: list[str] | None = None,
    decision_tier: str = "MEDIUM",
)

Source from the content-addressed store, hash-verified

17
18
19def _record_turn(
20 store: TraceStore,
21 *,
22 ts: float,
23 request_id: str,
24 session_id: str,
25 request_messages: list[dict],
26 response_text: str,
27 response_tool_calls: list[dict] | None = None,
28 msg_hashes: list[str] | None = None,
29 decision_tier: str = "MEDIUM",
30) -> None:
31 store.record(
32 RequestTrace(
33 timestamp=ts,
34 request_id=request_id,
35 model="x",
36 status_code=200,
37 session_id=session_id,
38 decision_tier=decision_tier,
39 request_messages=request_messages,
40 response_text=response_text,
41 response_tool_calls=response_tool_calls,
42 msg_hashes=msg_hashes or [],
43 )
44 )
45
46
47def test_assemble_two_turn_conversation(tmp_path: Path) -> None:

Calls 2

RequestTraceClass · 0.90
recordMethod · 0.45

Tested by

no test coverage detected