Spaces:
Sleeping
Sleeping
Download tests/test_context_window.py from baljot07/studiq-backend: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_context_window.py
- Command line
-
hf download hf://spaces/baljot07/studiq-backend/tests/test_context_window.py
-
curl -L -o test_context_window.py https://huggingface.co/spaces/baljot07/studiq-backend/resolve/main/tests/test_context_window.py
444 Bytes
| """Unit tests for chat context window compaction trigger thresholds.""" | |
| import pytest | |
| def test_compaction_trigger_on_message_count(): | |
| """Verify compaction triggers when message turns exceed threshold.""" | |
| def needs_compaction(turn_count: int, max_turns: int = 20) -> bool: | |
| return turn_count >= max_turns | |
| assert needs_compaction(12) is False | |
| assert needs_compaction(20) is True | |
| assert needs_compaction(25) is True | |