Download tests/computer_use/test_cua_perf_knobs.py from SaylorTwift/hermes-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/tests/computer_use/test_cua_perf_knobs.py
- Command line
-
hf download hf://SaylorTwift/hermes-agent/tests/computer_use/test_cua_perf_knobs.py
-
curl -L -o test_cua_perf_knobs.py https://huggingface.co/SaylorTwift/hermes-agent/resolve/main/tests/computer_use/test_cua_perf_knobs.py
1.32 kB
| """Behavior contracts for computer_use latency knobs.""" | |
| from unittest.mock import patch | |
| from tools.computer_use import cua_backend | |
| from tools.computer_use import tool as cu_tool | |
| def test_max_image_dimension_default(): | |
| with patch("hermes_cli.config.load_config", return_value={}): | |
| assert cua_backend._computer_use_max_image_dimension() == 1456 | |
| def test_capture_after_mode_default_som(): | |
| with patch("hermes_cli.config.load_config", return_value={}): | |
| assert cu_tool._capture_after_mode() == "som" | |
| def test_aux_vision_route_caches_per_provider_model(monkeypatch): | |
| cu_tool._AUX_VISION_ROUTE_CACHE.clear() | |
| calls = {"n": 0} | |
| monkeypatch.setattr( | |
| "agent.auxiliary_client._read_main_provider", lambda: "openai" | |
| ) | |
| monkeypatch.setattr( | |
| "agent.auxiliary_client._read_main_model", lambda: "gpt-test" | |
| ) | |
| def fake_load(): | |
| calls["n"] += 1 | |
| return {"auxiliary": {"vision": {}}} | |
| monkeypatch.setattr("hermes_cli.config.load_config", fake_load) | |
| monkeypatch.setattr( | |
| "tools.computer_use.vision_routing.should_route_capture_to_aux_vision", | |
| lambda *a, **k: True, | |
| ) | |
| assert cu_tool._should_route_through_aux_vision() is True | |
| assert cu_tool._should_route_through_aux_vision() is True | |
| assert calls["n"] == 1 | |