chore/ 精简展示AI活动的日志

This commit is contained in:
Kevin
2026-04-03 13:49:24 +08:00
parent 43d1689e9c
commit 4cfa3843a7
11 changed files with 194 additions and 24 deletions

View File

@@ -195,3 +195,17 @@ def test_format_history_string_includes_system_for_debug_logs() -> None:
assert "System: SYS_INSTRUCTIONS" in s
assert "Human: hi" in s
assert "Assistant: hello" in s
def test_format_history_string_omit_system_body() -> None:
s = format_history_string(
[
SystemMessage(content="SYS_INSTRUCTIONS"),
HumanMessage(content="hi"),
],
omit_system_body=True,
)
assert "SYS_INSTRUCTIONS" not in s
assert "System: <omitted total_len=16" in s
assert "sha12=" in s
assert "Human: hi" in s